diff --git a/HJGL_DS/BLL/JGZL/ProcessHandoverRecordService.cs b/HJGL_DS/BLL/JGZL/ProcessHandoverRecordService.cs index 8fb48d5..c925742 100644 --- a/HJGL_DS/BLL/JGZL/ProcessHandoverRecordService.cs +++ b/HJGL_DS/BLL/JGZL/ProcessHandoverRecordService.cs @@ -18,6 +18,16 @@ namespace BLL return Funs.DB.JGZL_ProcessHandoverRecord.FirstOrDefault(e => e.RecordId == Id); } + /// + /// 根据项目Id获取工序交接记录 + /// + /// + /// + public static Model.JGZL_ProcessHandoverRecord GetProcessHandoverRecordByProjectId(string projectId) + { + return Funs.DB.JGZL_ProcessHandoverRecord.FirstOrDefault(e => e.ProjectId == projectId); + } + /// /// 添加工序交接记录 /// diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/工序交接记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/工序交接记录.frx index d99b815..c593803 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/工序交接记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/工序交接记录.frx @@ -1,7 +1,7 @@  - + - + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx.cs index 6f7eef8..4c129ab 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx.cs @@ -279,6 +279,7 @@ namespace FineUIPro.Web.HJGL.HotProessManage newNode.CommandName = "委托单号"; newNode.EnableClickEvent = true; newNode.EnableExpandEvent = true; + newNode.Expanded = true; node.Nodes.Add(newNode); } } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx index 46b0c7b..e2750a1 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx @@ -39,89 +39,61 @@ - + <%----%> + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.cs index 1255a49..b993d2d 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.cs @@ -1,18 +1,52 @@ using BLL; +using FastReport; using System; using System.Collections.Generic; -using System.Data.SqlClient; using System.Data; +using System.Data.SqlClient; +using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -using System.IO; +using System.Windows.Forms; namespace FineUIPro.Web.JGZL { public partial class ProcessHandoverRecord : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + #region 加载页面 /// /// 加载页面 @@ -23,8 +57,6 @@ namespace FineUIPro.Web.JGZL { if (!IsPostBack) { - this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); - this.drpProjectId.DataTextField = "ProjectCode"; this.drpProjectId.DataValueField = "ProjectId"; this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); @@ -34,7 +66,35 @@ namespace FineUIPro.Web.JGZL this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + this.ProjectId = this.tvControlItem.SelectedNodeID; + DataInfo();//加载数据 + //this.BindGrid(); + } + } + + private void DataInfo() + { + this.txtExecutionStandard.Text = string.Empty; + this.txtOrganizationalUnit.Text = string.Empty; + this.txtHandoverUnit.Text = string.Empty; + this.txtReceivingUnit.Text = string.Empty; + this.txtInspectionResults.Text = string.Empty; + this.txtReceivingUnitOpinions.Text = string.Empty; + + var report = BLL.ProcessHandoverRecordService.GetProcessHandoverRecordByProjectId(this.ProjectId); + if (report != null) + { + this.RecordId = report.RecordId; + this.txtExecutionStandard.Text = report.ExecutionStandard; + this.txtOrganizationalUnit.Text = report.OrganizationalUnit; + this.txtHandoverUnit.Text = report.HandoverUnit; + this.txtReceivingUnit.Text = report.ReceivingUnit; + this.txtInspectionResults.Text = report.InspectionResults; + this.txtReceivingUnitOpinions.Text = report.ReceivingUnitOpinions; + } + else + { + //默认值 } } #endregion @@ -82,79 +142,11 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + DataInfo(); + //this.BindGrid(); } } - #endregion - - #region 数据绑定 - /// - /// 数据绑定 - /// - private void BindGrid() - { - //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); - string strSql = @"SELECT * from JGZL_ProcessHandoverRecord where 1=1"; - List listStr = new List(); - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); - } - //else - //{ - // strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 "; - // listStr.Add(new SqlParameter("@ProjectId", projectIds)); - //} - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - // 2.获取当前分页数据 - Grid1.RecordCount = tb.Rows.Count; - //tb = GetFilteredTable(Grid1.FilteredData, tb); - var table = this.GetPagedDataTable(Grid1, tb); - Grid1.DataSource = table; - Grid1.DataBind(); - } - #endregion - - #region 分页排序 - #region 页索引改变事件 - /// - /// 页索引改变事件 - /// - /// - /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - { - BindGrid(); - } - #endregion - - #region 排序 - /// - /// 排序 - /// - /// - /// - protected void Grid1_Sort(object sender, GridSortEventArgs e) - { - BindGrid(); - } - #endregion - - #region 分页选择下拉改变事件 - /// - /// 分页选择下拉改变事件 - /// - /// - /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); - } - #endregion - #endregion + #endregion #region 查询 /// @@ -164,8 +156,10 @@ namespace FineUIPro.Web.JGZL /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { + this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.tvControlItem.SelectedNodeID; this.InitTreeMenu(); - this.BindGrid(); + DataInfo(); } /// @@ -175,7 +169,8 @@ namespace FineUIPro.Web.JGZL /// protected void TextBox_TextChanged(object sender, EventArgs e) { - this.BindGrid(); + //this.BindGrid(); + DataInfo(); } #endregion @@ -204,21 +199,21 @@ namespace FineUIPro.Web.JGZL dt.Columns.Add("InspectionResults"); dt.Columns.Add("ReceivingUnitOpinions"); - string id = this.Grid1.SelectedRowID; - if (!string.IsNullOrEmpty(id)) - { - var report = BLL.ProcessHandoverRecordService.GetProcessHandoverRecordById(id); - if (report!=null) - { + //string id = this.Grid1.SelectedRowID; + //if (!string.IsNullOrEmpty(id)) + //{ + //var report = BLL.ProcessHandoverRecordService.GetProcessHandoverRecordById(id); + //if (report!=null) + //{ var newRow = dt.NewRow(); - newRow["ExecutionStandard"] = report.ExecutionStandard; - newRow["OrganizationalUnit"] = report.OrganizationalUnit; - newRow["HandoverUnit"] = report.HandoverUnit; - newRow["ReceivingUnit"] = report.ReceivingUnit; - newRow["InspectionResults"] = report.InspectionResults; - newRow["ReceivingUnitOpinions"] = report.ReceivingUnitOpinions; - dt.Rows.Add(newRow); - } + newRow["ExecutionStandard"] = txtExecutionStandard.Text.Trim(); + newRow["OrganizationalUnit"] = txtOrganizationalUnit.Text.Trim(); + newRow["HandoverUnit"] = txtHandoverUnit.Text.Trim(); + newRow["ReceivingUnit"] = txtReceivingUnit.Text.Trim(); + newRow["InspectionResults"] = txtInspectionResults.Text; + newRow["ReceivingUnitOpinions"] =txtReceivingUnitOpinions.Text; + dt.Rows.Add(newRow); + //} BLL.Common.FastReportService.AddFastreportTable(dt); @@ -231,12 +226,12 @@ namespace FineUIPro.Web.JGZL { PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); } - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + //} + //else + //{ + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + //} } else { @@ -252,153 +247,64 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void btnAdd_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProcessHandoverRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } + //protected void btnAdd_Click(object sender, EventArgs e) + //{ + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProcessHandoverRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + // } + // else + // { + // Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + // return; + // } + //} + #endregion + #region 提交按钮 /// - /// 双击编辑 + /// 提交按钮 /// /// /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + protected void btnSave_Click(object sender, EventArgs e) { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ProcessHandoverRecordMenuId, BLL.Const.BtnModify)) + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ProcessHandoverRecordMenuId, Const.BtnSave)) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + Model.JGZL_ProcessHandoverRecord newReport = new Model.JGZL_ProcessHandoverRecord(); + newReport.ExecutionStandard = this.txtExecutionStandard.Text.Trim(); + newReport.OrganizationalUnit = this.txtOrganizationalUnit.Text.Trim(); + newReport.HandoverUnit = this.txtHandoverUnit.Text.Trim(); + newReport.ReceivingUnit = this.txtReceivingUnit.Text.Trim(); + newReport.InspectionResults = this.txtInspectionResults.Text.Trim(); + newReport.ReceivingUnitOpinions = this.txtReceivingUnitOpinions.Text.Trim(); + + if (!string.IsNullOrEmpty(this.RecordId)) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProcessHandoverRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + newReport.RecordId = this.RecordId; + BLL.ProcessHandoverRecordService.UpdateProcessHandoverRecord(newReport); } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; + newReport.ProjectId = this.ProjectId; + newReport.CompileMan = this.CurrUser.UserId; + newReport.CompileDate = DateTime.Now; + newReport.Reviewer = this.CurrUser.UserId; + newReport.RevieweDate = DateTime.Now; + newReport.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_ProcessHandoverRecord)); + this.RecordId = newReport.RecordId; + BLL.ProcessHandoverRecordService.AddProcessHandoverRecord(newReport); } - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } - - /// - /// 右键编辑 - /// - /// - /// - protected void btnMenuEdit_Click(object sender, EventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ProcessHandoverRecordMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProcessHandoverRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - "))); + ShowNotify("保存成功!", MessageBoxIcon.Success); + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; } } + #endregion - /// - /// 右键删除 - /// - /// - /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ProcessHandoverRecordMenuId, Const.BtnDelete)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - - bool isShow = true; - if (Grid1.SelectedRowIndexArray.Length > 1) - { - isShow = false; - } - bool isDelete = false; - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - if (judgementDelete(rowID, isShow)) - { - isDelete = true; - BLL.ProcessHandoverRecordService.DeleteProcessHandoverRecordById(rowID); - BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除工序交接记录"); - } - } - if (isDelete) - { - ShowNotify("删除成功!", MessageBoxIcon.Success); - } - this.BindGrid(); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } - - #region 判断是否可删除 - /// - /// 判断是否可以删除 - /// - /// - private bool judgementDelete(string id, bool isShow) - { - string content = string.Empty; - - if (string.IsNullOrEmpty(content)) - { - return true; - } - else - { - if (isShow) - { - Alert.ShowInTop(content, MessageBoxIcon.Error); - } - return false; - } - } - #endregion - #endregion - - #region 关闭弹出窗口及刷新页面 - /// - /// 关闭弹出窗口 - /// - /// - /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) - { - this.InitTreeMenu();//加载树 - this.BindGrid(); - } - #endregion } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.designer.cs index 1ce3d94..234913e 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ProcessHandoverRecord.aspx.designer.cs @@ -105,13 +105,13 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.ToolbarFill ToolbarFill1; /// - /// btnAdd 控件。 + /// btnSave 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Button btnAdd; + protected global::FineUIPro.Button btnSave; /// /// btnPrint 控件。 @@ -123,49 +123,85 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.Button btnPrint; /// - /// Grid1 控件。 + /// SimpleForm1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Grid Grid1; + protected global::FineUIPro.Form SimpleForm1; /// - /// ToolbarSeparator1 控件。 + /// txtExecutionStandard 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.TextBox txtExecutionStandard; /// - /// ToolbarText1 控件。 + /// txtOrganizationalUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; + protected global::FineUIPro.TextBox txtOrganizationalUnit; /// - /// ddlPageSize 控件。 + /// txtHandoverUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList ddlPageSize; + protected global::FineUIPro.TextBox txtHandoverUnit; /// - /// Window1 控件。 + /// txtReceivingUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Window Window1; + protected global::FineUIPro.TextBox txtReceivingUnit; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtInspectionResults 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtInspectionResults; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label2; + + /// + /// txtReceivingUnitOpinions 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtReceivingUnitOpinions; /// /// WindowPrint 控件。 @@ -175,32 +211,5 @@ namespace FineUIPro.Web.JGZL /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowPrint; - - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; - - /// - /// btnMenuEdit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuEdit; - - /// - /// btnMenuDelete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDelete; } }