移交子表补充排序序号SN
This commit is contained in:
@@ -51,6 +51,7 @@ namespace FineUIPro.Web.Transfer
|
||||
var model = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
txtSN.Text = model.SN.ToString();
|
||||
txtELECTRICAL.Text = model.ELECTRICAL;
|
||||
txtSystemName.Text = model.SystemName;
|
||||
txtSubsystem.Text = model.Subsystem;
|
||||
@@ -62,6 +63,14 @@ namespace FineUIPro.Web.Transfer
|
||||
txtDescriptions.Text = model.Descriptions;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var model = Funs.DB.Transfer_Electrical.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
|
||||
if (model == null)
|
||||
txtSN.Text = "1001";
|
||||
else
|
||||
txtSN.Text = (model.SN + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +78,7 @@ namespace FineUIPro.Web.Transfer
|
||||
{
|
||||
var model = new Model.Transfer_Electrical
|
||||
{
|
||||
SN = Convert.ToInt32(txtSN.Text),
|
||||
ProjectId = ProjectId,
|
||||
ELECTRICAL = txtELECTRICAL.Text,
|
||||
SystemName = txtSystemName.Text,
|
||||
@@ -107,11 +117,13 @@ namespace FineUIPro.Web.Transfer
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (!string.IsNullOrEmpty(Id))
|
||||
{
|
||||
var newModel = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.Id == Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.SN = model.SN;
|
||||
newModel.ELECTRICAL = txtELECTRICAL.Text;
|
||||
newModel.SystemName = txtSystemName.Text;
|
||||
newModel.Subsystem = txtSubsystem.Text;
|
||||
|
||||
Reference in New Issue
Block a user