diff --git a/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs b/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs index e40e15e6..376b530c 100644 --- a/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs +++ b/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs @@ -1,4 +1,8 @@ -using System.Linq; +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; namespace BLL { @@ -9,6 +13,62 @@ namespace BLL { public static Model.SGGLDB db = Funs.DB; + #region 获取安全巡检列表信息 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + + /// + /// 定义变量 + /// + private static IQueryable getDataLists = from x in db.SitePerson_Person + select x; + + /// + /// + /// + /// + /// + /// + /// + public static IEnumerable getListData(string projectId, string personName, Grid Grid1) + { + IQueryable getDataList = getDataLists; + if (!string.IsNullOrEmpty(projectId)) + { + getDataList = getDataList.Where(e => e.ProjectId == projectId); + } + if (!string.IsNullOrEmpty(personName)) + { + getDataList = getDataList.Where(e => e.PersonName.Contains(personName)); + } + + count = getDataList.Count(); + if (count == 0) + { + return null; + } + getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in getDataList + select new + { + x.ProjectId, + ProjectName = db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName, + x.UnitId, + UnitName = db.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName, + x.SitePersonId, + x.PersonId, + x.CardNo, + x.PersonName, + }; + } + #endregion + /// /// 根据主键获取体检管理 /// diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs index 160519a8..7239b9f4 100644 --- a/SGGL/BLL/ProjectData/ProjectService.cs +++ b/SGGL/BLL/ProjectData/ProjectService.cs @@ -1,6 +1,7 @@ namespace BLL { using Model; + using NPOI.Util; using System; using System.Collections.Generic; using System.Linq; @@ -361,17 +362,20 @@ group x by x.ProjectId into g select new { g.First().ProjectId, count = g.Count() }).Distinct(); - List getList = new List(); + if (getProjects.Count() > 0) { - getList = (from x in getProjects - join y in pcount on x.ProjectId equals y.ProjectId into PP - from p in PP.DefaultIfEmpty() - orderby p.count descending - select x).ToList(); + var getList = (from x in getProjects + join y in pcount on x.ProjectId equals y.ProjectId into PP + from p in PP.DefaultIfEmpty() + orderby p.count descending + select x); + return getList.ToList(); } - - return getList; + else + { + return null; + } } } diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx index b3c4226d..1df17a02 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx @@ -137,7 +137,6 @@ + diff --git a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.cs b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.cs index da21bc5a..7c576e32 100644 --- a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.cs @@ -1,10 +1,8 @@ using BLL; using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SqlClient; using System.Linq; using System.Text; +using System.Web; using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.HSSE.OccupationHealth @@ -24,7 +22,6 @@ namespace FineUIPro.Web.HSSE.OccupationHealth Funs.DropDownPageSize(this.ddlPageSize); ////权限按钮方法 this.GetButtonPower(); - this.btnNew.OnClientClick = Window1.GetShowReference("PhysicalExaminationEdit.aspx") + "return false;"; // 绑定表格 this.BindGrid(); @@ -38,47 +35,9 @@ namespace FineUIPro.Web.HSSE.OccupationHealth /// private void BindGrid() { - string strSql = @"SELECT PhysicalExamination.FileId,PhysicalExamination.FileCode,PhysicalExamination.FileName,CompileManPerson.PersonName AS CompileManName,PhysicalExamination.CompileDate,Project.ProjectName,Project.ProjectCode" - + @" ,(CASE WHEN PhysicalExamination.States = " + BLL.Const.State_0 + " OR PhysicalExamination.States IS NULL THEN '待['+OperatePerson.PersonName+']提交' WHEN PhysicalExamination.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperatePerson.PersonName+']办理' END) AS FlowOperateName" - + @" FROM OccupationHealth_PhysicalExamination AS PhysicalExamination" - + @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON PhysicalExamination.FileId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1" - + @" LEFT JOIN Person_Persons AS OperatePerson ON FlowOperate.OperaterId=OperatePerson.PersonId " - + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON PhysicalExamination.FileId=CodeRecords.DataId " - + @" LEFT JOIN Base_Project AS Project ON PhysicalExamination.ProjectId=Project.ProjectId " - + @" LEFT JOIN Person_Persons AS CompileManPerson ON PhysicalExamination.CompileMan =CompileManPerson.PersonId WHERE 1=1 "; - List listStr = new List(); - if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) ///总部查看 - { - strSql += " AND PhysicalExamination.States = @States"; ///状态为已完成 - listStr.Add(new SqlParameter("@States", BLL.Const.State_2)); - if (this.drpProject.SelectedValue != null && this.drpProject.SelectedValue != BLL.Const._Null) - { - strSql += " AND PhysicalExamination.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); - } - } - else //现场查看 - { - strSql += " AND PhysicalExamination.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - } - if (!string.IsNullOrEmpty(this.txtFileCode.Text.Trim())) - { - strSql += " AND FileCode LIKE @FileCode"; - listStr.Add(new SqlParameter("@FileCode", "%" + this.txtFileCode.Text.Trim() + "%")); - } - if (!string.IsNullOrEmpty(this.txtFileName.Text.Trim())) - { - strSql += " AND PhysicalExamination.FileName LIKE @FileName"; - listStr.Add(new SqlParameter("@FileName", "%" + this.txtFileName.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; + var getData = PhysicalExaminationService.getListData(this.CurrUser.LoginProjectId, this.txtPersonName.Text.Trim(), Grid1); + Grid1.RecordCount = PhysicalExaminationService.count; + Grid1.DataSource = getData; Grid1.DataBind(); } @@ -160,47 +119,12 @@ namespace FineUIPro.Web.HSSE.OccupationHealth return; } string id = Grid1.SelectedRowID; - var OccupationHealth = BLL.PhysicalExaminationService.GetPhysicalExaminationById(id); - if (OccupationHealth != null) + if (!this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面 { - if (this.btnMenuEdit.Hidden || OccupationHealth.States == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面 - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationView.aspx?FileId={0}", id, "查看 - "))); - } - else - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?FileId={0}", id, "编辑 - "))); - } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?SitePersonId={0}", id, "编辑 - "))); } } - #endregion - - #region 删除 - /// - /// 右键删除事件 - /// - /// - /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (Grid1.SelectedRowIndexArray.Length > 0) - { - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var getD = BLL.PhysicalExaminationService.GetPhysicalExaminationById(rowID); - if (getD != null) - { - BLL.LogService.AddSys_Log(this.CurrUser, getD.FileCode, getD.FileId, BLL.Const.ServerPhysicalExaminationMenuId, BLL.Const.BtnDelete); - BLL.PhysicalExaminationService.DeletePhysicalExaminationById(rowID); - } - } - - this.BindGrid(); - ShowNotify("删除数据成功!", MessageBoxIcon.Success); - } - } - #endregion + #endregion #region 获取按钮权限 /// @@ -221,19 +145,11 @@ namespace FineUIPro.Web.HSSE.OccupationHealth } var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId); if (buttonList.Count() > 0) - { - if (buttonList.Contains(BLL.Const.BtnAdd)) - { - this.btnNew.Hidden = false; - } + { if (buttonList.Contains(BLL.Const.BtnModify)) { this.btnMenuEdit.Hidden = false; } - if (buttonList.Contains(BLL.Const.BtnDelete)) - { - this.btnMenuDelete.Hidden = false; - } } else { @@ -299,6 +215,26 @@ namespace FineUIPro.Web.HSSE.OccupationHealth return sb.ToString(); } - #endregion + #endregion + + + /// + /// 获取整改前图片(放于Img中) + /// + /// + /// + protected string ConvertImageUrlByImage(object personId) + { + string url = string.Empty; + if (personId != null) + { + var attach = BLL.AttachFileService.GetAttachFile(personId.ToString() + "#3", BLL.Const.PersonListMenuId); + if (attach != null) + { + url = HttpUtility.HtmlDecode(BLL.UploadAttachmentService.ShowImage("../../", attach.AttachUrl)); + } + } + return url; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.designer.cs index 4e6be65c..f0345a4c 100644 --- a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExamination.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.OccupationHealth { - - - public partial class PhysicalExamination { - +namespace FineUIPro.Web.HSSE.OccupationHealth +{ + + + public partial class PhysicalExamination + { + /// /// Head1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - + /// /// form1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -65,25 +67,16 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// - /// txtFileCode 控件。 + /// txtPersonName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtFileCode; - - /// - /// txtFileName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtFileName; - + protected global::FineUIPro.TextBox txtPersonName; + /// /// drpProject 控件。 /// @@ -92,7 +85,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpProject; - + /// /// ToolbarFill1 控件。 /// @@ -101,16 +94,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - - /// - /// btnNew 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnNew; - + /// /// btnOut 控件。 /// @@ -119,7 +103,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// lblNumber 控件。 /// @@ -128,7 +112,16 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblNumber; - + + /// + /// lbImageUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbImageUrl; + /// /// ToolbarSeparator1 控件。 /// @@ -137,7 +130,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -146,7 +139,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -155,16 +148,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - - /// - /// Window1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window1; - + /// /// WindowAtt 控件。 /// @@ -173,7 +157,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; - + /// /// Menu1 控件。 /// @@ -182,7 +166,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuEdit 控件。 /// @@ -191,14 +175,5 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - - /// - /// btnMenuDelete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDelete; } } diff --git a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx index f33014fd..95e3ee08 100644 --- a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx @@ -14,40 +14,26 @@ - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + - - - + + + + - + @@ -55,13 +41,7 @@ - - - - - + diff --git a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.cs index 50a69641..d0fc1195 100644 --- a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using Microsoft.Office.Core; using System; using System.Web; @@ -10,30 +11,27 @@ namespace FineUIPro.Web.HSSE.OccupationHealth /// /// 主键 /// - public string FileId + public string PersonId { get { - return (string)ViewState["FileId"]; + return (string)ViewState["PersonId"]; } set { - ViewState["FileId"] = value; + ViewState["PersonId"] = value; } } - /// - /// 项目主键 - /// - public string ProjectId + public string SitePersonId { get { - return (string)ViewState["ProjectId"]; + return (string)ViewState["SitePersonId"]; } set { - ViewState["ProjectId"] = value; + ViewState["SitePersonId"] = value; } } #endregion @@ -49,115 +47,21 @@ namespace FineUIPro.Web.HSSE.OccupationHealth if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpCompileMan, this.CurrUser.LoginProjectId, null, null, true); - this.ProjectId = this.CurrUser.LoginProjectId; - this.FileId = Request.Params["FileId"]; - if (!string.IsNullOrEmpty(this.FileId)) + + this.SitePersonId = Request.Params["SitePersonId"]; + var getPerson= SitePerson_PersonService.GetSitePersonById(this.SitePersonId); + if (getPerson != null) { - Model.OccupationHealth_PhysicalExamination PhysicalExamination = BLL.PhysicalExaminationService.GetPhysicalExaminationById(this.FileId); - if (PhysicalExamination != null) - { - this.ProjectId = PhysicalExamination.ProjectId; - this.txtFileCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.FileId); - this.txtFileName.Text = PhysicalExamination.FileName; - if (!string.IsNullOrEmpty(PhysicalExamination.CompileMan)) - { - this.drpCompileMan.SelectedValue = PhysicalExamination.CompileMan; - } - this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", PhysicalExamination.CompileDate); - this.txtFileContent.Text = HttpUtility.HtmlDecode(PhysicalExamination.FileContent); - } + this.txtProjectName.Text = ProjectService.GetProjectNameByProjectId(getPerson.ProjectId); + this.txtUnitName.Text = UnitService.GetUnitNameByUnitId(getPerson.UnitId); + this.PersonId = getPerson.PersonId; + this.txtCardNo.Text = getPerson.CardNo; + this.txtPersonName.Text = getPerson.PersonName; } - else - { - ////自动生成编码 - this.txtFileCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.PhysicalExaminationMenuId, this.ProjectId, this.CurrUser.UnitId); - this.drpCompileMan.SelectedValue = this.CurrUser.PersonId; - this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); - this.txtFileName.Text = this.SimpleForm1.Title; - } - ///初始化审核菜单 - this.ctlAuditFlow.MenuId = BLL.Const.PhysicalExaminationMenuId; - this.ctlAuditFlow.DataId = this.FileId; - this.ctlAuditFlow.ProjectId = this.ProjectId; - this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; } } #endregion - #region 提交按钮 - /// - /// 提交按钮 - /// - /// - /// - protected void btnSubmit_Click(object sender, EventArgs e) - { - if (this.ctlAuditFlow.NextStep == BLL.Const.State_1 && this.ctlAuditFlow.NextPerson == BLL.Const._Null) - { - ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning); - return; - } - this.SaveData(BLL.Const.BtnSubmit); - PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); - } - #endregion - - #region 保存 - /// - /// 保存按钮 - /// - /// - /// - protected void btnSave_Click(object sender, EventArgs e) - { - this.SaveData(BLL.Const.BtnSave); - PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); - } - - - /// - /// 保存数据 - /// - /// - private void SaveData(string type) - { - Model.OccupationHealth_PhysicalExamination PhysicalExamination = new Model.OccupationHealth_PhysicalExamination - { - FileCode = this.txtFileCode.Text.Trim(), - FileName = this.txtFileName.Text.Trim() - }; - if (this.drpCompileMan.SelectedValue != BLL.Const._Null) - { - PhysicalExamination.CompileMan = this.drpCompileMan.SelectedValue; - } - PhysicalExamination.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()); - PhysicalExamination.FileContent = HttpUtility.HtmlEncode(this.txtFileContent.Text); - ////单据状态 - PhysicalExamination.States = BLL.Const.State_0; - if (type == BLL.Const.BtnSubmit) - { - PhysicalExamination.States = this.ctlAuditFlow.NextStep; - } - if (!string.IsNullOrEmpty(this.FileId)) - { - PhysicalExamination.FileId = this.FileId; - BLL.PhysicalExaminationService.UpdatePhysicalExamination(PhysicalExamination); - BLL.LogService.AddSys_Log(this.CurrUser, PhysicalExamination.FileCode, PhysicalExamination.FileId, BLL.Const.PhysicalExaminationMenuId, BLL.Const.BtnModify); - } - else - { - this.FileId = SQLHelper.GetNewID(typeof(Model.OccupationHealth_PhysicalExamination)); - PhysicalExamination.FileId = this.FileId; - PhysicalExamination.ProjectId = this.ProjectId; - BLL.PhysicalExaminationService.AddPhysicalExamination(PhysicalExamination); - BLL.LogService.AddSys_Log(this.CurrUser, PhysicalExamination.FileCode, PhysicalExamination.FileId, BLL.Const.PhysicalExaminationMenuId, BLL.Const.BtnAdd); - } - ////保存流程审核数据 - this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.PhysicalExaminationMenuId, this.FileId, (type == BLL.Const.BtnSubmit ? true : false), this.txtFileName.Text.Trim(), "../OccupationHealth/PhysicalExaminationView.aspx?FileId={0}"); - } - #endregion - #region 附件上传 /// /// 上传附件 @@ -166,11 +70,8 @@ namespace FineUIPro.Web.HSSE.OccupationHealth /// protected void btnAttachUrl_Click(object sender, EventArgs e) { - if (string.IsNullOrEmpty(this.FileId)) - { - SaveData(BLL.Const.BtnSave); - } - PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/PhysicalExaminationAttachUrl&menuId={1}", FileId, BLL.Const.PhysicalExaminationMenuId))); + string filePath = "FileUpLoad/PersonBaseInfo/" + DateTime.Now.ToString("yyyy-MM") + "/newfile/"; + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=" + filePath + "&menuId={1}&strParam=3", this.PersonId, BLL.Const.PersonListMenuId))); } #endregion } diff --git a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.designer.cs index 74faad90..3c403196 100644 --- a/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/OccupationHealth/PhysicalExaminationEdit.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.OccupationHealth { - - - public partial class PhysicalExaminationEdit { - +namespace FineUIPro.Web.HSSE.OccupationHealth +{ + + + public partial class PhysicalExaminationEdit + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 控件。 /// @@ -38,70 +40,43 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// - /// txtFileCode 控件。 + /// txtProjectName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtFileCode; - + protected global::FineUIPro.TextBox txtProjectName; + /// - /// txtFileName 控件。 + /// txtUnitName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtFileName; - + protected global::FineUIPro.TextBox txtUnitName; + /// - /// txtFileContent 控件。 + /// txtCardNo 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.HtmlEditor txtFileContent; - + protected global::FineUIPro.TextBox txtCardNo; + /// - /// drpCompileMan 控件。 + /// txtPersonName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpCompileMan; - - /// - /// txtCompileDate 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtCompileDate; - - /// - /// ContentPanel1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ContentPanel ContentPanel1; - - /// - /// ctlAuditFlow 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow; - + protected global::FineUIPro.TextBox txtPersonName; + /// /// Toolbar1 控件。 /// @@ -110,7 +85,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// btnAttachUrl 控件。 /// @@ -119,25 +94,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAttachUrl; - - /// - /// btnSave 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSave; - - /// - /// btnSubmit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSubmit; - + /// /// btnClose 控件。 /// @@ -146,7 +103,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnClose; - + /// /// WindowAtt 控件。 /// diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.cs b/SGGL/FineUIPro.Web/indexProject.aspx.cs index c52ef372..480dbe5c 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.cs @@ -319,20 +319,26 @@ namespace FineUIPro.Web } this.drpProject.DataValueField = "ProjectId"; - this.drpProject.DataTextField = "ShortName"; + this.drpProject.DataTextField = "ShortName"; var projectlist =ProjectService.GetSortIndexProjectByUserIdDropDownList(this.CurrUser.PersonId); this.drpProject.DataSource = projectlist; this.drpProject.DataBind(); if (!string.IsNullOrEmpty(Request.Params["projectId"])) { - Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]); - if (!projectlist.Contains(project)) + var getp = projectlist.FirstOrDefault(x => x.ProjectId == Request.Params["projectId"]); + if (getp == null) { - projectlist.Add(project); - this.drpProject.DataSource = projectlist; - this.drpProject.DataBind(); + Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]); + if (project != null) + { + projectlist.Add(project); + this.drpProject.Items.Clear(); + this.drpProject.DataSource = projectlist; + this.drpProject.DataBind(); + } } + this.drpProject.SelectedValue = Request.Params["projectId"]; }