移交子表补充排序序号SN

This commit is contained in:
2024-12-14 10:27:27 +08:00
parent ea336ebf21
commit 51d20396ea
30 changed files with 381 additions and 26 deletions
@@ -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;