1
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
|
||||
<f:TextBox ID="txtCode" runat="server" Label="材料编码"
|
||||
EmptyText="输入查询条件" Width="300px" LabelWidth="120px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
@@ -44,9 +44,9 @@
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="200px" ColumnID="MaterialCode" DataField="MaterialCode"
|
||||
<f:RenderField Width="200px" ColumnID="Code" DataField="Code"
|
||||
FieldType="String" HeaderText="材料编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left" SortField="MaterialCode">
|
||||
TextAlign="Left" SortField="Code">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="HeatNo" DataField="HeatNo"
|
||||
FieldType="String" HeaderText="炉号" HeaderTextAlign="Center"
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
WHERE 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND MaterialCode LIKE @MaterialCode";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%" + this.txtMaterialCode.Text.Trim() + "%"));
|
||||
strSql += " AND Code LIKE @Code";
|
||||
listStr.Add(new SqlParameter("@Code", "%" + this.txtCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtMaterialName.Text.Trim()))
|
||||
{
|
||||
|
||||
@@ -58,13 +58,13 @@ namespace FineUIPro.Web.HJGL.BaseInfo {
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtMaterialCode 控件。
|
||||
/// txtCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtMaterialCode;
|
||||
protected global::FineUIPro.TextBox txtCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtMaterialName 控件。
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
|
||||
<f:TextBox ID="txtCode" runat="server" Label="材料编码"
|
||||
Required="true" MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" LabelWidth="100px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
Model.HJGL_MaterialCodeLib lib = BLL.MaterialCodeLibService.GetMaterialCodeLib(materialCode);
|
||||
if (lib != null)
|
||||
{
|
||||
this.txtMaterialCode.Text = materialCode;
|
||||
this.txtCode.Text = lib.Code;
|
||||
this.txtMaterialMade.Text = lib.MaterialMade;
|
||||
this.txtHeatNo.Text = lib.HeatNo;
|
||||
this.txtBatchNo.Text = lib.BatchNo;
|
||||
@@ -31,11 +31,11 @@ namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
txtMaterialSpec.Text = lib.MaterialSpec;
|
||||
txtMaterialDef.Text = lib.MaterialDef;
|
||||
txtMaterialUnit.Text = lib.MaterialUnit;
|
||||
txtMaterialCode.Enabled = false;
|
||||
//txtMaterialCode.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtMaterialCode.Enabled = true;
|
||||
//txtMaterialCode.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,24 +53,25 @@ namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
string materialCode = Request.Params["MaterialCode"];
|
||||
if (string.IsNullOrEmpty(materialCode))
|
||||
{
|
||||
var q = Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(x => x.MaterialCode == this.txtMaterialCode.Text.Trim());
|
||||
var q = Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(x => x.MaterialCode == materialCode);
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("此材料编码已存在!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("此材料编码、炉号、批号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Model.HJGL_MaterialCodeLib newLib = new Model.HJGL_MaterialCodeLib
|
||||
{
|
||||
MaterialCode = this.txtMaterialCode.Text.Trim(),
|
||||
MaterialCode = this.txtCode.Text.Trim() + "-" + this.txtHeatNo.Text.Trim() + "-" + this.txtBatchNo.Text.Trim(),
|
||||
HeatNo = this.txtHeatNo.Text.Trim(),
|
||||
BatchNo = this.txtBatchNo.Text.Trim(),
|
||||
MaterialName = this.txtMaterialName.Text.Trim(),
|
||||
MaterialSpec = this.txtMaterialSpec.Text.Trim(),
|
||||
MaterialMade = this.txtMaterialMade.Text.Trim(),
|
||||
MaterialDef = this.txtMaterialDef.Text.Trim(),
|
||||
MaterialUnit = txtMaterialUnit.Text.Trim()
|
||||
MaterialUnit = txtMaterialUnit.Text.Trim(),
|
||||
Code = this.txtCode.Text.Trim()
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(materialCode))
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace FineUIPro.Web.HJGL.BaseInfo {
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtMaterialCode 控件。
|
||||
/// txtCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtMaterialCode;
|
||||
protected global::FineUIPro.TextBox txtCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtHeatNo 控件。
|
||||
|
||||
Reference in New Issue
Block a user