移交子表补充排序序号SN
This commit is contained in:
@@ -50,6 +50,7 @@ namespace FineUIPro.Web.Transfer
|
||||
var model = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
txtSN.Text = model.SN.ToString();
|
||||
txtRotatingEquipment.Text = model.RotatingEquipment;
|
||||
txtSYSTEM.Text = model.SYSTEM;
|
||||
txtSubsystem.Text = model.Subsystem;
|
||||
@@ -61,6 +62,14 @@ namespace FineUIPro.Web.Transfer
|
||||
txtDescriptions.Text = model.Descriptions;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var model = Funs.DB.Transfer_RotatingEquipment.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
|
||||
if (model == null)
|
||||
txtSN.Text = "1001";
|
||||
else
|
||||
txtSN.Text = (model.SN + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +77,7 @@ namespace FineUIPro.Web.Transfer
|
||||
{
|
||||
var model = new Model.Transfer_RotatingEquipment
|
||||
{
|
||||
SN = Convert.ToInt32(txtSN.Text),
|
||||
ProjectId = ProjectId,
|
||||
RotatingEquipment = txtRotatingEquipment.Text,
|
||||
SYSTEM = txtSYSTEM.Text,
|
||||
@@ -104,11 +114,13 @@ namespace FineUIPro.Web.Transfer
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (!string.IsNullOrEmpty(Id))
|
||||
{
|
||||
var newModel = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.Id == Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.SN = model.SN;
|
||||
newModel.RotatingEquipment = txtRotatingEquipment.Text;
|
||||
newModel.SYSTEM = txtSYSTEM.Text;
|
||||
newModel.Subsystem = txtSubsystem.Text;
|
||||
|
||||
Reference in New Issue
Block a user