This commit is contained in:
2023-03-01 13:57:18 +08:00
14 changed files with 81 additions and 21 deletions
@@ -0,0 +1,2 @@
alter table [dbo].[Material_Equipment] add Factory nvarchar(100) null
GO
@@ -37,6 +37,7 @@ namespace BLL
newEquipment.ArrivalDate = Equipment.ArrivalDate; newEquipment.ArrivalDate = Equipment.ArrivalDate;
newEquipment.CompileMan = Equipment.CompileMan; newEquipment.CompileMan = Equipment.CompileMan;
newEquipment.CompileDate = Equipment.CompileDate; newEquipment.CompileDate = Equipment.CompileDate;
newEquipment.Factory = Equipment.Factory;
db.Material_Equipment.InsertOnSubmit(newEquipment); db.Material_Equipment.InsertOnSubmit(newEquipment);
db.SubmitChanges(); db.SubmitChanges();
} }
@@ -62,6 +63,7 @@ namespace BLL
newEquipment.Num = Equipment.Num; newEquipment.Num = Equipment.Num;
newEquipment.ArrivalDate = Equipment.ArrivalDate; newEquipment.ArrivalDate = Equipment.ArrivalDate;
newEquipment.InspectionId = Equipment.InspectionId; newEquipment.InspectionId = Equipment.InspectionId;
newEquipment.Factory = Equipment.Factory;
db.SubmitChanges(); db.SubmitChanges();
} }
} }
@@ -46,7 +46,7 @@
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtProjectName" runat="server" LabelWidth="120px" Readonly="true" Label="项目名称" LabelAlign="Right" <f:TextBox ID="txtProjectName" runat="server" LabelWidth="120px" Readonly="true" Label="项目名称" LabelAlign="Right"
MaxLength="50"> >
</f:TextBox> </f:TextBox>
<f:TextBox ID="txtJointCheckCode" runat="server" LabelWidth="110px" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right" <f:TextBox ID="txtJointCheckCode" runat="server" LabelWidth="110px" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right"
MaxLength="50"> MaxLength="50">
@@ -60,7 +60,7 @@
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtProjectName" runat="server" LabelWidth="120px" Readonly="true" Label="项目名称" LabelAlign="Right" <f:TextBox ID="txtProjectName" runat="server" LabelWidth="120px" Readonly="true" Label="项目名称" LabelAlign="Right"
MaxLength="50" Enabled="false"> Enabled="false">
</f:TextBox> </f:TextBox>
<f:TextBox ID="txtJointCheckCode" runat="server" LabelWidth="110px" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right" <f:TextBox ID="txtJointCheckCode" runat="server" LabelWidth="110px" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right"
MaxLength="50" Enabled="false"> MaxLength="50" Enabled="false">
@@ -29,7 +29,7 @@
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left"> <f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items> <Items>
<f:DropDownList ID="drpUnit" runat="server" Label="供货单位" LabelAlign="Right" LabelWidth="80px" EnableEdit="true"> <f:DropDownList ID="drpUnit" runat="server" Label="采购单位" LabelAlign="Right" LabelWidth="80px" EnableEdit="true">
</f:DropDownList> </f:DropDownList>
<f:DropDownList ID="drpMainItem" runat="server" Label="主项" LabelAlign="Right" EnableEdit="true" LabelWidth="60px"> <f:DropDownList ID="drpMainItem" runat="server" Label="主项" LabelAlign="Right" EnableEdit="true" LabelWidth="60px">
</f:DropDownList> </f:DropDownList>
@@ -67,7 +67,7 @@
HeaderTextAlign="Center"> HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="180px" ColumnID="UnitName" DataField="UnitName" <f:RenderField Width="180px" ColumnID="UnitName" DataField="UnitName"
FieldType="String" HeaderText="供货单位名称" TextAlign="Center" FieldType="String" HeaderText="采购单位" TextAlign="Center"
HeaderTextAlign="Center"> HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="120px" ColumnID="MainItemName" DataField="MainItemName" <f:RenderField Width="120px" ColumnID="MainItemName" DataField="MainItemName"
@@ -82,6 +82,9 @@
<f:RenderField Width="100px" ColumnID="EquipmentCode" DataField="EquipmentCode" <f:RenderField Width="100px" ColumnID="EquipmentCode" DataField="EquipmentCode"
FieldType="String" HeaderText="设备位号" TextAlign="Center" HeaderTextAlign="Center"> FieldType="String" HeaderText="设备位号" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="100px" ColumnID="Factory" DataField="Factory"
FieldType="String" HeaderText="生产厂家" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="PressClass" DataField="PressClass" <f:RenderField Width="100px" ColumnID="PressClass" DataField="PressClass"
FieldType="String" HeaderText="压力等级" TextAlign="Center" HeaderTextAlign="Center"> FieldType="String" HeaderText="压力等级" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
@@ -18,7 +18,7 @@
<f:TextBox ID="txtContractNo" runat="server" Label="合同编号" <f:TextBox ID="txtContractNo" runat="server" Label="合同编号"
MaxLength="70" LabelWidth="100px"> MaxLength="70" LabelWidth="100px">
</f:TextBox> </f:TextBox>
<f:DropDownList ID="drpUnit" runat="server" ShowRedStar="true" Label="供货单位" LabelWidth="100px" LabelAlign="Right" EnableEdit="true"> <f:DropDownList ID="drpUnit" runat="server" ShowRedStar="true" Label="采购单位" LabelWidth="100px" LabelAlign="Right" EnableEdit="true">
</f:DropDownList> </f:DropDownList>
</Items> </Items>
</f:FormRow> </f:FormRow>
@@ -36,7 +36,7 @@
<f:TextBox ID="txtSpecificationAndModel" runat="server" Label="规格型号" <f:TextBox ID="txtSpecificationAndModel" runat="server" Label="规格型号"
MaxLength="70" LabelWidth="100px" > MaxLength="70" LabelWidth="100px" >
</f:TextBox> </f:TextBox>
<f:TextBox ID="txtEquipmentCode" runat="server" Label="设备位号" ShowRedStar="true" Required="true" <f:TextBox ID="txtEquipmentCode" runat="server" Label="设备位号"
MaxLength="70" LabelWidth="100px"> MaxLength="70" LabelWidth="100px">
</f:TextBox> </f:TextBox>
</Items> </Items>
@@ -61,6 +61,14 @@
</f:NumberBox> </f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtFactory" runat="server" Label="生产厂家" ShowRedStar="true" Required="true"
MaxLength="100" LabelWidth="100px">
</f:TextBox>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Rows> </Rows>
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server"> <f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
@@ -56,6 +56,7 @@ namespace FineUIPro.Web.CQMS.Material
{ {
this.txtArrivalDate.Text = string.Format("{0:yyyy-MM-dd}", Equipment.ArrivalDate); this.txtArrivalDate.Text = string.Format("{0:yyyy-MM-dd}", Equipment.ArrivalDate);
} }
this.txtFactory.Text = Equipment.Factory;
} }
} }
} }
@@ -67,7 +68,7 @@ namespace FineUIPro.Web.CQMS.Material
{ {
if (this.drpUnit.SelectedValue == BLL.Const._Null) if (this.drpUnit.SelectedValue == BLL.Const._Null)
{ {
Alert.ShowInTop("请选择供货单位!", MessageBoxIcon.Warning); Alert.ShowInTop("请选择采购单位!", MessageBoxIcon.Warning);
return; return;
} }
//if (this.drpMainItem.SelectedValue == BLL.Const._Null) //if (this.drpMainItem.SelectedValue == BLL.Const._Null)
@@ -101,6 +102,7 @@ namespace FineUIPro.Web.CQMS.Material
Equipment.Unit = this.txtUnit.Text.Trim(); Equipment.Unit = this.txtUnit.Text.Trim();
Equipment.Num = Funs.GetNewDecimalOrZero(this.txtNum.Text.Trim()); Equipment.Num = Funs.GetNewDecimalOrZero(this.txtNum.Text.Trim());
Equipment.ArrivalDate = Funs.GetNewDateTime(this.txtArrivalDate.Text.Trim()); Equipment.ArrivalDate = Funs.GetNewDateTime(this.txtArrivalDate.Text.Trim());
Equipment.Factory = this.txtFactory.Text.Trim();
Equipment.CompileMan = this.CurrUser.PersonId; Equipment.CompileMan = this.CurrUser.PersonId;
Equipment.CompileDate = DateTime.Now; Equipment.CompileDate = DateTime.Now;
if (!string.IsNullOrEmpty(EquipmentId)) if (!string.IsNullOrEmpty(EquipmentId))
@@ -129,6 +129,15 @@ namespace FineUIPro.Web.CQMS.Material {
/// </remarks> /// </remarks>
protected global::FineUIPro.NumberBox txtNum; protected global::FineUIPro.NumberBox txtNum;
/// <summary>
/// txtFactory 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtFactory;
/// <summary> /// <summary>
/// Toolbar1 控件。 /// Toolbar1 控件。
/// </summary> /// </summary>
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Material
oleDBConn.Close(); oleDBConn.Close();
oleDBConn.Dispose(); oleDBConn.Dispose();
hdCheckResult.Text = "1"; hdCheckResult.Text = "1";
AddDatasetToSQL(ds.Tables[0], 10); AddDatasetToSQL(ds.Tables[0], 11);
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -180,14 +180,14 @@ namespace FineUIPro.Web.CQMS.Material
string row1 = pds.Rows[i][1].ToString(); string row1 = pds.Rows[i][1].ToString();
if (string.IsNullOrEmpty(row1)) if (string.IsNullOrEmpty(row1))
{ {
result += (i + 2).ToString() + "," + "供货单位名称" + "," + "此项为必填项!" + "|"; result += (i + 2).ToString() + "," + "采购单位" + "," + "此项为必填项!" + "|";
} }
else else
{ {
var unit = units.FirstOrDefault(x => x.UnitName == row1); var unit = units.FirstOrDefault(x => x.UnitName == row1);
if (unit == null) if (unit == null)
{ {
result += (i + 2).ToString() + "," + "供货单位名称" + "," + "[" + row1 + "]不存在!" + "|"; result += (i + 2).ToString() + "," + "采购单位" + "," + "[" + row1 + "]不存在!" + "|";
} }
} }
@@ -219,11 +219,11 @@ namespace FineUIPro.Web.CQMS.Material
// result += (i + 2).ToString() + "," + "规格型号" + "," + "此项为必填项!" + "|"; // result += (i + 2).ToString() + "," + "规格型号" + "," + "此项为必填项!" + "|";
//} //}
string row5 = pds.Rows[i][5].ToString(); //string row5 = pds.Rows[i][5].ToString();
if (string.IsNullOrEmpty(row5)) //if (string.IsNullOrEmpty(row5))
{ //{
result += (i + 2).ToString() + "," + "设备位号" + "," + "此项为必填项!" + "|"; // result += (i + 2).ToString() + "," + "设备位号" + "," + "此项为必填项!" + "|";
} //}
string row8 = pds.Rows[i][8].ToString(); string row8 = pds.Rows[i][8].ToString();
if (!string.IsNullOrEmpty(row8)) if (!string.IsNullOrEmpty(row8))
@@ -258,6 +258,12 @@ namespace FineUIPro.Web.CQMS.Material
//{ //{
// result += (i + 2).ToString() + "," + "到货日期" + "," + "此项为必填项!" + "|"; // result += (i + 2).ToString() + "," + "到货日期" + "," + "此项为必填项!" + "|";
//} //}
string row10 = pds.Rows[i][10].ToString();
if (string.IsNullOrEmpty(row10))
{
result += (i + 2).ToString() + "," + "生产厂家" + "," + "此项为必填项!" + "|";
}
} }
} }
if (!string.IsNullOrEmpty(result)) if (!string.IsNullOrEmpty(result))
@@ -365,7 +371,7 @@ namespace FineUIPro.Web.CQMS.Material
oleDBConn.Close(); oleDBConn.Close();
oleDBConn.Dispose(); oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 10); AddDatasetToSQL2(ds.Tables[0], 11);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -411,7 +417,10 @@ namespace FineUIPro.Web.CQMS.Material
equipment.ProjectId = this.CurrUser.LoginProjectId; equipment.ProjectId = this.CurrUser.LoginProjectId;
equipment.ContractNo = pds.Rows[i][0].ToString().Trim(); equipment.ContractNo = pds.Rows[i][0].ToString().Trim();
equipment.UnitId = units.First(e => e.UnitName == pds.Rows[i][1].ToString().Trim()).UnitId; equipment.UnitId = units.First(e => e.UnitName == pds.Rows[i][1].ToString().Trim()).UnitId;
equipment.MainItemId = mainItems.First(e => e.MainItemName == pds.Rows[i][2].ToString().Trim()).MainItemId; if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
{
equipment.MainItemId = mainItems.First(e => e.MainItemName == pds.Rows[i][2].ToString().Trim()).MainItemId;
}
equipment.EquipmentName = pds.Rows[i][3].ToString().Trim(); equipment.EquipmentName = pds.Rows[i][3].ToString().Trim();
equipment.SpecificationAndModel = pds.Rows[i][4].ToString().Trim(); equipment.SpecificationAndModel = pds.Rows[i][4].ToString().Trim();
equipment.EquipmentCode = pds.Rows[i][5].ToString().Trim(); equipment.EquipmentCode = pds.Rows[i][5].ToString().Trim();
@@ -419,6 +428,7 @@ namespace FineUIPro.Web.CQMS.Material
equipment.Unit = pds.Rows[i][7].ToString().Trim(); equipment.Unit = pds.Rows[i][7].ToString().Trim();
equipment.Num = Funs.GetNewDecimalOrZero(pds.Rows[i][8].ToString().Trim()); equipment.Num = Funs.GetNewDecimalOrZero(pds.Rows[i][8].ToString().Trim());
equipment.ArrivalDate = Funs.GetNewDateTime(pds.Rows[i][9].ToString().Trim()); equipment.ArrivalDate = Funs.GetNewDateTime(pds.Rows[i][9].ToString().Trim());
equipment.Factory = pds.Rows[i][10].ToString().Trim();
equipment.CompileMan = this.CurrUser.PersonId; equipment.CompileMan = this.CurrUser.PersonId;
equipment.CompileDate = DateTime.Now; equipment.CompileDate = DateTime.Now;
BLL.CQMS_EquipmentService.AddEquipment(equipment); BLL.CQMS_EquipmentService.AddEquipment(equipment);
@@ -66,7 +66,7 @@
<f:DatePicker ID="txtArrivalDate" runat="server" Label="到货日期" LabelAlign="Right" <f:DatePicker ID="txtArrivalDate" runat="server" Label="到货日期" LabelAlign="Right"
EnableEdit="true"> EnableEdit="true">
</f:DatePicker> </f:DatePicker>
<f:TextBox ID="txtFactory" runat="server" Label="生产厂家" <f:TextBox ID="txtFactory" runat="server" Label="生产厂家" ShowRedStar="true" Required="true"
MaxLength="100" LabelWidth="100px"> MaxLength="100" LabelWidth="100px">
</f:TextBox> </f:TextBox>
</Items> </Items>
@@ -45,7 +45,7 @@
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtProjectName" runat="server" Readonly="true" Label="项目名称" LabelAlign="Right" <f:TextBox ID="txtProjectName" runat="server" Readonly="true" Label="项目名称" LabelAlign="Right"
MaxLength="50" > >
</f:TextBox> </f:TextBox>
<f:TextBox ID="txtCode" runat="server" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right" MaxLength="50" LabelWidth="120px"> <f:TextBox ID="txtCode" runat="server" Required="true" ShowRedStar="true" Label="编号" LabelAlign="Right" MaxLength="50" LabelWidth="120px">
</f:TextBox> </f:TextBox>
+24
View File
@@ -120367,6 +120367,8 @@ namespace Model
private string _InspectionId; private string _InspectionId;
private string _Factory;
private EntityRef<Base_Project> _Base_Project; private EntityRef<Base_Project> _Base_Project;
private EntityRef<Base_Unit> _Base_Unit; private EntityRef<Base_Unit> _Base_Unit;
@@ -120407,6 +120409,8 @@ namespace Model
partial void OnCompileDateChanged(); partial void OnCompileDateChanged();
partial void OnInspectionIdChanging(string value); partial void OnInspectionIdChanging(string value);
partial void OnInspectionIdChanged(); partial void OnInspectionIdChanged();
partial void OnFactoryChanging(string value);
partial void OnFactoryChanged();
#endregion #endregion
public Material_Equipment() public Material_Equipment()
@@ -120729,6 +120733,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Factory", DbType="NVarChar(100)")]
public string Factory
{
get
{
return this._Factory;
}
set
{
if ((this._Factory != value))
{
this.OnFactoryChanging(value);
this.SendPropertyChanging();
this._Factory = value;
this.SendPropertyChanged("Factory");
this.OnFactoryChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Material_Equipment_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Material_Equipment_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project public Base_Project Base_Project
{ {
+2 -2
View File
@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio 15
VisualStudioVersion = 17.3.32825.248 VisualStudioVersion = 15.0.28307.2017
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FineUIPro.Web", "FineUIPro.Web\FineUIPro.Web.csproj", "{C88D3156-2D56-4DB0-922E-1995FB61C9BD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FineUIPro.Web", "FineUIPro.Web\FineUIPro.Web.csproj", "{C88D3156-2D56-4DB0-922E-1995FB61C9BD}"
EndProject EndProject