Example #1
0
 /// <summary>
 /// 修改HSSE事故(含未遂)处理
 /// </summary>
 /// <param name="accidentHandle"></param>
 public static void UpdateAccidentHandle(Model.Accident_AccidentHandle accidentHandle)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentHandle newAccidentHandle = db.Accident_AccidentHandle.FirstOrDefault(e => e.AccidentHandleId == accidentHandle.AccidentHandleId);
     if (newAccidentHandle != null)
     {
         //newAccidentHandle.ProjectId = accidentHandle.ProjectId;
         newAccidentHandle.AccidentHandleCode = accidentHandle.AccidentHandleCode;
         newAccidentHandle.AccidentHandleName = accidentHandle.AccidentHandleName;
         newAccidentHandle.UnitId             = accidentHandle.UnitId;
         newAccidentHandle.AccidentDate       = accidentHandle.AccidentDate;
         newAccidentHandle.AccidentDef        = accidentHandle.AccidentDef;
         newAccidentHandle.Death                  = accidentHandle.Death;
         newAccidentHandle.MoneyLoss              = accidentHandle.MoneyLoss;
         newAccidentHandle.AccidentHandle         = accidentHandle.AccidentHandle;
         newAccidentHandle.Remark                 = accidentHandle.Remark;
         newAccidentHandle.States                 = accidentHandle.States;
         newAccidentHandle.CompileMan             = accidentHandle.CompileMan;
         newAccidentHandle.CompileDate            = accidentHandle.CompileDate;
         newAccidentHandle.DeathPersonNum         = accidentHandle.DeathPersonNum;
         newAccidentHandle.InjuriesPersonNum      = accidentHandle.InjuriesPersonNum;
         newAccidentHandle.MinorInjuriesPersonNum = accidentHandle.MinorInjuriesPersonNum;
         newAccidentHandle.WorkHoursLoss          = accidentHandle.WorkHoursLoss;
         db.SubmitChanges();
     }
 }
Example #2
0
 /// <summary>
 /// 添加HSSE事故(含未遂)处理
 /// </summary>
 /// <param name="accidentHandle"></param>
 public static void AddAccidentHandle(Model.Accident_AccidentHandle accidentHandle)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentHandle newAccidentHandle = new Model.Accident_AccidentHandle
     {
         AccidentHandleId   = accidentHandle.AccidentHandleId,
         ProjectId          = accidentHandle.ProjectId,
         UnitId             = accidentHandle.UnitId,
         AccidentHandleCode = accidentHandle.AccidentHandleCode,
         AccidentHandleName = accidentHandle.AccidentHandleName,
         AccidentDate       = accidentHandle.AccidentDate,
         AccidentDef        = accidentHandle.AccidentDef,
         Death                  = accidentHandle.Death,
         MoneyLoss              = accidentHandle.MoneyLoss,
         AccidentHandle         = accidentHandle.AccidentHandle,
         Remark                 = accidentHandle.Remark,
         States                 = accidentHandle.States,
         CompileMan             = accidentHandle.CompileMan,
         CompileDate            = accidentHandle.CompileDate,
         DeathPersonNum         = accidentHandle.DeathPersonNum,
         InjuriesPersonNum      = accidentHandle.InjuriesPersonNum,
         MinorInjuriesPersonNum = accidentHandle.MinorInjuriesPersonNum,
         WorkHoursLoss          = accidentHandle.WorkHoursLoss
     };
     db.Accident_AccidentHandle.InsertOnSubmit(newAccidentHandle);
     db.SubmitChanges();
     CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectAccidentHandleMenuId, accidentHandle.ProjectId, accidentHandle.UnitId, accidentHandle.AccidentHandleId, accidentHandle.CompileDate);
 }
