增加颜色标识库

This commit is contained in:
2025-09-28 10:43:29 +08:00
parent 9dbbf95b17
commit 0176754150
13 changed files with 279 additions and 75 deletions
@@ -55,12 +55,8 @@
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="150px" ColumnID="UnitId" DataField="UnitId" SortField="UnitId"
FieldType="String" HeaderText="单位id" TextAlign="Left" HeaderTextAlign="Center" >
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialId" DataField="MaterialId" SortField="MaterialId"
</f:TemplateField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材质id" TextAlign="Left" HeaderTextAlign="Center" >
</f:RenderField>
<f:RenderField Width="150px" ColumnID="ColorName" DataField="ColorName" SortField="ColorName"
@@ -99,7 +95,7 @@
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑Base_MaterialColor" EnableIFrame="true" Height="650px"
Title="编辑" EnableIFrame="true" Height="650px"
Width="1200px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
@@ -29,7 +29,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo
/// </summary>
private void BindGrid()
{
Model.Base_MaterialColor table = new Model.Base_MaterialColor();
Model.BaseMaterialcolorOutput table = new Model.BaseMaterialcolorOutput();
table.ProjectId=this.CurrUser.LoginProjectId;
var tb = BLL.BaseMaterialcolorService.GetListByQueryModle(table, Grid1.PageIndex, Grid1.PageSize);
Grid1.RecordCount = tb.Total;
Grid1.DataSource = tb.Data;
@@ -91,7 +92,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Base_MaterialColorEdit.aspx?MaterialColorId={0}", string.Empty, "增加 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialColorEdit.aspx?MaterialColorId={0}", string.Empty, "增加 - ")));
}
/// <summary>
@@ -110,7 +111,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
var model = BLL.BaseMaterialcolorService.GetModelById(ID);
if (model != null) ///已上报时不能删除
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Base_MaterialColorEdit.aspx?MaterialColorId={0}", ID, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialColorEdit.aspx?MaterialColorId={0}", ID, "编辑 - ")));
}
}
@@ -5,7 +5,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
@@ -15,57 +15,81 @@
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnitId" runat="server" Label="单位id" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtMaterialId" runat="server" Label="材质id" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtColorName" runat="server" Label="颜色名称" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtColorCardNo" runat="server" Label="色卡号" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRGB" runat="server" Label="" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="200" >
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownBox runat="server" ID="drpMaterialId" EmptyText="请从下拉表格中选择" MatchFieldWidth="false" Values="105" EnableMultiSelect="false" Label="材质">
<PopPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="MaterialId" DataTextField="MaterialCode"
DataKeyNames="MaterialId" Hidden="true" Width="550px" Height="600px" EnableMultiSelect="false">
<Columns>
<f:BoundField DataField="MaterialCode" DataFormatString="{0}" HeaderText="型号、牌号、级别" Width="180px" />
<f:TemplateField HeaderText="材质类型">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertSteelType(Eval("SteelType")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField ExpandUnusedSpace="true" MinWidth="200px" DataField="MaterialType" HeaderText="材料标准" />
</Columns>
<Toolbars>
<f:Toolbar runat="server" Position="Top">
<Items>
<f:TextBox ID="txtMaterialCode" runat="server" Label="型号、牌号、级别"
EmptyText="输入查询条件" Width="320px" LabelWidth="200px" LabelAlign="Right">
</f:TextBox>
<f:DropDownList ID="drpSteType" runat="server" Label="材质类型"
EnableEdit="true" Width="300px" LabelWidth="140px" LabelAlign="Right">
</f:DropDownList>
<f:Button ID="btnQuery" Text="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnQuery_Click" runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Grid>
</PopPanel>
</f:DropDownBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtColorName" runat="server" Label="颜色名称" MaxLength="200">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtColorCardNo" runat="server" Label="色卡号" MaxLength="200">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRGB" runat="server" Label="RGB代码" MaxLength="200">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="200">
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Text="关闭" runat="server" Icon="SystemClose">
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Text="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</f:Form>
<f:Window ID="Window1" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
@@ -1,6 +1,8 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
@@ -8,9 +10,12 @@ using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.BaseInfo
{
public partial class MaterialColorEdit: PageBase
public partial class MaterialColorEdit : PageBase
{
#region
#region
#region Properties
/// <summary>
/// 主键
/// </summary>
@@ -25,8 +30,18 @@ namespace FineUIPro.Web.HJGL.BaseInfo
ViewState["MaterialColorId"] = value;
}
}
#endregion Properties
#endregion
#region Methods
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
@@ -34,23 +49,32 @@ namespace FineUIPro.Web.HJGL.BaseInfo
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
////权限按钮方法
this.GetButtonPower();
this.drpSteType.DataTextField = "Text";
this.drpSteType.DataValueField = "Value";
this.drpSteType.DataSource = BLL.DropListService.HJGL_GetSteTypeList();
this.drpSteType.DataBind();
Funs.FineUIPleaseSelect(this.drpSteType);
BindGrid();
this.MaterialColorId = Request.Params["MaterialColorId"];
if (!string.IsNullOrEmpty(this.MaterialColorId))
{
Model.Base_MaterialColor model = BLL.BaseMaterialcolorService.GetModelById(this.MaterialColorId);
if (model != null)
{
this.txtUnitId.Text = model.UnitId;
this.txtMaterialId.Text = model.MaterialId;
this.drpMaterialId.Value = model.MaterialId;
this.drpMaterialId.Text = null;
this.txtColorName.Text = model.ColorName;
this.txtColorCardNo.Text = model.ColorCardNo;
this.txtRGB.Text = model.RGB;
this.txtRemark.Text = model.Remark;
}
}
}
}
protected void btnQuery_Click(object sender, EventArgs e)
{
this.BindGrid();
}
/// <summary>
/// 保存按钮
@@ -60,8 +84,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo
protected void btnSave_Click(object sender, EventArgs e)
{
Model.Base_MaterialColor table = new Model.Base_MaterialColor();
table.UnitId = this.txtUnitId.Text;
table.MaterialId = this.txtMaterialId.Text;
table.MaterialId = this.drpMaterialId.Value;
table.ProjectId = this.CurrUser.LoginProjectId;
table.ColorName = this.txtColorName.Text;
table.ColorCardNo = this.txtColorCardNo.Text;
table.RGB = this.txtRGB.Text;
@@ -70,7 +94,6 @@ namespace FineUIPro.Web.HJGL.BaseInfo
{
table.MaterialColorId = SQLHelper.GetNewID(typeof(Model.Base_MaterialColor));
BLL.BaseMaterialcolorService.Add(table);
}
else
{
@@ -80,7 +103,53 @@ namespace FineUIPro.Web.HJGL.BaseInfo
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected string ConvertSteelType(object SteelType)
{
string name = string.Empty;
if (SteelType != null)
{
var dropValue = BLL.DropListService.HJGL_GetSteTypeList().FirstOrDefault(x => x.Value == SteelType.ToString());
if (dropValue != null)
{
name = dropValue.Text;
}
}
return name;
}
private void BindGrid()
{
string strSql = @"SELECT MaterialId,MaterialCode,MaterialType,SteelType,Remark,MaterialClass,MaterialGroup,MetalType"
+ @" FROM dbo.Base_Material WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim()))
{
strSql += " AND MaterialCode LIKE @MaterialCode";
listStr.Add(new SqlParameter("@MaterialCode", "%" + this.txtMaterialCode.Text.Trim() + "%"));
}
if (this.drpSteType.SelectedValue != BLL.Const._Null)
{
strSql += " AND SteelType = @SteelType";
listStr.Add(new SqlParameter("@SteelType", this.drpSteType.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#region
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
@@ -97,7 +166,10 @@ namespace FineUIPro.Web.HJGL.BaseInfo
}
}
}
#endregion
#endregion Methods
#endregion
}
}
@@ -42,22 +42,58 @@ namespace FineUIPro.Web.HJGL.BaseInfo
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtUnitId 控件。
/// drpMaterialId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnitId;
protected global::FineUIPro.DropDownBox drpMaterialId;
/// <summary>
/// txtMaterialId 控件。
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMaterialId;
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// txtMaterialCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMaterialCode;
/// <summary>
/// drpSteType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSteType;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// txtColorName 控件。