移交,管道和仪表数据导入顺序不变

This commit is contained in:
夏菊 2024-12-10 14:31:15 +08:00
parent f419dd641d
commit 1439da7cd6
12 changed files with 128 additions and 3 deletions

View File

@ -15,7 +15,8 @@
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" OnSort="Grid1_Sort" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="SN"
SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" EnableTextSelection="true"> EnableRowDoubleClickEvent="true" EnableTextSelection="true">
<Toolbars> <Toolbars>

View File

@ -81,7 +81,7 @@ namespace FineUIPro.Web.Transfer
strSql += " AND Test_Package like @SysSubNo"; strSql += " AND Test_Package like @SysSubNo";
listStr.Add(new SqlParameter("@SysSubNo", "%" + this.txtSysSubNo.Text.Trim() + "%")); listStr.Add(new SqlParameter("@SysSubNo", "%" + this.txtSysSubNo.Text.Trim() + "%"));
} }
strSql += " order by INSTRUMENTATION "; //strSql += " order by SN ";
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);

View File

@ -306,9 +306,19 @@ namespace FineUIPro.Web.Transfer
} }
string result = string.Empty; string result = string.Empty;
ir = pds.Rows.Count; ir = pds.Rows.Count;
int Sn = 0;
if (pds != null && ir > 0) if (pds != null && ir > 0)
{ {
List<Model.Transfer_Instrumentation> list = new List<Model.Transfer_Instrumentation>(); List<Model.Transfer_Instrumentation> list = new List<Model.Transfer_Instrumentation>();
//根据项目id查询sn
var snModel = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault();
if (snModel == null && Sn == 0)
{
Sn = 1000;
}
else {
Sn = snModel.SN;
}
for (int i = 1; i < ir; i++) for (int i = 1; i < ir; i++)
{ {
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
@ -322,6 +332,10 @@ namespace FineUIPro.Web.Transfer
model.Descriptions= pds.Rows[i][1].ToString().Trim(); model.Descriptions= pds.Rows[i][1].ToString().Trim();
model.Id = Guid.NewGuid().ToString(); model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId; model.ProjectId = CurrUser.LoginProjectId;
Sn += 1;
model.SN = Sn;
model.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim(); model.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim();
model.SystemName = pds.Rows[i][1+1].ToString().Trim(); model.SystemName = pds.Rows[i][1+1].ToString().Trim();
model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim(); model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim();

View File

@ -19,6 +19,8 @@
<f:TextBox ID="txtINSTRUMENTATION" runat="server" Label="Tag No" LabelAlign="Right" <f:TextBox ID="txtINSTRUMENTATION" runat="server" Label="Tag No" LabelAlign="Right"
LabelWidth="180px" Required="true" ShowRedStar="true"> LabelWidth="180px" Required="true" ShowRedStar="true">
</f:TextBox> </f:TextBox>
<f:NumberBox ID="txtSN" NoDecimal="true" ShowTrigger="false" runat="server" Label="SN" LabelAlign="Right" LabelWidth="180px" Required="true" ShowRedStar="true">
</f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>

View File

@ -51,6 +51,7 @@ namespace FineUIPro.Web.Transfer
var model = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.Id == Id); var model = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.Id == Id);
if (model != null) if (model != null)
{ {
txtSN.Text = model.SN.ToString();
txtINSTRUMENTATION.Text = model.INSTRUMENTATION; txtINSTRUMENTATION.Text = model.INSTRUMENTATION;
txtSystemName.Text = model.SystemName; txtSystemName.Text = model.SystemName;
txtSubsystem.Text = model.Subsystem; txtSubsystem.Text = model.Subsystem;
@ -64,6 +65,14 @@ namespace FineUIPro.Web.Transfer
txtDescriptions.Text = model.Descriptions; txtDescriptions.Text = model.Descriptions;
} }
} }
else
{
var model = Funs.DB.Transfer_Instrumentation.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
if (model == null)
txtSN.Text = "1001";
else
txtSN.Text = (model.SN + 1).ToString();
}
} }
} }
@ -71,6 +80,7 @@ namespace FineUIPro.Web.Transfer
{ {
var model = new Model.Transfer_Instrumentation var model = new Model.Transfer_Instrumentation
{ {
SN = Convert.ToInt32(txtSN.Text),
ProjectId = ProjectId, ProjectId = ProjectId,
INSTRUMENTATION = txtINSTRUMENTATION.Text, INSTRUMENTATION = txtINSTRUMENTATION.Text,
SystemName = txtSystemName.Text, SystemName = txtSystemName.Text,
@ -118,6 +128,7 @@ namespace FineUIPro.Web.Transfer
var newModel = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.Id == Id); var newModel = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.Id == Id);
if (newModel != null) if (newModel != null)
{ {
newModel.SN = model.SN;
newModel.INSTRUMENTATION = txtINSTRUMENTATION.Text; newModel.INSTRUMENTATION = txtINSTRUMENTATION.Text;
newModel.SystemName = txtSystemName.Text; newModel.SystemName = txtSystemName.Text;
newModel.Subsystem = txtSubsystem.Text; newModel.Subsystem = txtSubsystem.Text;

View File

@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtINSTRUMENTATION; protected global::FineUIPro.TextBox txtINSTRUMENTATION;
/// <summary>
/// txtSN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtSN;
/// <summary> /// <summary>
/// txtSystemName 控件。 /// txtSystemName 控件。
/// </summary> /// </summary>

View File

@ -15,7 +15,7 @@
<items> <items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="PIPINGLINENUMBER" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="SN"
SortDirection="ASC" OnSort="Grid1_Sort" SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="true"> EnableTextSelection="true">
@ -50,6 +50,9 @@
</f:Toolbar> </f:Toolbar>
</toolbars> </toolbars>
<columns> <columns>
<%-- <f:RenderField ColumnID="SN" DataField="SN" FieldType="String" HeaderText="SN" TextAlign="Center"
HeaderTextAlign="Center" MinWidth="70px">
</f:RenderField>--%>
<f:GroupField ID="g1" HeaderText="PIPING" HeaderTextAlign="Center"> <f:GroupField ID="g1" HeaderText="PIPING" HeaderTextAlign="Center">
<columns> <columns>
<f:RenderField ColumnID="PIPINGLINENUMBER" DataField="PIPINGLINENUMBER" FieldType="String" HeaderText="Test Package No" TextAlign="Center" <f:RenderField ColumnID="PIPINGLINENUMBER" DataField="PIPINGLINENUMBER" FieldType="String" HeaderText="Test Package No" TextAlign="Center"

View File

@ -302,6 +302,17 @@ namespace FineUIPro.Web.Transfer
} }
string result = string.Empty; string result = string.Empty;
ir = pds.Rows.Count; ir = pds.Rows.Count;
int Sn = 0;
//根据项目id查询sn
var snModel = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault();
if (snModel == null && Sn == 0)
{
Sn = 1000;
}
else
{
Sn = snModel.SN;
}
if (pds != null && ir > 0) if (pds != null && ir > 0)
{ {
List<Model.Transfer_Piping> list = new List<Model.Transfer_Piping>(); List<Model.Transfer_Piping> list = new List<Model.Transfer_Piping>();
@ -315,6 +326,10 @@ namespace FineUIPro.Web.Transfer
Model.Transfer_Piping model = new Model.Transfer_Piping(); Model.Transfer_Piping model = new Model.Transfer_Piping();
model.Id = Guid.NewGuid().ToString(); model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId; model.ProjectId = CurrUser.LoginProjectId;
Sn += 1;
model.SN = Sn;
model.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim(); model.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim();
model.Descriptions = pds.Rows[i][1].ToString().Trim(); model.Descriptions = pds.Rows[i][1].ToString().Trim();
model.SYSTEM = pds.Rows[i][1 + 1].ToString().Trim(); model.SYSTEM = pds.Rows[i][1 + 1].ToString().Trim();

View File

@ -19,6 +19,8 @@
<f:TextBox ID="txtPIPINGLINENUMBER" runat="server" Label="Test Package No" LabelAlign="Right" <f:TextBox ID="txtPIPINGLINENUMBER" runat="server" Label="Test Package No" LabelAlign="Right"
LabelWidth="180px" Required="true" ShowRedStar="true"> LabelWidth="180px" Required="true" ShowRedStar="true">
</f:TextBox> </f:TextBox>
<f:NumberBox ID="txtSN" NoDecimal="true" ShowTrigger="false" runat="server" Label="SN" LabelAlign="Right" LabelWidth="180px" Required="true" ShowRedStar="true">
</f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>

View File

@ -50,6 +50,7 @@ namespace FineUIPro.Web.Transfer
var model = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.Id == Id); var model = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.Id == Id);
if (model != null) if (model != null)
{ {
txtSN.Text = model.SN.ToString();
txtPIPINGLINENUMBER.Text = model.PIPINGLINENUMBER; txtPIPINGLINENUMBER.Text = model.PIPINGLINENUMBER;
txtSYSTEM.Text = model.SYSTEM; txtSYSTEM.Text = model.SYSTEM;
txtSubsystem.Text = model.Subsystem; txtSubsystem.Text = model.Subsystem;
@ -76,6 +77,14 @@ namespace FineUIPro.Web.Transfer
ddlInsulation.SelectedValue = model.Insulation; ddlInsulation.SelectedValue = model.Insulation;
} }
} }
else
{
var model = Funs.DB.Transfer_Piping.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
if (model == null)
txtSN.Text = "1001";
else
txtSN.Text = (model.SN + 1).ToString();
}
} }
} }
@ -83,6 +92,7 @@ namespace FineUIPro.Web.Transfer
{ {
var model = new Model.Transfer_Piping() var model = new Model.Transfer_Piping()
{ {
SN = Convert.ToInt32(txtSN.Text),
ProjectId = ProjectId, ProjectId = ProjectId,
PIPINGLINENUMBER = txtPIPINGLINENUMBER.Text, PIPINGLINENUMBER = txtPIPINGLINENUMBER.Text,
SYSTEM = txtSYSTEM.Text, SYSTEM = txtSYSTEM.Text,
@ -154,6 +164,7 @@ namespace FineUIPro.Web.Transfer
if (!string.IsNullOrEmpty(Id)) if (!string.IsNullOrEmpty(Id))
{ {
var newModel = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.Id == Id); var newModel = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.Id == Id);
newModel.SN = model.SN;
newModel.PIPINGLINENUMBER = model.PIPINGLINENUMBER; newModel.PIPINGLINENUMBER = model.PIPINGLINENUMBER;
newModel.SYSTEM = model.SYSTEM; newModel.SYSTEM = model.SYSTEM;
newModel.Subsystem = newModel.Subsystem; newModel.Subsystem = newModel.Subsystem;

View File

@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtPIPINGLINENUMBER; protected global::FineUIPro.TextBox txtPIPINGLINENUMBER;
/// <summary>
/// txtSN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtSN;
/// <summary> /// <summary>
/// txtSYSTEM 控件。 /// txtSYSTEM 控件。
/// </summary> /// </summary>

View File

@ -396054,6 +396054,8 @@ namespace Model
private string _Calibration; private string _Calibration;
private int _SN;
#region #region
partial void OnLoaded(); partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -396092,6 +396094,8 @@ namespace Model
partial void OnDescriptionsChanged(); partial void OnDescriptionsChanged();
partial void OnCalibrationChanging(string value); partial void OnCalibrationChanging(string value);
partial void OnCalibrationChanged(); partial void OnCalibrationChanged();
partial void OnSNChanging(int value);
partial void OnSNChanged();
#endregion #endregion
public Transfer_Instrumentation() public Transfer_Instrumentation()
@ -396439,6 +396443,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")]
public int SN
{
get
{
return this._SN;
}
set
{
if ((this._SN != value))
{
this.OnSNChanging(value);
this.SendPropertyChanging();
this._SN = value;
this.SendPropertyChanged("SN");
this.OnSNChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
@ -396926,6 +396950,8 @@ namespace Model
private string _Insulation; private string _Insulation;
private int _SN;
#region #region
partial void OnLoaded(); partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -396992,6 +397018,8 @@ namespace Model
partial void OnElectricHeatTracingChanged(); partial void OnElectricHeatTracingChanged();
partial void OnInsulationChanging(string value); partial void OnInsulationChanging(string value);
partial void OnInsulationChanged(); partial void OnInsulationChanged();
partial void OnSNChanging(int value);
partial void OnSNChanged();
#endregion #endregion
public Transfer_Piping() public Transfer_Piping()
@ -397619,6 +397647,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")]
public int SN
{
get
{
return this._SN;
}
set
{
if ((this._SN != value))
{
this.OnSNChanging(value);
this.SendPropertyChanging();
this._SN = value;
this.SendPropertyChanged("SN");
this.OnSNChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;