Example #3
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                BLL.UnitService.InitUnitDropDownList(this.drpRegistUnitId, this.CurrUser.LoginProjectId, true);
                BLL.UserService.InitUserDropDownList(this.drpHeadManId, this.CurrUser.LoginProjectId, true);
                this.AccidentHandleId = Request.Params["AccidentHandleId"];
                if (!string.IsNullOrEmpty(this.AccidentHandleId))
                {
                    Model.Accident_AccidentHandle accidentHandle = BLL.AccidentHandleService.GetAccidentHandleById(AccidentHandleId);
                    if (accidentHandle != null)
                    {
                        this.txtAccidentDate.Text       = string.Format("{0:yyyy-MM-dd}", accidentHandle.AccidentDate);
                        this.txtAccidentHandleCode.Text = accidentHandle.AccidentHandleCode;
                        this.txtUnitName.Text           = BLL.UnitService.GetUnitNameByUnitId(accidentHandle.UnitId);

                        Model.Accident_NoFourLetoff noFourLetoff = BLL.NoFourLetoffService.GetNoFourLetoffByAccidentHandleId(this.AccidentHandleId);
                        if (noFourLetoff != null)
                        {
                            this.NoFourLetoffId = noFourLetoff.NoFourLetoffId;

                            if (noFourLetoff.AccidentDate != null)
                            {
                                this.txtAccidentDate.Text = string.Format("{0:yyyy-MM-dd}", noFourLetoff.AccidentDate);
                            }
                            this.txtFileContents.Text = HttpUtility.HtmlDecode(noFourLetoff.FileContents);
                            if (!string.IsNullOrEmpty(noFourLetoff.RegistUnitId))
                            {
                                this.drpRegistUnitId.SelectedValue = noFourLetoff.RegistUnitId;
                            }
                            if (!string.IsNullOrEmpty(noFourLetoff.HeadMan))
                            {
                                this.drpHeadManId.SelectedValue = noFourLetoff.HeadMan;
                            }
                            if (noFourLetoff.RegistDate != null)
                            {
                                this.txtRegistDate.Text = string.Format("{0:yyyy-MM-dd}", noFourLetoff.RegistDate);
                            }
                        }

                        else
                        {
                            this.txtRegistDate.Text            = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                            this.drpHeadManId.SelectedValue    = this.CurrUser.UserId;
                            this.drpRegistUnitId.SelectedValue = this.CurrUser.UnitId;
                            var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectAccidentHandleMenuId, this.CurrUser.LoginProjectId);
                            if (codeTemplateRule != null)
                            {
                                this.txtFileContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template);
                            }
                        }
                    }
                }
            }
        }
