diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 84946509..8f460448 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -399,6 +399,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 12317853..28a9603a 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -2821,6 +2821,11 @@ namespace BLL /// public const string HJGL_ComponentsMenuId = "8IDKGJE2-09B1-4607-BC6D-865CE48F0009"; + /// + /// 材料仓库 + /// + public const string HJGL_WarehouseMenuId = "2F027233-22EC-4063-A04F-FB9FE6A91588"; + /// /// 探伤类型 /// diff --git a/SGGL/BLL/HJGL/BaseInfo/Base_WarehouseService.cs b/SGGL/BLL/HJGL/BaseInfo/Base_WarehouseService.cs new file mode 100644 index 00000000..f3eec28a --- /dev/null +++ b/SGGL/BLL/HJGL/BaseInfo/Base_WarehouseService.cs @@ -0,0 +1,109 @@ +namespace BLL +{ + using Model; + using System.Collections.Generic; + using System.Linq; + + public static class Base_WarehouseService + { + /// + /// 根据仓库ID获取仓库信息 + /// + /// 仓库ID + /// 仓库实体 + public static Model.Base_Warehouse GetWarehouseByWarehouseId(string warehouseId) + { + return Funs.DB.Base_Warehouse.FirstOrDefault(e => e.WarehouseId == warehouseId); + } + + /// + /// 新增仓库信息 + /// + /// 仓库实体 + public static void AddWarehouse(Model.Base_Warehouse warehouse) + { + Model.SGGLDB db = Funs.DB; + Model.Base_Warehouse newWarehouse = new Base_Warehouse + { + WarehouseId = warehouse.WarehouseId, + WarehouseName = warehouse.WarehouseName, + Remark = warehouse.Remark, + ProjectId = warehouse.ProjectId, + CreateUserId = warehouse.CreateUserId, + CreateTime = warehouse.CreateTime, + ModifyUserId = warehouse.ModifyUserId, + ModifyTime = warehouse.ModifyTime, + }; + db.Base_Warehouse.InsertOnSubmit(newWarehouse); + db.SubmitChanges(); + } + + /// + /// 更新仓库信息 + /// + /// 仓库实体 + public static void UpdateWarehouse(Model.Base_Warehouse warehouse) + { + Model.SGGLDB db = Funs.DB; + Model.Base_Warehouse newWarehouse = db.Base_Warehouse.FirstOrDefault(e => e.WarehouseId == warehouse.WarehouseId); + if (newWarehouse != null) + { + newWarehouse.WarehouseName = warehouse.WarehouseName; + newWarehouse.Remark = warehouse.Remark; + newWarehouse.ProjectId = warehouse.ProjectId; + newWarehouse.ModifyUserId = warehouse.ModifyUserId; + newWarehouse.ModifyTime = warehouse.ModifyTime; + db.SubmitChanges(); + } + } + + /// + /// 根据仓库ID删除仓库信息 + /// + /// 仓库ID + public static void DeleteWarehouseByWarehouseId(string warehouseId) + { + Model.SGGLDB db = Funs.DB; + Model.Base_Warehouse delWarehouse = db.Base_Warehouse.FirstOrDefault(e => e.WarehouseId == warehouseId); + if (delWarehouse != null) + { + db.Base_Warehouse.DeleteOnSubmit(delWarehouse); + db.SubmitChanges(); + } + } + + /// + /// 获取项目下所有仓库列表 + /// + /// 项目ID + /// 仓库列表 + public static List GetWarehouseList(string projectId) + { + var list = (from x in Funs.DB.Base_Warehouse + where x.ProjectId == projectId + orderby x.WarehouseName + select x).ToList(); + + return list; + } + + /// + /// 初始化仓库下拉框 + /// + /// 下拉框控件 + /// 项目ID + /// 是否显示"请选择" + /// "请选择"项的文本 + public static void InitWarehouseDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease, string itemText) + { + dropName.DataValueField = "WarehouseId"; + dropName.DataTextField = "WarehouseName"; + dropName.DataSource = GetWarehouseList(projectId); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName, itemText); + } + } + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 3933756b..dc8503e2 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1520,6 +1520,9 @@ + + + @@ -10347,6 +10350,27 @@ TestMediumView.aspx + + Warehouse.aspx + ASPXCodeBehind + + + Warehouse.aspx + + + WarehouseEdit.aspx + ASPXCodeBehind + + + WarehouseEdit.aspx + + + WarehouseView.aspx + ASPXCodeBehind + + + WarehouseView.aspx + Weld.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx new file mode 100644 index 00000000..9a0538c7 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx @@ -0,0 +1,99 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Warehouse.aspx.cs" Inherits="FineUIPro.Web.HJGL.BaseInfo.Warehouse" %> + + + + + 材料仓库 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.cs new file mode 100644 index 00000000..9f212071 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.cs @@ -0,0 +1,274 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.HJGL.BaseInfo +{ + public partial class Warehouse : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT WarehouseId,WarehouseName,Remark" + + @" FROM dbo.Base_Warehouse WHERE 1=1 "; + List listStr = new List(); + strSql += " AND ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (!string.IsNullOrEmpty(this.txtWarehouseName.Text.Trim())) + { + strSql += " AND WarehouseName LIKE @WarehouseName"; + listStr.Add(new SqlParameter("@WarehouseName", "%" + this.txtWarehouseName.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(this.txtRemark.Text.Trim())) + { + strSql += " AND Remark LIKE @Remark"; + listStr.Add(new SqlParameter("@Remark", "%" + this.txtRemark.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + #endregion + + #region 增加按钮事件 + /// + /// 增加按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (GetButtonPower(Const.BtnAdd)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WarehouseEdit.aspx", "新增 - "))); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + // 双击事件 编辑权限有:编辑页面,无:查看页面 + if (GetButtonPower(Const.BtnModify)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WarehouseEdit.aspx?WarehouseId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + else if (GetButtonPower(Const.BtnSee)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WarehouseView.aspx?WarehouseId={0}", Grid1.SelectedRowID, "查看 - "))); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (GetButtonPower(Const.BtnDelete)) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + string strShowNotify = string.Empty; + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var getWarehouse = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(rowID); + if (getWarehouse != null) + { + string cont = judgementDelete(rowID); + if (string.IsNullOrEmpty(cont)) + { + BLL.Base_WarehouseService.DeleteWarehouseByWarehouseId(rowID); + } + else + { + strShowNotify += "材料仓库" + ":" + getWarehouse.WarehouseName + cont; + } + } + } + + BindGrid(); + if (!string.IsNullOrEmpty(strShowNotify)) + { + Alert.ShowInTop(strShowNotify, MessageBoxIcon.Warning); + } + else + { + ShowNotify("删除成功!", MessageBoxIcon.Success); + } + } + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + #region 判断是否可删除 + /// + /// 判断是否可以删除 + /// + /// + private string judgementDelete(string id) + { + string content = string.Empty; + // 检查是否有关联的管线 + if (Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.WarehouseId == id) != null) + { + content += "已在【管线信息】中使用,不能删除!"; + } + + return content; + } + #endregion + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnQuery_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 查看按钮 + /// + /// 查看按钮 + /// + /// + /// + protected void btnView_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WarehouseView.aspx?WarehouseId={0}", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private bool GetButtonPower(string button) + { + return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_WarehouseMenuId, button); + } + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.designer.cs new file mode 100644 index 00000000..fbe565c7 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/Warehouse.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.BaseInfo +{ + + + public partial class Warehouse + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtWarehouseName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWarehouseName; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx new file mode 100644 index 00000000..71263566 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx @@ -0,0 +1,46 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WarehouseEdit.aspx.cs" + Inherits="FineUIPro.Web.HJGL.BaseInfo.WarehouseEdit" %> + + + + + 编辑材料仓库 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.cs new file mode 100644 index 00000000..448e619e --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.cs @@ -0,0 +1,100 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.HJGL.BaseInfo +{ + public partial class WarehouseEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + public string WarehouseId + { + get + { + return (string)ViewState["WarehouseId"]; + } + set + { + ViewState["WarehouseId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtWarehouseName.Focus(); + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.WarehouseId = Request.Params["WarehouseId"]; + if (!string.IsNullOrEmpty(this.WarehouseId)) + { + Model.Base_Warehouse warehouse = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(this.WarehouseId); + if (warehouse != null) + { + this.txtWarehouseName.Text = warehouse.WarehouseName; + this.txtRemark.Text = warehouse.Remark; + } + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + // 唯一性检查:仓库名称在项目内不能重复 + var q = Funs.DB.Base_Warehouse.FirstOrDefault(x => x.WarehouseName == this.txtWarehouseName.Text.Trim() + && (x.WarehouseId != this.WarehouseId || (this.WarehouseId == null && x.WarehouseId != null)) + && x.ProjectId == this.CurrUser.LoginProjectId); + if (q != null) + { + Alert.ShowInTop("此仓库名称已存在!", MessageBoxIcon.Warning); + return; + } + + Model.Base_Warehouse newWarehouse = new Model.Base_Warehouse + { + WarehouseName = this.txtWarehouseName.Text.Trim(), + Remark = this.txtRemark.Text.Trim(), + ProjectId = this.CurrUser.LoginProjectId, + ModifyUserId = this.CurrUser.PersonId, + ModifyTime = DateTime.Now + }; + + if (!string.IsNullOrEmpty(this.WarehouseId)) + { + // 更新 + newWarehouse.WarehouseId = this.WarehouseId; + BLL.Base_WarehouseService.UpdateWarehouse(newWarehouse); + } + else + { + // 新增 + this.WarehouseId = SQLHelper.GetNewID(typeof(Model.Base_Warehouse)); + newWarehouse.WarehouseId = this.WarehouseId; + newWarehouse.CreateUserId = this.CurrUser.PersonId; + newWarehouse.CreateTime = DateTime.Now; + BLL.Base_WarehouseService.AddWarehouse(newWarehouse); + } + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.designer.cs new file mode 100644 index 00000000..22e64deb --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseEdit.aspx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.BaseInfo { + + + public partial class WarehouseEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtWarehouseName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWarehouseName; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx new file mode 100644 index 00000000..76eeec8d --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx @@ -0,0 +1,43 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WarehouseView.aspx.cs" + Inherits="FineUIPro.Web.HJGL.BaseInfo.WarehouseView" %> + + + + + 查看材料仓库 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.cs new file mode 100644 index 00000000..be6dd10a --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.cs @@ -0,0 +1,50 @@ +using BLL; +using System; + +namespace FineUIPro.Web.HJGL.BaseInfo +{ + public partial class WarehouseView : PageBase + { + #region 定义项 + /// + /// 主键 + /// + public string WarehouseId + { + get + { + return (string)ViewState["WarehouseId"]; + } + set + { + ViewState["WarehouseId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.WarehouseId = Request.Params["WarehouseId"]; + if (!string.IsNullOrEmpty(this.WarehouseId)) + { + Model.Base_Warehouse warehouse = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(this.WarehouseId); + if (warehouse != null) + { + this.txtWarehouseName.Text = warehouse.WarehouseName; + this.txtRemark.Text = warehouse.Remark; + } + } + } + } + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.designer.cs new file mode 100644 index 00000000..f173e7f4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/WarehouseView.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.BaseInfo { + + + public partial class WarehouseView { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtWarehouseName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWarehouseName; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx index adbddc4b..8626aee5 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx @@ -62,6 +62,11 @@ + + + + @@ -83,11 +88,13 @@ EmptyText="输入查询条件" Hidden="true" Width="180px" LabelWidth="80px" LabelAlign="Right"> - - - + + + @@ -125,6 +132,14 @@ + + + + <%-- diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs index d73c73fe..fa86df46 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs @@ -53,6 +53,15 @@ namespace FineUIPro.Web.HJGL.PreDesign this.InitTreeMenu();//加载树 PipelineComplete = 0; PipelineNOComplete = 0; + + // 初始化仓库下拉框 + Base_WarehouseService.InitWarehouseDropDownList(this.ddlWarehouse, this.CurrUser.LoginProjectId, true, "-请选择-"); + + // 初始化流水段下拉框 + this.InitFlowingSectionDropDownList(); + + // 初始化管线划分下拉框 + this.InitPipeAreaDropDownList(); } } @@ -150,6 +159,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { + InitFlowingSectionDropDownList(); this.BindGrid(); // var q = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP); // if (q.Any()) @@ -190,13 +200,26 @@ namespace FineUIPro.Web.HJGL.PreDesign view_HJGL_Pipeline.SingleName = this.txtSingleName.Text.Trim(); // view_HJGL_Pipeline.MaterialCode=this.txtMaterialCode.Text.Trim(); var list = BLL.PipelineService.GetHJGL_PipelineList(view_HJGL_Pipeline); - if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim())) +/* if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim())) { list = (from x in list join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId where y.MaterialCode.Contains(txtMaterialCode.Text.Trim()) select x).Distinct().ToList(); + }*/ + + // 流水段查询 + if ( this.ddlFlowingSection.SelectedValue != Const._Null) + { + list = list.Where(x => x.FlowingSection == this.ddlFlowingSection.SelectedValue).ToList(); } + + // 管线划分查询 + if (this.ddlPipeArea.SelectedValue!=Const._Null) + { + list = list.Where(x => x.PipeArea == this.ddlPipeArea.SelectedValue).ToList(); + } + view_HJGL_Pipelines = list; // 2.获取当前分页数据 Grid1.RecordCount = list.Count(); @@ -205,8 +228,23 @@ namespace FineUIPro.Web.HJGL.PreDesign // 3.绑定到Grid + // 获取仓库名称 + var warehouseList = Base_WarehouseService.GetWarehouseList(this.CurrUser.LoginProjectId); + var listWithWarehouse = (from x in list + join y in warehouseList on x.WarehouseId equals y.WarehouseId into temp + from z in temp.DefaultIfEmpty() + select new + { + x.PipelineId, + x.PipelineCode, + x.FlowingSection, + x.PipeArea, + x.UnitWorkId, + x.ProjectId, + WarehouseName = z != null ? z.WarehouseName : "" + }).ToList(); - var table = this.GetPagedDataTable(Grid1, list); + var table = this.GetPagedDataTable(Grid1, listWithWarehouse); Grid1.DataSource = table; Grid1.DataBind(); //lbSinglePreRate.Text= GetSinglePreRateByUnitWork(this.tvControlItem.SelectedNodeID); @@ -364,11 +402,47 @@ namespace FineUIPro.Web.HJGL.PreDesign BindGrid(); } + /// + /// 仓库设置按钮 + /// + protected void btnSetWarehouse_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + string warehouseId = this.ddlWarehouse.SelectedValue; + if (string.IsNullOrEmpty(warehouseId)) + { + Alert.ShowInTop("请选择仓库!", MessageBoxIcon.Warning); + return; + } + + // 批量更新 + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var pipeline = PipelineService.GetPipelineByPipelineId(rowID); + if (pipeline != null) + { + pipeline.WarehouseId = warehouseId; + PipelineService.UpdatePipeline(pipeline); + } + } + + BindGrid(); + ShowNotify("批量设置仓库成功!", MessageBoxIcon.Success); + } + protected void btnRset_Click(object sender, EventArgs e) { txtPipelineCode.Text = String.Empty; txtSingleName.Text = String.Empty; - txtMaterialCode.Text = String.Empty; + //txtMaterialCode.Text = String.Empty; + ddlFlowingSection.SelectedValue = Const._Null; + ddlPipeArea.SelectedValue = String.Empty; BindGrid(); } @@ -392,6 +466,49 @@ namespace FineUIPro.Web.HJGL.PreDesign } return PipeAreaValue; } + + #region 初始化下拉框 + /// + /// 初始化流水段下拉框 + /// + private void InitFlowingSectionDropDownList() + { + var baseQuery = from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == this.CurrUser.LoginProjectId + select new { + x.FlowingSection , + x.UnitWorkId + }; + if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)) + { + baseQuery = baseQuery.Where(x => x.UnitWorkId == tvControlItem.SelectedNodeID); + } + var flowingSections = baseQuery.Select(x=>x.FlowingSection).Distinct().OrderBy(x => x).ToList(); + this.ddlFlowingSection.DataValueField = "FlowingSection"; + this.ddlFlowingSection.DataTextField = "FlowingSection"; + this.ddlFlowingSection.DataSource = flowingSections.Select(x => new { FlowingSection = x }).ToList(); + this.ddlFlowingSection.DataBind(); + Funs.FineUIPleaseSelect(this.ddlFlowingSection, "-请选择-"); + } + + /// + /// 初始化管线划分下拉框 + /// + private void InitPipeAreaDropDownList() + { + List pipeAreaList = new List(); + pipeAreaList.Add(new System.Web.UI.WebControls.ListItem("工厂预制", PipelineService.PipeArea_SHOP)); + pipeAreaList.Add(new System.Web.UI.WebControls.ListItem("现场施工", PipelineService.PipeArea_FIELD)); + + this.ddlPipeArea.DataValueField = "Value"; + this.ddlPipeArea.DataTextField = "Text"; + this.ddlPipeArea.DataSource = pipeAreaList; + this.ddlPipeArea.DataBind(); + Funs.FineUIPleaseSelect(this.ddlPipeArea, "-请选择-"); + + } + #endregion + /// /// 获取图纸预制率(工厂预制管线的预制达因/工厂预制管线的总达因) /// diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.designer.cs index 203e23d1..3a90fb88 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.designer.cs @@ -140,6 +140,24 @@ namespace FineUIPro.Web.HJGL.PreDesign /// protected global::FineUIPro.Label lbSinglePreRate; + /// + /// ddlWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlWarehouse; + + /// + /// btnSetWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSetWarehouse; + /// /// btnSetShop 控件。 /// @@ -195,13 +213,22 @@ namespace FineUIPro.Web.HJGL.PreDesign protected global::FineUIPro.TextBox txtSingleName; /// - /// txtMaterialCode 控件。 + /// ddlFlowingSection 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtMaterialCode; + protected global::FineUIPro.DropDownList ddlFlowingSection; + + /// + /// ddlPipeArea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPipeArea; /// /// btnQuery 控件。 diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index c6acad79..f99c41df 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -4,6 +4,7 @@ + @@ -13,12 +14,12 @@ + - - - + + @@ -27,7 +28,7 @@ - + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 0f229b3c..7c263eb1 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -266,6 +266,9 @@ namespace Model partial void InsertBase_UnitType(Base_UnitType instance); partial void UpdateBase_UnitType(Base_UnitType instance); partial void DeleteBase_UnitType(Base_UnitType instance); + partial void InsertBase_Warehouse(Base_Warehouse instance); + partial void UpdateBase_Warehouse(Base_Warehouse instance); + partial void DeleteBase_Warehouse(Base_Warehouse instance); partial void InsertBase_WeldingLocation(Base_WeldingLocation instance); partial void UpdateBase_WeldingLocation(Base_WeldingLocation instance); partial void DeleteBase_WeldingLocation(Base_WeldingLocation instance); @@ -2571,6 +2574,14 @@ namespace Model } } + public System.Data.Linq.Table Base_Warehouse + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_WeldingLocation { get @@ -38761,6 +38772,236 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_Warehouse")] + public partial class Base_Warehouse : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _WarehouseId; + + private string _WarehouseName; + + private string _Remark; + + private string _ProjectId; + + private string _CreateUserId; + + private System.Nullable _CreateTime; + + private string _ModifyUserId; + + private System.Nullable _ModifyTime; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnWarehouseIdChanging(string value); + partial void OnWarehouseIdChanged(); + partial void OnWarehouseNameChanging(string value); + partial void OnWarehouseNameChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnCreateUserIdChanging(string value); + partial void OnCreateUserIdChanged(); + partial void OnCreateTimeChanging(System.Nullable value); + partial void OnCreateTimeChanged(); + partial void OnModifyUserIdChanging(string value); + partial void OnModifyUserIdChanged(); + partial void OnModifyTimeChanging(System.Nullable value); + partial void OnModifyTimeChanged(); + #endregion + + public Base_Warehouse() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WarehouseId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string WarehouseId + { + get + { + return this._WarehouseId; + } + set + { + if ((this._WarehouseId != value)) + { + this.OnWarehouseIdChanging(value); + this.SendPropertyChanging(); + this._WarehouseId = value; + this.SendPropertyChanged("WarehouseId"); + this.OnWarehouseIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WarehouseName", DbType="NVarChar(200) NOT NULL", CanBeNull=false)] + public string WarehouseName + { + get + { + return this._WarehouseName; + } + set + { + if ((this._WarehouseName != value)) + { + this.OnWarehouseNameChanging(value); + this.SendPropertyChanging(); + this._WarehouseName = value; + this.SendPropertyChanged("WarehouseName"); + this.OnWarehouseNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateUserId", DbType="NVarChar(50)")] + public string CreateUserId + { + get + { + return this._CreateUserId; + } + set + { + if ((this._CreateUserId != value)) + { + this.OnCreateUserIdChanging(value); + this.SendPropertyChanging(); + this._CreateUserId = value; + this.SendPropertyChanged("CreateUserId"); + this.OnCreateUserIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateTime", DbType="DateTime")] + public System.Nullable CreateTime + { + get + { + return this._CreateTime; + } + set + { + if ((this._CreateTime != value)) + { + this.OnCreateTimeChanging(value); + this.SendPropertyChanging(); + this._CreateTime = value; + this.SendPropertyChanged("CreateTime"); + this.OnCreateTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ModifyUserId", DbType="NVarChar(50)")] + public string ModifyUserId + { + get + { + return this._ModifyUserId; + } + set + { + if ((this._ModifyUserId != value)) + { + this.OnModifyUserIdChanging(value); + this.SendPropertyChanging(); + this._ModifyUserId = value; + this.SendPropertyChanged("ModifyUserId"); + this.OnModifyUserIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ModifyTime", DbType="DateTime")] + public System.Nullable ModifyTime + { + get + { + return this._ModifyTime; + } + set + { + if ((this._ModifyTime != value)) + { + this.OnModifyTimeChanging(value); + this.SendPropertyChanging(); + this._ModifyTime = value; + this.SendPropertyChanged("ModifyTime"); + this.OnModifyTimeChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_WeldingLocation")] public partial class Base_WeldingLocation : INotifyPropertyChanging, INotifyPropertyChanged { @@ -102234,6 +102475,8 @@ namespace Model private string _FlowingSection; + private string _WarehouseId; + private EntityRef _Base_TestMedium; private EntitySet _HJGL_Batch_PointBatch; @@ -102338,6 +102581,8 @@ namespace Model partial void OnStateChanged(); partial void OnFlowingSectionChanging(string value); partial void OnFlowingSectionChanged(); + partial void OnWarehouseIdChanging(string value); + partial void OnWarehouseIdChanged(); #endregion public HJGL_Pipeline() @@ -103054,6 +103299,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WarehouseId", DbType="NVarChar(50)")] + public string WarehouseId + { + get + { + return this._WarehouseId; + } + set + { + if ((this._WarehouseId != value)) + { + this.OnWarehouseIdChanging(value); + this.SendPropertyChanging(); + this._WarehouseId = value; + this.SendPropertyChanged("WarehouseId"); + this.OnWarehouseIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_[HJGL_Pipeline_Base_TestMedium1", Storage="_Base_TestMedium", ThisKey="LeakMedium", OtherKey="TestMediumId", IsForeignKey=true)] public Base_TestMedium Base_TestMedium {