using HStation.Dto; using Yw.Dto; namespace HStation.WinFrmUI.Xhs.Core { public class XhsProjectViewModel : XhsProjectDto { public XhsProjectViewModel() { } public XhsProjectViewModel(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(XhsProjectViewModel 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 SetUploadStatusAsync(XhsProjectViewModel 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 SetUploadStatusAsync(XhsProjectDto model) { var prjviewmodel = new XhsProjectViewModel(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; } /// /// 上传状态 /// public string eUploadStatus { get; set; } } }