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; }
|
}
|
}
|