修改材料管理
This commit is contained in:
parent
2589ff97b4
commit
edb8ad2753
|
|
@ -0,0 +1,2 @@
|
|||
alter table [dbo].[Material_Material] add Factory nvarchar(100) null
|
||||
GO
|
||||
|
|
@ -38,6 +38,7 @@ namespace BLL
|
|||
newMaterial.ArrivalDate = Material.ArrivalDate;
|
||||
newMaterial.CompileMan = Material.CompileMan;
|
||||
newMaterial.CompileDate = Material.CompileDate;
|
||||
newMaterial.Factory = Material.Factory;
|
||||
db.Material_Material.InsertOnSubmit(newMaterial);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
|
@ -64,6 +65,7 @@ namespace BLL
|
|||
newMaterial.Num = Material.Num;
|
||||
newMaterial.ArrivalDate = Material.ArrivalDate;
|
||||
newMaterial.InspectionId = Material.InspectionId;
|
||||
newMaterial.Factory = Material.Factory;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<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 ID="drpMainItem" runat="server" Label="主项" LabelAlign="Right" EnableEdit="true" LabelWidth="60px">
|
||||
</f:DropDownList>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="UnitName" DataField="UnitName"
|
||||
FieldType="String" HeaderText="供货单位名称" TextAlign="Center"
|
||||
FieldType="String" HeaderText="采购单位" TextAlign="Center"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="MainItemName" DataField="MainItemName"
|
||||
|
|
@ -85,8 +85,8 @@
|
|||
<f:RenderField Width="100px" ColumnID="Material" DataField="Material"
|
||||
FieldType="String" HeaderText="材质" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PressClass" DataField="PressClass"
|
||||
FieldType="String" HeaderText="压力等级" TextAlign="Center" HeaderTextAlign="Center">
|
||||
<f:RenderField Width="100px" ColumnID="Factory" DataField="Factory"
|
||||
FieldType="String" HeaderText="生产厂家" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Unit" DataField="Unit"
|
||||
FieldType="String" HeaderText="单位" TextAlign="Center" HeaderTextAlign="Center">
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@
|
|||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtContractNo" runat="server" Label="合同编号"
|
||||
Required="true" MaxLength="70" ShowRedStar="true" LabelWidth="100px">
|
||||
MaxLength="70" LabelWidth="100px">
|
||||
</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>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpMainItem" runat="server" ShowRedStar="true" Label="主项" LabelWidth="100px" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="drpMainItem" runat="server" Label="主项" LabelWidth="100px" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtMaterialName" runat="server" Label="材料名称"
|
||||
Required="true" MaxLength="70" ShowRedStar="true" LabelWidth="100px">
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSpecificationAndModel" runat="server" Label="规格型号"
|
||||
MaxLength="70" LabelWidth="100px" ShowRedStar="true" Required="true">
|
||||
MaxLength="70" LabelWidth="100px" >
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
|
||||
MaxLength="70" LabelWidth="100px">
|
||||
|
|
@ -63,10 +63,12 @@
|
|||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DatePicker ID="txtArrivalDate" ShowRedStar="true" Required="true" runat="server" Label="到货日期" LabelAlign="Right"
|
||||
<f:DatePicker ID="txtArrivalDate" runat="server" Label="到货日期" LabelAlign="Right"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
<f:Label runat="server"></f:Label>
|
||||
<f:TextBox ID="txtFactory" runat="server" Label="生产厂家"
|
||||
MaxLength="100" LabelWidth="100px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
{
|
||||
this.txtArrivalDate.Text = string.Format("{0:yyyy-MM-dd}", Material.ArrivalDate);
|
||||
}
|
||||
this.txtFactory.Text = Material.Factory;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -68,14 +69,14 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
{
|
||||
if (this.drpUnit.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择供货单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpMainItem.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择主项!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("请选择采购单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (this.drpMainItem.SelectedValue == BLL.Const._Null)
|
||||
//{
|
||||
// Alert.ShowInTop("请选择主项!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
SaveData();
|
||||
}
|
||||
else
|
||||
|
|
@ -91,7 +92,10 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
Material.ProjectId = this.CurrUser.LoginProjectId;
|
||||
Material.ContractNo = this.txtContractNo.Text.Trim();
|
||||
Material.UnitId = this.drpUnit.SelectedValue;
|
||||
Material.MainItemId = this.drpMainItem.SelectedValue;
|
||||
if (this.drpMainItem.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
Material.MainItemId = this.drpMainItem.SelectedValue;
|
||||
}
|
||||
Material.MaterialName = this.txtMaterialName.Text.Trim();
|
||||
Material.SpecificationAndModel = this.txtSpecificationAndModel.Text.Trim();
|
||||
Material.MaterialCode = this.txtMaterialCode.Text.Trim();
|
||||
|
|
@ -99,9 +103,10 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
Material.PressClass = this.txtPressClass.Text.Trim();
|
||||
Material.Unit = this.txtUnit.Text.Trim();
|
||||
Material.Num = Funs.GetNewDecimalOrZero(this.txtNum.Text.Trim());
|
||||
Material.ArrivalDate = Funs.GetNewDateTimeOrNow(this.txtArrivalDate.Text.Trim());
|
||||
Material.ArrivalDate = Funs.GetNewDateTime(this.txtArrivalDate.Text.Trim());
|
||||
Material.CompileMan = this.CurrUser.PersonId;
|
||||
Material.CompileDate = DateTime.Now;
|
||||
Material.Factory = this.txtFactory.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(MaterialId))
|
||||
{
|
||||
Material.MaterialId = MaterialId;
|
||||
|
|
|
|||
|
|
@ -138,6 +138,15 @@ namespace FineUIPro.Web.CQMS.Material {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtArrivalDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtFactory 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFactory;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
hdCheckResult.Text = "1";
|
||||
AddDatasetToSQL(ds.Tables[0], 11);
|
||||
AddDatasetToSQL(ds.Tables[0], 12);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
|
@ -172,22 +172,22 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
if (oldViewInfo == null)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
if (string.IsNullOrEmpty(row0))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "合同编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
//if (string.IsNullOrEmpty(row0))
|
||||
//{
|
||||
// result += (i + 2).ToString() + "," + "合同编号" + "," + "此项为必填项!" + "|";
|
||||
//}
|
||||
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (string.IsNullOrEmpty(row1))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "供货单位名称" + "," + "此项为必填项!" + "|";
|
||||
result += (i + 2).ToString() + "," + "采购单位" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
var unit = units.FirstOrDefault(x => x.UnitName == row1);
|
||||
if (unit == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "供货单位名称" + "," + "[" + row1 + "]不存在!" + "|";
|
||||
result += (i + 2).ToString() + "," + "采购单位" + "," + "[" + row1 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -198,11 +198,14 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
//}
|
||||
//else
|
||||
//{
|
||||
if (!string.IsNullOrEmpty(row2))
|
||||
{
|
||||
var mainItem = mainItems.FirstOrDefault(x => x.MainItemName == row2);
|
||||
if (mainItem == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "主项名称" + "," + "[" + row2 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
string row3 = pds.Rows[i][3].ToString();
|
||||
|
|
@ -211,11 +214,11 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
result += (i + 2).ToString() + "," + "材料名称" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row4 = pds.Rows[i][4].ToString();
|
||||
if (string.IsNullOrEmpty(row4))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "规格型号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
//string row4 = pds.Rows[i][4].ToString();
|
||||
//if (string.IsNullOrEmpty(row4))
|
||||
//{
|
||||
// result += (i + 2).ToString() + "," + "规格型号" + "," + "此项为必填项!" + "|";
|
||||
//}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
|
|
@ -250,6 +253,12 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
//{
|
||||
// result += (i + 2).ToString() + "," + "到货日期" + "," + "此项为必填项!" + "|";
|
||||
//}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString();
|
||||
if (string.IsNullOrEmpty(row11))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "生产厂家" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
|
|
@ -357,7 +366,7 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 11);
|
||||
AddDatasetToSQL2(ds.Tables[0], 12);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -403,7 +412,10 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
materialCheck.ProjectId = this.CurrUser.LoginProjectId;
|
||||
materialCheck.ContractNo = pds.Rows[i][0].ToString().Trim();
|
||||
materialCheck.UnitId = units.First(e => e.UnitName == pds.Rows[i][1].ToString().Trim()).UnitId;
|
||||
materialCheck.MainItemId = mainItems.First(e => e.MainItemName == pds.Rows[i][2].ToString().Trim()).MainItemId;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
|
||||
{
|
||||
materialCheck.MainItemId = mainItems.First(e => e.MainItemName == pds.Rows[i][2].ToString().Trim()).MainItemId;
|
||||
}
|
||||
materialCheck.MaterialName = pds.Rows[i][3].ToString().Trim();
|
||||
materialCheck.SpecificationAndModel = pds.Rows[i][4].ToString().Trim();
|
||||
materialCheck.MaterialCode = pds.Rows[i][5].ToString().Trim();
|
||||
|
|
@ -411,7 +423,8 @@ namespace FineUIPro.Web.CQMS.Material
|
|||
materialCheck.PressClass = pds.Rows[i][7].ToString().Trim();
|
||||
materialCheck.Unit = pds.Rows[i][8].ToString().Trim();
|
||||
materialCheck.Num = Funs.GetNewDecimalOrZero(pds.Rows[i][9].ToString().Trim());
|
||||
materialCheck.ArrivalDate = Funs.GetNewDateTimeOrNow(pds.Rows[i][10].ToString().Trim());
|
||||
materialCheck.ArrivalDate = Funs.GetNewDateTime(pds.Rows[i][10].ToString().Trim());
|
||||
materialCheck.Factory = pds.Rows[i][11].ToString().Trim();
|
||||
materialCheck.CompileMan = this.CurrUser.PersonId;
|
||||
materialCheck.CompileDate = DateTime.Now;
|
||||
BLL.CQMS_MaterialService.AddMaterial(materialCheck);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -73403,7 +73403,7 @@ namespace Model
|
|||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string MaterialCode
|
||||
{
|
||||
get
|
||||
|
|
@ -73507,7 +73507,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(3000)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string MaterialDef
|
||||
{
|
||||
get
|
||||
|
|
@ -78097,7 +78097,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")]
|
||||
public string MaterialCode
|
||||
{
|
||||
get
|
||||
|
|
@ -82445,7 +82445,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")]
|
||||
public string CanWelderCode
|
||||
{
|
||||
get
|
||||
|
|
@ -121574,6 +121574,8 @@ namespace Model
|
|||
|
||||
private string _InspectionId;
|
||||
|
||||
private string _Factory;
|
||||
|
||||
private EntityRef<Base_Project> _Base_Project;
|
||||
|
||||
private EntityRef<Base_Unit> _Base_Unit;
|
||||
|
|
@ -121616,6 +121618,8 @@ namespace Model
|
|||
partial void OnCompileDateChanged();
|
||||
partial void OnInspectionIdChanging(string value);
|
||||
partial void OnInspectionIdChanged();
|
||||
partial void OnFactoryChanging(string value);
|
||||
partial void OnFactoryChanged();
|
||||
#endregion
|
||||
|
||||
public Material_Material()
|
||||
|
|
@ -121958,6 +121962,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_Material_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
|
||||
public Base_Project Base_Project
|
||||
{
|
||||
|
|
@ -234443,7 +234467,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")]
|
||||
public string CanWelderCode
|
||||
{
|
||||
get
|
||||
|
|
|
|||
Loading…
Reference in New Issue