Example #4
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="type"></param>
        private void SaveData(string type)
        {
            Model.Accident_AccidentHandle accidentHandle = new Model.Accident_AccidentHandle
            {
                ProjectId              = this.ProjectId,
                AccidentHandleCode     = this.txtAccidentHandleCode.Text.Trim(),
                AccidentHandleName     = this.txtAccidentHandleName.Text.Trim(),
                AccidentDate           = Convert.ToDateTime(this.txtAccidentDate.Text.Trim()),
                AccidentDef            = this.txtAccidentDef.Text.Trim(),
                MoneyLoss              = Funs.GetNewDecimalOrZero(this.txtMoneyLoss.Text.Trim()),
                WorkHoursLoss          = Funs.GetNewDecimalOrZero(this.txtWorkHoursLoss.Text.Trim()),
                MinorInjuriesPersonNum = Funs.GetNewIntOrZero(this.txtMinorInjuriesPersonNum.Text.Trim()),
                InjuriesPersonNum      = Funs.GetNewIntOrZero(this.txtInjuriesPersonNum.Text.Trim()),
                DeathPersonNum         = Funs.GetNewIntOrZero(this.txtDeathPersonNum.Text.Trim()),
                AccidentHandle         = this.txtAccidentHandle.Text.Trim(),
                Remark      = this.txtRemark.Text.Trim(),
                CompileMan  = this.CurrUser.UserId,
                CompileDate = DateTime.Now,
                States      = BLL.Const.State_0
            };
            if (this.drpUnitId.SelectedValue != BLL.Const._Null)
            {
                accidentHandle.UnitId = this.drpUnitId.SelectedValue;
            }

            if (type == BLL.Const.BtnSubmit)
            {
                var flowOperate = Funs.DB.Sys_FlowOperate.FirstOrDefault(x => x.DataId == this.AccidentHandleId && x.State == BLL.Const.State_2 && x.IsClosed == true);
                if (flowOperate != null)
                {
                    accidentHandle.States = BLL.Const.State_2;
                }
                else
                {
                    accidentHandle.States = this.ctlAuditFlow.NextStep;
                }
            }
            if (!string.IsNullOrEmpty(this.AccidentHandleId))
            {
                accidentHandle.AccidentHandleId = this.AccidentHandleId;
                BLL.AccidentHandleService.UpdateAccidentHandle(accidentHandle);
                BLL.LogService.AddSys_Log(this.CurrUser, this.txtAccidentHandleCode.Text, this.AccidentHandleId, BLL.Const.ProjectAccidentHandleMenuId, Const.BtnModify);
            }
            else
            {
                this.AccidentHandleId           = SQLHelper.GetNewID(typeof(Model.Accident_AccidentHandle));
                accidentHandle.AccidentHandleId = this.AccidentHandleId;
                BLL.AccidentHandleService.AddAccidentHandle(accidentHandle);
                BLL.LogService.AddSys_Log(this.CurrUser, this.txtAccidentHandleCode.Text, this.AccidentHandleId, BLL.Const.ProjectAccidentHandleMenuId, Const.BtnAdd);
            }
            ////保存流程审核数据
            this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectAccidentHandleMenuId, this.AccidentHandleId, (type == BLL.Const.BtnSubmit ? true : false), accidentHandle.AccidentHandleName, "../Accident/AccidentHandleView.aspx?AccidentHandleId={0}");
        }
Example #5
0
 /// <summary>
 /// 根据主键删除HSSE事故(含未遂)处理
 /// </summary>
 /// <param name="accidentHandleId"></param>
 public static void DeleteAccidentHandleById(string accidentHandleId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentHandle accidentHandle = db.Accident_AccidentHandle.FirstOrDefault(e => e.AccidentHandleId == accidentHandleId);
     if (accidentHandle != null)
     {
         CodeRecordsService.DeleteCodeRecordsByDataId(accidentHandleId);
         CommonService.DeleteFlowOperateByID(accidentHandleId);
         db.Accident_AccidentHandle.DeleteOnSubmit(accidentHandle);
         db.SubmitChanges();
     }
 }
Example #6
0
 /// <summary>
 /// 加载页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
         this.AccidentHandleId       = Request.Params["AccidentHandleId"];
         if (!string.IsNullOrEmpty(this.AccidentHandleId))
         {
             Model.Accident_AccidentHandle accidentHandle = BLL.AccidentHandleService.GetAccidentHandleById(this.AccidentHandleId);
             if (accidentHandle != null)
             {
                 this.txtAccidentHandleCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.AccidentHandleId);
                 this.txtAccidentHandleName.Text = accidentHandle.AccidentHandleName;
                 if (accidentHandle.AccidentDate != null)
                 {
                     this.txtAccidentDate.Text = string.Format("{0:yyyy-MM-dd}", accidentHandle.AccidentDate);
                 }
                 this.txtAccidentDef.Text = accidentHandle.AccidentDef;
                 if (accidentHandle.MoneyLoss != null)
                 {
                     this.txtMoneyLoss.Text = accidentHandle.MoneyLoss.ToString();
                 }
                 if (accidentHandle.WorkHoursLoss != null)
                 {
                     this.txtWorkHoursLoss.Text = accidentHandle.WorkHoursLoss.ToString();
                 }
                 if (accidentHandle.MinorInjuriesPersonNum != null)
                 {
                     this.txtMinorInjuriesPersonNum.Text = accidentHandle.MinorInjuriesPersonNum.ToString();
                 }
                 if (accidentHandle.InjuriesPersonNum != null)
                 {
                     this.txtInjuriesPersonNum.Text = accidentHandle.InjuriesPersonNum.ToString();
                 }
                 if (accidentHandle.DeathPersonNum != null)
                 {
                     this.txtDeathPersonNum.Text = accidentHandle.DeathPersonNum.ToString();
                 }
                 this.txtAccidentHandle.Text = accidentHandle.AccidentHandle;
                 this.txtRemark.Text         = accidentHandle.Remark;
                 this.txtUnitName.Text       = BLL.UnitService.GetUnitNameByUnitId(accidentHandle.UnitId);
             }
         }
         ///初始化审核菜单
         this.ctlAuditFlow.MenuId = BLL.Const.ProjectAccidentHandleMenuId;
         this.ctlAuditFlow.DataId = this.AccidentHandleId;
     }
 }
