From 3becf06cfe587c73da617c72483d142c122d5aa3 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Wed, 11 Feb 2026 15:24:28 +0800 Subject: [PATCH] =?UTF-8?q?20260211=20=E5=B7=A5=E7=A8=8B=E8=81=94=E7=BB=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/HJGLDB_DS_2026-02-11_bwj.sql | 4 + .../BLL/JGZL/ConDrawingVerificationService.cs | 10 + HJGL_DS/BLL/JGZL/ContactService.cs | 13 + .../JGZL/ConDrawingVerification.aspx | 131 ++--- .../JGZL/ConDrawingVerification.aspx.cs | 365 ++++-------- .../ConDrawingVerification.aspx.designer.cs | 87 +-- HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx | 74 ++- HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.cs | 554 ++++++++++++------ .../JGZL/Contact.aspx.designer.cs | 164 ++++-- HJGL_DS/Model/Model.cs | 48 ++ 10 files changed, 868 insertions(+), 582 deletions(-) create mode 100644 DataBase/版本日志/HJGLDB_DS_2026-02-11_bwj.sql diff --git a/DataBase/版本日志/HJGLDB_DS_2026-02-11_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-02-11_bwj.sql new file mode 100644 index 0000000..4a339bc --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-02-11_bwj.sql @@ -0,0 +1,4 @@ +alter table JGZL_Contact add ContactSortName nvarchar(50) +alter table JGZL_Contact add ContactSort int +go + diff --git a/HJGL_DS/BLL/JGZL/ConDrawingVerificationService.cs b/HJGL_DS/BLL/JGZL/ConDrawingVerificationService.cs index a3ccbac..a740d00 100644 --- a/HJGL_DS/BLL/JGZL/ConDrawingVerificationService.cs +++ b/HJGL_DS/BLL/JGZL/ConDrawingVerificationService.cs @@ -21,6 +21,16 @@ namespace BLL return Funs.DB.JGZL_ConDrawingVerification.FirstOrDefault(e => e.ConDrawingVerificationId == conDrawingVerificationId); } + /// + /// 根据项目Id获取施工图核查记录 + /// + /// + /// + public static Model.JGZL_ConDrawingVerification GetConDrawingVerificationByProjectId(string projectId) + { + return Funs.DB.JGZL_ConDrawingVerification.FirstOrDefault(e => e.ProjectId == projectId); + } + /// /// 添加 /// diff --git a/HJGL_DS/BLL/JGZL/ContactService.cs b/HJGL_DS/BLL/JGZL/ContactService.cs index ab051f7..abf00fb 100644 --- a/HJGL_DS/BLL/JGZL/ContactService.cs +++ b/HJGL_DS/BLL/JGZL/ContactService.cs @@ -22,6 +22,17 @@ namespace BLL return Funs.DB.JGZL_Contact.FirstOrDefault(e => e.ContactId == contactId); } + /// + /// 根据项目Id获取工程联络单 + /// + /// + /// + /// + public static Model.JGZL_Contact GetContactByProjectId(string projectId,string contactSort) + { + return Funs.DB.JGZL_Contact.FirstOrDefault(e => e.ProjectId == projectId && e.ContactSort == Convert.ToInt32(contactSort)); + } + /// /// 添加工程联络单 /// @@ -47,6 +58,8 @@ namespace BLL newContact.OpinionsDate = contact.OpinionsDate; newContact.CompileMan = contact.CompileMan; newContact.CompileDate = contact.CompileDate; + newContact.ContactSort = contact.ContactSort; + newContact.ContactSortName = contact.ContactSortName; db.JGZL_Contact.InsertOnSubmit(newContact); db.SubmitChanges(); } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx index 7273ee4..0c2bd48 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx @@ -4,7 +4,7 @@ - + 施工图核查记录 @@ -39,98 +39,71 @@ - + + + <%----%> - - - - - - - - <%-- - --%> - - - - - - - <%-- - --%> - - - <%-- - --%> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + <%----%> + + + + + <%-- + + + +--%> + + + + + + + + + + + + + <%----%> + + + + + <%-- + + + + +--%> + + + - - - - - - - - diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.cs index 332c838..504dd4b 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.cs @@ -11,8 +11,25 @@ using System.IO; namespace FineUIPro.Web.JGZL { - public partial class ConDrawingVerification :PageBase + public partial class ConDrawingVerification : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string ConDrawingVerificationId + { + get + { + return (string)ViewState["ConDrawingVerificationId"]; + } + set + { + ViewState["ConDrawingVerificationId"] = value; + } + } + #endregion + #region 加载页面 /// /// 加载页面 @@ -23,8 +40,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,9 +49,53 @@ namespace FineUIPro.Web.JGZL this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + PageData(); } } + + private void PageData() + { + EmptyText(); + string projectId = this.tvControlItem.SelectedNodeID; + if (!string.IsNullOrEmpty(projectId)) + { + var report = BLL.ConDrawingVerificationService.GetConDrawingVerificationByProjectId(projectId); + if (report != null) + { + this.ConDrawingVerificationId = report.ConDrawingVerificationId; + this.txtDesignUnit.Text = report.DesignUnit; + this.txtProfessional.Text = report.Professional; + //this.txtHost.Text = report.Host; + this.txtVerificationDate.Text = report.VerificationDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.VerificationDate) : ""; + this.txtConDrawingCode.Text = report.ConDrawingCode; + //this.txtPersonnel.Text = report.Personnel; + this.txtContents.Text = report.Contents; + this.txtProblems.Text = report.Problems; + //this.txtRecorder.Text = report.Recorder; + this.txtRecordDate.Text = report.RecordDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.RecordDate) : ""; + //this.txtReviewer.Text = report.Reviewer; + this.txtReviewDate.Text = report.ReviewDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReviewDate) : ""; + } + else + { + this.ConDrawingVerificationId = string.Empty; + this.txtVerificationDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + this.txtConDrawingCode.Text = BLL.Base_ProjectService.GetProjectCode(projectId); + } + } + } + + private void EmptyText() + { + txtDesignUnit.Text = string.Empty; + txtProfessional.Text = string.Empty; + txtVerificationDate.Text = string.Empty; + txtConDrawingCode.Text = string.Empty; + txtContents.Text = string.Empty; + txtProblems.Text = string.Empty; + txtRecordDate.Text = string.Empty; + txtReviewDate.Text = string.Empty; + } #endregion #region 加载树项目 @@ -82,80 +141,11 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + PageData(); } } #endregion - #region 数据绑定 - /// - /// 数据绑定 - /// - private void BindGrid() - { - //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); - string strSql = @"SELECT * from JGZL_ConDrawingVerification 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 - #region 查询 /// ///查询 @@ -166,17 +156,7 @@ namespace FineUIPro.Web.JGZL { this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - BindGrid(); - } - - /// - /// 查询 - /// - /// - /// - protected void TextBox_TextChanged(object sender, EventArgs e) - { - this.BindGrid(); + PageData(); } #endregion @@ -189,35 +169,32 @@ namespace FineUIPro.Web.JGZL protected void btnPrint_Click(object sender, EventArgs e) { string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = BLL.ConDrawingVerificationService.GetConDrawingVerificationByProjectId(projectId); + if (report != null) { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("DesignUnit", report.DesignUnit); + keyValuePairs.Add("Professional", report.Professional); + keyValuePairs.Add("Host", report.Host); + keyValuePairs.Add("VerificationDate", report.VerificationDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.VerificationDate) : ""); + keyValuePairs.Add("ConDrawingCode", report.ConDrawingCode); + keyValuePairs.Add("Personnel", report.Personnel); + keyValuePairs.Add("Contents", report.Contents); + keyValuePairs.Add("Problems", report.Problems); + keyValuePairs.Add("Recorder", report.Recorder); + keyValuePairs.Add("RecordDate", report.RecordDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.RecordDate) : ""); + keyValuePairs.Add("Reviewer", report.Reviewer); + keyValuePairs.Add("ReviewDate", report.ReviewDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.ReviewDate) : ""); - var report = BLL.ConDrawingVerificationService.GetConDrawingVerificationById(this.Grid1.SelectedRowID); - if (report != null) - { - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - keyValuePairs.Add("DesignUnit", report.DesignUnit); - keyValuePairs.Add("Professional", report.Professional); - keyValuePairs.Add("Host", report.Host); - keyValuePairs.Add("VerificationDate", report.VerificationDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.VerificationDate) : ""); - keyValuePairs.Add("ConDrawingCode", report.ConDrawingCode); - keyValuePairs.Add("Personnel", report.Personnel); - keyValuePairs.Add("Contents", report.Contents); - keyValuePairs.Add("Problems", report.Problems); - keyValuePairs.Add("Recorder", report.Recorder); - keyValuePairs.Add("RecordDate", report.RecordDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.RecordDate) : ""); - keyValuePairs.Add("Reviewer", report.Reviewer); - keyValuePairs.Add("ReviewDate", report.ReviewDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.ReviewDate) : ""); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - } initTemplatePath = "File\\Fastreport\\JGZL\\施工图核查记录.frx"; if (File.Exists(rootPath + initTemplatePath)) { @@ -226,7 +203,7 @@ namespace FineUIPro.Web.JGZL } else { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning); return; } } @@ -238,159 +215,53 @@ namespace FineUIPro.Web.JGZL } #endregion - #region 维护 + #region 提交按钮 /// - /// 增加 + /// 提交按钮 /// /// /// - protected void btnAdd_Click(object sender, EventArgs e) + protected void btnSave_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ConDrawingVerificationMenuId, Const.BtnSave)) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConDrawingVerificationEidt.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } - - /// - /// 双击编辑 - /// - /// - /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ConDrawingVerificationMenuId, BLL.Const.BtnModify)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + Model.JGZL_ConDrawingVerification newReport = new Model.JGZL_ConDrawingVerification(); + newReport.DesignUnit = this.txtDesignUnit.Text.Trim(); + newReport.Professional = this.txtProfessional.Text.Trim(); + //newReport.Host = this.txtHost.Text.Trim(); + newReport.VerificationDate = Funs.GetNewDateTime(this.txtVerificationDate.Text); + newReport.ConDrawingCode = txtConDrawingCode.Text.Trim(); + //newReport.Personnel = this.txtPersonnel.Text; + newReport.Contents = this.txtContents.Text; + newReport.Problems = this.txtProblems.Text; + //newReport.Recorder = this.txtRecorder.Text.Trim(); + newReport.RecordDate = Funs.GetNewDateTime(this.txtRecordDate.Text.Trim()); + //newReport.Reviewer=this.txtReviewer.Text.Trim(); + newReport.ReviewDate = Funs.GetNewDateTime(this.txtReviewDate.Text.Trim()); + if (!string.IsNullOrEmpty(this.ConDrawingVerificationId)) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConDrawingVerificationEidt.aspx?conDrawingVerificationId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + newReport.ConDrawingVerificationId = this.ConDrawingVerificationId; + BLL.ConDrawingVerificationService.UpdateConDrawingVerification(newReport); + ShowNotify("修改成功!", MessageBoxIcon.Success); } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; + newReport.ProjectId = this.tvControlItem.SelectedNodeID; + newReport.CompileMan = this.CurrUser.UserId; + newReport.CompileDate = DateTime.Now; + newReport.ConDrawingVerificationId = SQLHelper.GetNewID(typeof(Model.JGZL_ConDrawingVerification)); + this.ConDrawingVerificationId = newReport.ConDrawingVerificationId; + BLL.ConDrawingVerificationService.AddConDrawingVerification(newReport); + ShowNotify("保存成功!", MessageBoxIcon.Success); } - } - 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_ConDrawingVerificationMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConDrawingVerificationEidt.aspx?conDrawingVerificationId={0}", Grid1.SelectedRowID, "维护 - "))); + PageData(); } else { Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; } } - - /// - /// 右键删除 - /// - /// - /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ConDrawingVerificationMenuId, 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.ConDrawingVerificationService.DeleteConDrawingVerificationById(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 + #endregion } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.designer.cs index eaac192..777245f 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ConDrawingVerification.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 控件。 + /// txtDesignUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.TextBox txtDesignUnit; /// - /// ToolbarText1 控件。 + /// txtProfessional 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; + protected global::FineUIPro.TextBox txtProfessional; /// - /// ddlPageSize 控件。 + /// txtVerificationDate 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList ddlPageSize; + protected global::FineUIPro.DatePicker txtVerificationDate; /// - /// Window1 控件。 + /// txtConDrawingCode 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Window Window1; + protected global::FineUIPro.TextBox txtConDrawingCode; + + /// + /// txtContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtContents; + + /// + /// txtProblems 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtProblems; + + /// + /// txtRecordDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtRecordDate; + + /// + /// txtReviewDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReviewDate; /// /// 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; } } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx index b759cd9..abf4647 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx @@ -37,16 +37,72 @@ + + + - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- - + --%> - + --%> - + <%-- - + --%> - + --%> diff --git a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.cs index 18fc44a..c35ed83 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.cs @@ -8,11 +8,30 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; +using FineUIPro.Web.common.BaseInfo; namespace FineUIPro.Web.JGZL { public partial class Contact : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string ContactId + { + get + { + return (string)ViewState["ContactId"]; + } + set + { + ViewState["ContactId"] = value; + } + } + #endregion + + #region 加载页面 /// /// 加载页面 @@ -23,7 +42,7 @@ namespace FineUIPro.Web.JGZL { if (!IsPostBack) { - this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + //this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); this.drpProjectId.DataTextField = "ProjectCode"; this.drpProjectId.DataValueField = "ProjectId"; @@ -34,11 +53,109 @@ namespace FineUIPro.Web.JGZL this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + + this.drpContactSort.DataTextField = "ContactSortName"; + this.drpContactSort.DataValueField = "ContactSort"; + this.drpContactSort.DataSource = (from x in Funs.DB.JGZL_Contact where x.ProjectId== this.tvControlItem.SelectedNodeID orderby x.ContactSort select x).ToList(); + this.drpContactSort.DataBind(); + + PageData(); } } #endregion + private void PageData() + { + EmptyText(); + string projectId = this.tvControlItem.SelectedNodeID; + if (!string.IsNullOrEmpty(projectId)) + { + int isoCount = (from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == projectId select x).Count(); + int jointCount = (from x in Funs.DB.HJGL_PW_JointInfo where x.ProjectId == projectId select x).Count(); + var project = BLL.Base_ProjectService.GetProjectByProjectId(projectId); + var report = BLL.ContactService.GetContactByProjectId(projectId, this.drpContactSort.SelectedValue); + if (report != null) + { + this.hdContactSort.Text = report.ContactSort.ToString(); + this.hdContactSortName.Text = report.ContactSortName; + this.ContactId = report.ContactId; + if (!string.IsNullOrEmpty(report.ContractNumber)) + { + this.txtContractNumber.Text = report.ContractNumber; + } + else + { + this.txtContractNumber.Text = project.ProjectCode; + } + this.txtDeliveryUnit.Text = report.DeliveryUnit; + if (!string.IsNullOrEmpty(report.SubjectMatter)) + { + this.txtSubjectMatter.Text = report.SubjectMatter; + } + else + { + this.txtSubjectMatter.Text = project.ProjectName + ",以下问题请设计单位审核:"; + } + if (!string.IsNullOrEmpty(report.Contents)) + { + this.txtContents.Text = report.Contents; + } + else + { + this.txtContents.Text = "本次" + project.ProjectName + "于" + string.Format("{0:yyyy年MM月dd日}", project.StartDate) + "开工,到" + string.Format("{0:yyyy年MM月dd日}", project.EndDate) + "施工结束。该项目共计安装管道" + isoCount + "条,管道焊缝共计" + jointCount + "道,已按图纸要求的比例进行焊缝无损检测,检测结果均符合设计规定的合格等级。该项目配套的各类管道组成件、支撑件安装质量均满足设计文件以及标准规范要求。目前,管道系统已完成水压试验及压缩空气吹扫工序,试验压力降、管道洁净度等关键指标均符合标准规范的规定标准并已通过业主方验收。"; + } + this.txtHandler.Text = report.Handler; + this.txtHandDate.Text = report.HandDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.HandDate) : ""; + this.txtReviewer.Text = report.Reviewer; + this.txtReviewDate.Text = report.ReviewDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReviewDate) : ""; + this.txtHandlingOpinion.Text = report.HandlingOpinion; + this.txtOpinionHandler.Text = report.OpinionHandler; + this.txtOpinionHandDate.Text = report.OpinionHandDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.OpinionHandDate) : ""; + this.txtOpinionsReviewer.Text = report.OpinionsReviewer; + this.txtOpinionsDate.Text = report.OpinionsDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.OpinionsDate) : ""; + } + else + { + var con = (from x in Funs.DB.JGZL_Contact where x.ProjectId == project.ProjectId select x).ToList(); + if (con.Count == 0) + { + this.drpContactSort.Hidden = true; + this.btnAdd.Hidden = true; + } + else + { + this.drpContactSort.Hidden = false; + this.btnAdd.Hidden = false; + } + this.ContactId = string.Empty; + this.txtContractNumber.Text = project.ProjectCode; + this.txtSubjectMatter.Text = project.ProjectName + ",以下问题请设计单位审核:"; + this.txtContents.Text = "本次" + project.ProjectName + "于" + string.Format("{0:yyyy年MM月dd日}", project.StartDate) + "开工,到" + string.Format("{0:yyyy年MM月dd日}", project.EndDate) + "施工结束。该项目共计安装管道" + isoCount + "条,管道焊缝共计" + jointCount + "道,已按图纸要求的比例进行焊缝无损检测,检测结果均符合设计规定的合格等级。该项目配套的各类管道组成件、支撑件安装质量均满足设计文件以及标准规范要求。目前,管道系统已完成水压试验及压缩空气吹扫工序,试验压力降、管道洁净度等关键指标均符合标准规范的规定标准并已通过业主方验收。"; + } + } + } + + /// + /// 清空文本框 + /// + /// + private void EmptyText() + { + txtContractNumber.Text = string.Empty; + txtDeliveryUnit.Text = string.Empty; + txtSubjectMatter.Text = string.Empty; + txtContents.Text = string.Empty; + txtHandler.Text = string.Empty; + txtHandDate.Text = string.Empty; + txtReviewer.Text = string.Empty; + txtReviewDate.Text = string.Empty; + txtHandlingOpinion.Text = string.Empty; + txtOpinionHandler.Text = string.Empty; + txtOpinionHandDate.Text = string.Empty; + txtOpinionsReviewer.Text = string.Empty; + txtOpinionsDate.Text = string.Empty; + } + #region 加载树项目 /// /// 加载树 @@ -82,7 +199,8 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + //this.BindGrid(); + PageData(); } } #endregion @@ -91,30 +209,30 @@ namespace FineUIPro.Web.JGZL /// /// 数据绑定 /// - private void BindGrid() - { - //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); - string strSql = @"SELECT * from JGZL_Contact 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(); - } + //private void BindGrid() + //{ + // //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); + // string strSql = @"SELECT * from JGZL_Contact 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 分页排序 @@ -124,10 +242,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - { - BindGrid(); - } + //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 排序 @@ -136,10 +254,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Grid1_Sort(object sender, GridSortEventArgs e) - { - BindGrid(); - } + //protected void Grid1_Sort(object sender, GridSortEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 分页选择下拉改变事件 @@ -148,11 +266,11 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); - } + //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + //{ + // Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + // BindGrid(); + //} #endregion #endregion @@ -166,7 +284,7 @@ namespace FineUIPro.Web.JGZL { this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - BindGrid(); + PageData(); } /// @@ -174,10 +292,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void TextBox_TextChanged(object sender, EventArgs e) - { - this.BindGrid(); - } + //protected void TextBox_TextChanged(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} #endregion #region 打印 @@ -189,35 +307,32 @@ namespace FineUIPro.Web.JGZL protected void btnPrint_Click(object sender, EventArgs e) { string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = BLL.ContactService.GetContactByProjectId(projectId,this.drpContactSort.SelectedValue); + if (report != null) + { + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("ContractNumber", report.ContractNumber); + keyValuePairs.Add("DeliveryUnit", report.DeliveryUnit); + keyValuePairs.Add("SubjectMatter", report.SubjectMatter); + keyValuePairs.Add("Contents", report.Contents); + keyValuePairs.Add("Handler", report.Handler); + keyValuePairs.Add("HandDate", report.HandDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.HandDate) : ""); + keyValuePairs.Add("Reviewer", report.Reviewer); + keyValuePairs.Add("ReviewDate", report.ReviewDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.ReviewDate) : ""); + keyValuePairs.Add("HandlingOpinion", report.HandlingOpinion); + keyValuePairs.Add("OpinionHandler", report.OpinionHandler); + keyValuePairs.Add("OpinionHandDate", report.OpinionHandDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.OpinionHandDate) : ""); + keyValuePairs.Add("OpinionsReviewer", report.OpinionsReviewer); + keyValuePairs.Add("OpinionsDate", report.OpinionsDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.OpinionsDate) : ""); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - var report = BLL.ContactService.GetContactById(this.Grid1.SelectedRowID); - if (report != null) - { - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - keyValuePairs.Add("ContractNumber", report.ContractNumber); - keyValuePairs.Add("DeliveryUnit", report.DeliveryUnit); - keyValuePairs.Add("SubjectMatter", report.SubjectMatter); - keyValuePairs.Add("Contents", report.Contents); - keyValuePairs.Add("Handler", report.Handler); - keyValuePairs.Add("HandDate", report.HandDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.HandDate) : ""); - keyValuePairs.Add("Reviewer", report.Reviewer); - keyValuePairs.Add("ReviewDate", report.ReviewDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.ReviewDate) : ""); - keyValuePairs.Add("HandlingOpinion", report.HandlingOpinion); - keyValuePairs.Add("OpinionHandler", report.OpinionHandler); - keyValuePairs.Add("OpinionHandDate", report.OpinionHandDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.OpinionHandDate) : ""); - keyValuePairs.Add("OpinionsReviewer", report.OpinionsReviewer); - keyValuePairs.Add("OpinionsDate", report.OpinionsDate.HasValue ? string.Format("{0:yyyy年MM月dd日}", report.OpinionsDate) : ""); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - } initTemplatePath = "File\\Fastreport\\JGZL\\工程联络单.frx"; if (File.Exists(rootPath + initTemplatePath)) { @@ -226,7 +341,7 @@ namespace FineUIPro.Web.JGZL } else { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + Alert.ShowInTop("请先保存记录!", MessageBoxIcon.Warning); return; } } @@ -248,7 +363,26 @@ namespace FineUIPro.Web.JGZL { if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContactEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + this.ContactId = string.Empty; + this.hdContactSort.Text = string.Empty; + this.hdContactSortName.Text = string.Empty; + this.drpContactSort.SelectedValue = BLL.Const._Null; + int? maxCon = (from x in Funs.DB.JGZL_Contact where x.ProjectId == this.tvControlItem.SelectedNodeID select x.ContactSort).Max(); + if (maxCon != null) + { + this.hdContactSort.Text = (maxCon + 1).ToString(); + this.hdContactSortName.Text = "联络单" + this.hdContactSort.Text; + } + EmptyText(); + var project = BLL.Base_ProjectService.GetProjectByProjectId(this.tvControlItem.SelectedNodeID); + if (project != null) + { + int isoCount = (from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == project.ProjectId select x).Count(); + int jointCount = (from x in Funs.DB.HJGL_PW_JointInfo where x.ProjectId == project.ProjectId select x).Count(); + this.txtContractNumber.Text = project.ProjectCode; + this.txtSubjectMatter.Text = project.ProjectName + ",以下问题请设计单位审核:"; + this.txtContents.Text = "本次" + project.ProjectName + "于" + string.Format("{0:yyyy年MM月dd日}", project.StartDate) + "开工,到" + string.Format("{0:yyyy年MM月dd日}", project.EndDate) + "施工结束。该项目共计安装管道" + isoCount + "条,管道焊缝共计" + jointCount + "道,已按图纸要求的比例进行焊缝无损检测,检测结果均符合设计规定的合格等级。该项目配套的各类管道组成件、支撑件安装质量均满足设计文件以及标准规范要求。目前,管道系统已完成水压试验及压缩空气吹扫工序,试验压力降、管道洁净度等关键指标均符合标准规范的规定标准并已通过业主方验收。"; + } } else { @@ -262,121 +396,121 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ContactMenuId, BLL.Const.BtnModify)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContactEdit.aspx?contactId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ContactMenuId, BLL.Const.BtnModify)) + // { + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContactEdit.aspx?contactId={0}", this.Grid1.SelectedRowID, "编辑 - "))); + // } + // else + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // } + // else + // { + // Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + // return; + // } + // } + // 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_ContactMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContactEdit.aspx?contactId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void btnMenuEdit_Click(object sender, EventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ContactMenuId, BLL.Const.BtnModify)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContactEdit.aspx?contactId={0}", Grid1.SelectedRowID, "维护 - "))); + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} /// /// 右键删除 /// /// /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ContactMenuId, Const.BtnDelete)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + //protected void btnMenuDelete_Click(object sender, EventArgs e) + //{ + // if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ContactMenuId, 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.ContactService.DeleteContactById(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); - } - } + // 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.ContactService.DeleteContactById(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; + //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; - } - } + // if (string.IsNullOrEmpty(content)) + // { + // return true; + // } + // else + // { + // if (isShow) + // { + // Alert.ShowInTop(content, MessageBoxIcon.Error); + // } + // return false; + // } + //} #endregion #endregion @@ -386,11 +520,89 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) + //protected void Window1_Close(object sender, WindowCloseEventArgs e) + //{ + // this.InitTreeMenu();//加载树 + // this.BindGrid(); + //} + #endregion + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) { - this.InitTreeMenu();//加载树 - this.BindGrid(); + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ContactMenuId, Const.BtnSave)) + { + Model.JGZL_Contact newReport = new Model.JGZL_Contact(); + newReport.ContractNumber = this.txtContractNumber.Text.Trim(); + newReport.DeliveryUnit = this.txtDeliveryUnit.Text.Trim(); + newReport.SubjectMatter = this.txtSubjectMatter.Text.Trim(); + newReport.Contents = this.txtContents.Text.Trim(); + newReport.Handler = this.txtHandler.Text.Trim(); + newReport.HandDate = Funs.GetNewDateTime(this.txtHandDate.Text); + newReport.Reviewer = this.txtReviewer.Text.Trim(); + newReport.ReviewDate = Funs.GetNewDateTime(this.txtReviewDate.Text); + newReport.HandlingOpinion = this.txtHandlingOpinion.Text; + newReport.OpinionHandler = this.txtOpinionHandler.Text; + newReport.OpinionHandDate = Funs.GetNewDateTime(this.txtOpinionHandDate.Text); + newReport.OpinionsReviewer = this.txtOpinionsReviewer.Text; + newReport.OpinionsDate = Funs.GetNewDateTime(this.txtOpinionsDate.Text); + if (!string.IsNullOrEmpty(this.ContactId)) + { + newReport.ContactId = this.ContactId; + BLL.ContactService.UpdateContact(newReport); + ShowNotify("修改成功!", MessageBoxIcon.Success); + } + else + { + var con = (from x in Funs.DB.JGZL_Contact where x.ProjectId == this.tvControlItem.SelectedNodeID select x).ToList(); + if (con.Count > 0) + { + newReport.ContactSort = Funs.GetNewInt(hdContactSort.Text.Trim()); + newReport.ContactSortName = hdContactSortName.Text.Trim(); + } + else + { + newReport.ContactSort = 1; + newReport.ContactSortName = "联络单1"; + this.hdContactSort.Text = "1"; + this.hdContactSortName.Text = "联络单1"; + } + newReport.ProjectId = this.tvControlItem.SelectedNodeID; + newReport.CompileMan = this.CurrUser.UserId; + newReport.CompileDate = DateTime.Now; + newReport.ContactId = SQLHelper.GetNewID(typeof(Model.JGZL_Contact)); + this.ContactId = newReport.ContactId; + BLL.ContactService.AddContact(newReport); + ShowNotify("保存成功!", MessageBoxIcon.Success); + } + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + this.drpContactSort.Items.Clear(); + this.drpContactSort.DataTextField = "ContactSortName"; + this.drpContactSort.DataValueField = "ContactSort"; + this.drpContactSort.DataSource = (from x in Funs.DB.JGZL_Contact where x.ProjectId == this.tvControlItem.SelectedNodeID orderby x.ContactSort select x).ToList(); + this.drpContactSort.DataBind(); + this.drpContactSort.SelectedValue = this.hdContactSort.Text.Trim(); + PageData(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } } #endregion + + protected void drpContactSort_SelectedIndexChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.drpContactSort.SelectedValue)) + { + PageData(); + } + } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.designer.cs index 1f4db0c..5c853d1 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/Contact.aspx.designer.cs @@ -95,6 +95,33 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// drpContactSort 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpContactSort; + + /// + /// hdContactSort 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdContactSort; + + /// + /// hdContactSortName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdContactSortName; + /// /// ToolbarFill1 控件。 /// @@ -113,6 +140,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnAdd; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + /// /// btnPrint 控件。 /// @@ -123,49 +159,130 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.Button btnPrint; /// - /// Grid1 控件。 + /// SimpleForm1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Grid Grid1; + protected global::FineUIPro.Form SimpleForm1; /// - /// ToolbarSeparator1 控件。 + /// txtContractNumber 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.TextBox txtContractNumber; /// - /// ToolbarText1 控件。 + /// txtDeliveryUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; + protected global::FineUIPro.TextBox txtDeliveryUnit; /// - /// ddlPageSize 控件。 + /// txtSubjectMatter 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList ddlPageSize; + protected global::FineUIPro.TextArea txtSubjectMatter; /// - /// Window1 控件。 + /// txtContents 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Window Window1; + protected global::FineUIPro.TextArea txtContents; + + /// + /// txtHandler 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHandler; + + /// + /// txtHandDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtHandDate; + + /// + /// txtReviewer 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtReviewer; + + /// + /// txtReviewDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReviewDate; + + /// + /// txtHandlingOpinion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtHandlingOpinion; + + /// + /// txtOpinionHandler 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOpinionHandler; + + /// + /// txtOpinionHandDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOpinionHandDate; + + /// + /// txtOpinionsReviewer 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOpinionsReviewer; + + /// + /// txtOpinionsDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOpinionsDate; /// /// WindowPrint 控件。 @@ -175,32 +292,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; } } diff --git a/HJGL_DS/Model/Model.cs b/HJGL_DS/Model/Model.cs index e6f74d9..ca7f6f3 100644 --- a/HJGL_DS/Model/Model.cs +++ b/HJGL_DS/Model/Model.cs @@ -83458,6 +83458,10 @@ namespace Model private System.Nullable _CompileDate; + private string _ContactSortName; + + private System.Nullable _ContactSort; + private EntityRef _Base_Project; private EntityRef _Sys_User; @@ -83500,6 +83504,10 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnContactSortNameChanging(string value); + partial void OnContactSortNameChanged(); + partial void OnContactSortChanging(System.Nullable value); + partial void OnContactSortChanged(); #endregion public JGZL_Contact() @@ -83857,6 +83865,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContactSortName", DbType="NVarChar(50)")] + public string ContactSortName + { + get + { + return this._ContactSortName; + } + set + { + if ((this._ContactSortName != value)) + { + this.OnContactSortNameChanging(value); + this.SendPropertyChanging(); + this._ContactSortName = value; + this.SendPropertyChanged("ContactSortName"); + this.OnContactSortNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContactSort", DbType="Int")] + public System.Nullable ContactSort + { + get + { + return this._ContactSort; + } + set + { + if ((this._ContactSort != value)) + { + this.OnContactSortChanging(value); + this.SendPropertyChanging(); + this._ContactSort = value; + this.SendPropertyChanged("ContactSort"); + this.OnContactSortChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_Contact_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project {