移交子表补充排序序号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_Telecom.FirstOrDefault(x => x.Id == Id);
if (model != null)
{
txtSN.Text = model.SN.ToString();
txtTelecom.Text = model.Telecom;
txtSystemName.Text = model.SystemName;
txtSubsystem.Text = model.Subsystem;
@@ -61,6 +62,14 @@ namespace FineUIPro.Web.Transfer
txtDescriptions.Text = model.Descriptions;
}
}
else
{
var model = Funs.DB.Transfer_Telecom.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_Telecom
{
SN = Convert.ToInt32(txtSN.Text),
ProjectId = ProjectId,
Telecom = txtTelecom.Text,
SystemName = txtSystemName.Text,
@@ -78,7 +88,6 @@ namespace FineUIPro.Web.Transfer
CableLaying = ddlCableLaying.SelectedValue,
FunctionTest = ddlFunctionTest.SelectedValue,
Descriptions= txtDescriptions.Text,
};
#region
@@ -105,11 +114,13 @@ namespace FineUIPro.Web.Transfer
}
#endregion
if (!string.IsNullOrEmpty(Id))
{
var newModel = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Id == Id);
if (newModel != null)
{
newModel.SN = model.SN;
newModel.Telecom = txtTelecom.Text;
newModel.SystemName = txtSystemName.Text;
newModel.Subsystem = txtSubsystem.Text;