duheng
2024-06-25 43e88ef24c6b3a7988c495d1740e68e33ce52f84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using HStation.BLL;
using HStation.Dto;
using HStation.Xhs;
using Yw.Dto;
 
namespace HStation.WinFrmUI.Xhs.Project
{
    public class ProjectViewModel : XhsProjectDto
    {
        public ProjectViewModel()
        {
        }
 
        public ProjectViewModel(XhsProjectDto rhs)
        {
            this.ID = rhs.ID;
            this.Name = rhs.Name;
            this.Paras = rhs.Paras;
            this.PrjNumber = rhs.PrjNumber;
            this.Flags = rhs.Flags;
            this.TagName = rhs.TagName;
            this.Address = rhs.Address;
            this.UseStatus = rhs.UseStatus;
            this.SortCode = rhs.SortCode;
            this.Description = rhs.Description;
            this.CreateTime = rhs.CreateTime;
            this.CustomerName = rhs.CustomerName;
            this.CreateUserID = rhs.CreateUserID;
            this.Version = rhs.Version;
            this.MapPosition = rhs.MapPosition;
            this.CreateUserDisplayName = rhs.CreateUserDisplayName;
        }
 
        public void Reset(ProjectViewModel rhs)
        {
            this.ID = rhs.ID;
            this.Name = rhs.Name;
            this.Paras = rhs.Paras;
            this.Flags = rhs.Flags;
            this.TagName = rhs.TagName;
            this.SortCode = rhs.SortCode;
            this.Description = rhs.Description;
            this.CreateTime = rhs.CreateTime;
            this.CustomerName = rhs.CustomerName;
            this.CreateUserID = rhs.CreateUserID;
            this.Version = rhs.Version;
            this.MapPosition = rhs.MapPosition;
            this.CreateUserDisplayName = rhs.CreateUserDisplayName;
        }
 
        public void Reset(UpdateXhsProjectInput rhs)
        {
            this.ID = rhs.ID;
            this.GID = rhs.GID;
            this.Name = rhs.Name;
            this.Paras = rhs.Paras;
            this.Flags = rhs.Flags;
            this.PrjNumber = rhs.PrjNumber;
            this.TagName = rhs.TagName;
            this.Address = rhs.Address;
            this.SortCode = rhs.SortCode;
            this.Description = rhs.Description;
            this.CreateTime = rhs.CreateTime;
            this.CustomerName = rhs.CustomerName;
            this.CreateUserID = rhs.CreateUserID;
            this.Version = rhs.Version;
            this.MapPosition = rhs.MapPosition;
            this.CreateUserDisplayName = rhs.CreateUserDisplayName;
        }
 
        public async Task<ProjectViewModel> SetUploadStatusAsync(ProjectViewModel model)
        {
            var modelbll = new BLL.XhsProjectItemModel();
            var result = await modelbll.GetByPrjID(model.ID);
            var select = result.Where(x => x.UseStatus == 1).FirstOrDefault();
            if (select != null)
            {
                if (select.UploadStatus == HStation.Xhs.eUploadStatus.Disable)
                {
                    model.eUploadStatus = "未上传";
                }
                else if (select.UploadStatus == HStation.Xhs.eUploadStatus.Enable)
                {
                    model.eUploadStatus = "已上传";
                }
                else
                {
                    model.eUploadStatus = "上传中";
                }
            }
            return model;
        }
 
        public async Task<ProjectViewModel> SetUploadStatusAsync(XhsProjectDto model)
        {
            var prjviewmodel = new ProjectViewModel(model);
            var modelbll = new BLL.XhsProjectItemModel();
            var result = await modelbll.GetByPrjID(model.ID);
            var select = result.Find(x => x.UseStatus == 1);
            if (select != null)
            {
                if (select.UploadStatus == HStation.Xhs.eUploadStatus.Disable)
                {
                    prjviewmodel.eUploadStatus = "未上传";
                }
                else if (select.UploadStatus == HStation.Xhs.eUploadStatus.Enable)
                {
                    prjviewmodel.eUploadStatus = "已上传";
                }
                else
                {
                    prjviewmodel.eUploadStatus = "上传中";
                }
            }
            return prjviewmodel;
        }
 
        /// <summary>
        /// 上传状态
        /// </summary>
        public string eUploadStatus { get; set; }
    }
}