Example #7
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.ProjectId = this.CurrUser.LoginProjectId;
                BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
                this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
                if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
                {
                    this.drpUnitId.Enabled = false;
                }

                this.ProjectId        = this.CurrUser.LoginProjectId;
                this.AccidentHandleId = Request.Params["AccidentHandleId"];
                if (!string.IsNullOrEmpty(this.AccidentHandleId))
                {
                    Model.Accident_AccidentHandle accidentHandle = BLL.AccidentHandleService.GetAccidentHandleById(this.AccidentHandleId);
                    if (accidentHandle != null)
                    {
                        this.ProjectId = accidentHandle.ProjectId;
                        this.drpUnitId.SelectedValue = accidentHandle.UnitId;
                        if (this.ProjectId != this.CurrUser.LoginProjectId)
                        {
                            BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
                            this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
                        }

                        this.txtAccidentHandleCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.AccidentHandleId);
                        this.txtAccidentHandleName.Text = accidentHandle.AccidentHandleName;
                        if (accidentHandle.AccidentDate != null)
                        {
                            this.txtAccidentDate.Text = string.Format("{0:yyyy-MM-dd}", accidentHandle.AccidentDate);
                        }
                        this.txtAccidentDef.Text = accidentHandle.AccidentDef;
                        if (accidentHandle.MoneyLoss != null)
                        {
                            this.txtMoneyLoss.Text = accidentHandle.MoneyLoss.ToString();
                        }
                        if (accidentHandle.WorkHoursLoss != null)
                        {
                            this.txtWorkHoursLoss.Text = accidentHandle.WorkHoursLoss.ToString();
                        }
                        if (accidentHandle.MinorInjuriesPersonNum != null)
                        {
                            this.txtMinorInjuriesPersonNum.Text = accidentHandle.MinorInjuriesPersonNum.ToString();
                        }
                        if (accidentHandle.InjuriesPersonNum != null)
                        {
                            this.txtInjuriesPersonNum.Text = accidentHandle.InjuriesPersonNum.ToString();
                        }
                        if (accidentHandle.DeathPersonNum != null)
                        {
                            this.txtDeathPersonNum.Text = accidentHandle.DeathPersonNum.ToString();
                        }
                        this.txtAccidentHandle.Text = accidentHandle.AccidentHandle;
                        this.txtRemark.Text         = accidentHandle.Remark;
                    }
                }
                else
                {
                    this.txtAccidentHandleCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectAccidentHandleMenuId, this.ProjectId, this.CurrUser.UnitId);
                    this.txtAccidentDate.Text       = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId    = BLL.Const.ProjectAccidentHandleMenuId;
                this.ctlAuditFlow.DataId    = this.AccidentHandleId;
                this.ctlAuditFlow.ProjectId = this.ProjectId;
                this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
            }
        }