移交子表补充排序序号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_Civil_Structure.FirstOrDefault(x => x.Id == Id);
if (model != null)
{
txtSN.Text = model.SN.ToString();
txtCivil_Structure.Text = model.Civil_Structure;
txtSystemName.Text = model.SystemName;
txtSubsystem.Text = model.Subsystem;
@@ -66,6 +67,14 @@ namespace FineUIPro.Web.Transfer
txtDescriptions.Text = model.Descriptions;
}
}
else
{
var model = Funs.DB.Transfer_Civil_Structure.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
if (model == null)
txtSN.Text = "1001";
else
txtSN.Text = (model.SN + 1).ToString();
}
}
}
@@ -73,6 +82,7 @@ namespace FineUIPro.Web.Transfer
{
var model = new Model.Transfer_Civil_Structure
{
SN = Convert.ToInt32(txtSN.Text),
ProjectId = ProjectId,
Civil_Structure = txtCivil_Structure.Text,
SystemName = txtSystemName.Text,
@@ -120,11 +130,13 @@ namespace FineUIPro.Web.Transfer
}
#endregion
if (!string.IsNullOrEmpty(Id))
{
var newModel = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Id == Id);
if (newModel != null)
{
newModel.SN = model.SN;
newModel.Civil_Structure = txtCivil_Structure.Text;
newModel.SystemName = txtSystemName.Text;
newModel.Subsystem = txtSubsystem.Text;