Exemplo n.º 1
0
 /// <summary>
 /// 修改事故调查处理报告
 /// </summary>
 /// <param name="accidentReportOther"></param>
 public static void UpdateAccidentReportOther(Model.Accident_AccidentReportOther accidentReportOther)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentReportOther newAccidentReportOther = db.Accident_AccidentReportOther.FirstOrDefault(e => e.AccidentReportOtherId == accidentReportOther.AccidentReportOtherId);
     if (newAccidentReportOther != null)
     {
         newAccidentReportOther.AccidentReportOtherCode = accidentReportOther.AccidentReportOtherCode;
         newAccidentReportOther.AccidentReportOtherName = accidentReportOther.AccidentReportOtherName;
         newAccidentReportOther.AccidentTypeId          = accidentReportOther.AccidentTypeId;
         newAccidentReportOther.Abstract             = accidentReportOther.Abstract;
         newAccidentReportOther.AccidentDate         = accidentReportOther.AccidentDate;
         newAccidentReportOther.WorkAreaId           = accidentReportOther.WorkAreaId;
         newAccidentReportOther.PeopleNum            = accidentReportOther.PeopleNum;
         newAccidentReportOther.UnitId               = accidentReportOther.UnitId;
         newAccidentReportOther.WorkingHoursLoss     = accidentReportOther.WorkingHoursLoss;
         newAccidentReportOther.EconomicLoss         = accidentReportOther.EconomicLoss;
         newAccidentReportOther.EconomicOtherLoss    = accidentReportOther.EconomicOtherLoss;
         newAccidentReportOther.ReportMan            = accidentReportOther.ReportMan;
         newAccidentReportOther.ReporterUnit         = accidentReportOther.ReporterUnit;
         newAccidentReportOther.ReportDate           = accidentReportOther.ReportDate;
         newAccidentReportOther.ProcessDescription   = accidentReportOther.ProcessDescription;
         newAccidentReportOther.EmergencyMeasures    = accidentReportOther.EmergencyMeasures;
         newAccidentReportOther.ImmediateCause       = accidentReportOther.ImmediateCause;
         newAccidentReportOther.IndirectReason       = accidentReportOther.IndirectReason;
         newAccidentReportOther.CorrectivePreventive = accidentReportOther.CorrectivePreventive;
         newAccidentReportOther.FileContent          = accidentReportOther.FileContent;
         newAccidentReportOther.CompileMan           = accidentReportOther.CompileMan;
         newAccidentReportOther.CompileDate          = accidentReportOther.CompileDate;
         newAccidentReportOther.States               = accidentReportOther.States;
         newAccidentReportOther.WorkArea             = accidentReportOther.WorkArea;
         db.SubmitChanges();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="type"></param>
        private void SaveData(string type)
        {
            Model.Accident_AccidentReportOther accidentReportOther = new Model.Accident_AccidentReportOther
            {
                ProjectId = this.CurrUser.LoginProjectId,
                AccidentReportOtherCode = this.txtAccidentReportOtherCode.Text.Trim(),
                AccidentReportOtherName = this.txtAccidentReportOtherName.Text.Trim()
            };
            if (this.drpAccidentTypeId.SelectedValue != BLL.Const._Null)
            {
                accidentReportOther.AccidentTypeId = this.drpAccidentTypeId.SelectedValue;
            }
            accidentReportOther.Abstract     = this.txtAbstract.Text.Trim();
            accidentReportOther.AccidentDate = Funs.GetNewDateTime(this.txtAccidentDate.Text.Trim());
            accidentReportOther.WorkArea     = this.txtWorkArea.Text;
            accidentReportOther.PeopleNum    = Funs.GetNewIntOrZero(this.txtPeopleNum.Text.Trim());
            if (this.drpUnitId.SelectedValue != BLL.Const._Null)
            {
                accidentReportOther.UnitId = this.drpUnitId.SelectedValue;
            }
            accidentReportOther.WorkingHoursLoss     = 0;
            accidentReportOther.EconomicLoss         = Funs.GetNewDecimalOrZero(this.txtEconomicLoss.Text.Trim());
            accidentReportOther.EconomicOtherLoss    = Funs.GetNewDecimalOrZero(this.txtEconomicOtherLoss.Text.Trim());
            accidentReportOther.ReportMan            = this.txtReportMan.Text.Trim();
            accidentReportOther.ReporterUnit         = this.txtReporterUnit.Text.Trim();
            accidentReportOther.ReportDate           = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
            accidentReportOther.ProcessDescription   = this.txtProcessDescription.Text.Trim();
            accidentReportOther.EmergencyMeasures    = this.txtEmergencyMeasures.Text.Trim();
            accidentReportOther.ImmediateCause       = this.txtImmediateCause.Text.Trim();
            accidentReportOther.IndirectReason       = this.txtIndirectReason.Text.Trim();
            accidentReportOther.CorrectivePreventive = this.txtCorrectivePreventive.Text.Trim();
            accidentReportOther.FileContent          = HttpUtility.HtmlEncode(this.txtFileContents.Text);
            if (this.drpCompileMan.SelectedValue != BLL.Const._Null)
            {
                accidentReportOther.CompileMan = this.drpCompileMan.SelectedValue;
            }
            accidentReportOther.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
            accidentReportOther.States      = BLL.Const.State_0;
            if (type == BLL.Const.BtnSubmit)
            {
                accidentReportOther.States = this.ctlAuditFlow.NextStep;
            }
            if (!string.IsNullOrEmpty(this.AccidentReportOtherId))
            {
                accidentReportOther.AccidentReportOtherId = this.AccidentReportOtherId;
                BLL.AccidentReportOtherService.UpdateAccidentReportOther(accidentReportOther);
                BLL.LogService.AddSys_Log(this.CurrUser, accidentReportOther.AccidentReportOtherCode, accidentReportOther.AccidentReportOtherId, BLL.Const.ProjectAccidentReportOtherMenuId, Const.BtnModify);
            }
            else
            {
                this.AccidentReportOtherId = SQLHelper.GetNewID(typeof(Model.Accident_AccidentReportOther));
                accidentReportOther.AccidentReportOtherId = this.AccidentReportOtherId;
                BLL.AccidentReportOtherService.AddAccidentReportOther(accidentReportOther);
                BLL.LogService.AddSys_Log(this.CurrUser, accidentReportOther.AccidentReportOtherCode, accidentReportOther.AccidentReportOtherId, BLL.Const.ProjectAccidentReportOtherMenuId, Const.BtnAdd);
            }

            //保存流程审核数据
            this.ctlAuditFlow.btnSaveData(this.CurrUser.LoginProjectId, BLL.Const.ProjectAccidentReportOtherMenuId, this.AccidentReportOtherId, (type == BLL.Const.BtnSubmit ? true : false), accidentReportOther.AccidentReportOtherCode, "../Accident/AccidentReportOtherView.aspx?AccidentReportOtherId={0}");
        }
Exemplo n.º 3
0
 /// <summary>
 /// 根据主键删除事故调查处理报告
 /// </summary>
 /// <param name="accidentReportOtherId"></param>
 public static void DeleteAccidentReportOtherById(string accidentReportOtherId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentReportOther accidentReportOther = db.Accident_AccidentReportOther.FirstOrDefault(e => e.AccidentReportOtherId == accidentReportOtherId);
     if (accidentReportOther != null)
     {
         CodeRecordsService.DeleteCodeRecordsByDataId(accidentReportOtherId);
         CommonService.DeleteFlowOperateByID(accidentReportOtherId);
         db.Accident_AccidentReportOther.DeleteOnSubmit(accidentReportOther);
         db.SubmitChanges();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 添加事故调查处理报告
 /// </summary>
 /// <param name="accidentReportOther"></param>
 public static void AddAccidentReportOther(Model.Accident_AccidentReportOther accidentReportOther)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Accident_AccidentReportOther newAccidentReportOther = new Model.Accident_AccidentReportOther
     {
         AccidentReportOtherId   = accidentReportOther.AccidentReportOtherId,
         ProjectId               = accidentReportOther.ProjectId,
         AccidentReportOtherCode = accidentReportOther.AccidentReportOtherCode,
         AccidentReportOtherName = accidentReportOther.AccidentReportOtherName,
         AccidentTypeId          = accidentReportOther.AccidentTypeId,
         Abstract             = accidentReportOther.Abstract,
         AccidentDate         = accidentReportOther.AccidentDate,
         WorkAreaId           = accidentReportOther.WorkAreaId,
         PeopleNum            = accidentReportOther.PeopleNum,
         UnitId               = accidentReportOther.UnitId,
         WorkingHoursLoss     = accidentReportOther.WorkingHoursLoss,
         EconomicLoss         = accidentReportOther.EconomicLoss,
         EconomicOtherLoss    = accidentReportOther.EconomicOtherLoss,
         ReportMan            = accidentReportOther.ReportMan,
         ReporterUnit         = accidentReportOther.ReporterUnit,
         ReportDate           = accidentReportOther.ReportDate,
         ProcessDescription   = accidentReportOther.ProcessDescription,
         EmergencyMeasures    = accidentReportOther.EmergencyMeasures,
         ImmediateCause       = accidentReportOther.ImmediateCause,
         IndirectReason       = accidentReportOther.IndirectReason,
         CorrectivePreventive = accidentReportOther.CorrectivePreventive,
         FileContent          = accidentReportOther.FileContent,
         CompileMan           = accidentReportOther.CompileMan,
         CompileDate          = accidentReportOther.CompileDate,
         States               = accidentReportOther.States,
         WorkArea             = accidentReportOther.WorkArea
     };
     db.Accident_AccidentReportOther.InsertOnSubmit(newAccidentReportOther);
     db.SubmitChanges();
     CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectAccidentReportOtherMenuId, accidentReportOther.ProjectId, null, accidentReportOther.AccidentReportOtherId, accidentReportOther.CompileDate);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var thisunit = BLL.CommonService.GetIsThisUnit();
                if (thisunit != null && !string.IsNullOrEmpty(thisunit.UnitCode))
                {
                    string url = "../Images/SUBimages/" + thisunit.UnitCode + ".gif";
                    if (url.Contains('*'))
                    {
                        url = url.Replace('*', '-');
                    }
                    this.image.Src = url;
                }

                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.AccidentReportOtherId  = Request.Params["AccidentReportOtherId"];
                if (!string.IsNullOrEmpty(this.AccidentReportOtherId))
                {
                    Model.Accident_AccidentReportOther accidentReportOther = BLL.AccidentReportOtherService.GetAccidentReportOtherById(this.AccidentReportOtherId);
                    if (accidentReportOther != null)
                    {
                        Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(accidentReportOther.ProjectId);
                        if (project != null)
                        {
                            this.lblProjectName.Text = project.ProjectName;
                            this.lblProjectCode.Text = project.ProjectCode;
                        }
                        this.txtAccidentReportOtherCode.Text = accidentReportOther.AccidentReportOtherCode;
                        if (!string.IsNullOrEmpty(accidentReportOther.AccidentTypeId))
                        {
                            Model.Sys_Const c = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_AccidentInvestigationProcessingReport).FirstOrDefault(x => x.ConstValue == accidentReportOther.AccidentTypeId);
                            if (c != null)
                            {
                                this.txtAccidentTypeName.Text = c.ConstText;
                            }
                        }
                        this.txtAbstract.Text = accidentReportOther.Abstract;
                        if (accidentReportOther.AccidentDate != null)
                        {
                            this.txtAccidentDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.AccidentDate);
                        }
                        this.txtWorkAreaName.Text = accidentReportOther.WorkArea;
                    }
                    if (accidentReportOther.PeopleNum != null)
                    {
                        this.txtPeopleNum.Text = Convert.ToString(accidentReportOther.PeopleNum);
                    }
                    if (!string.IsNullOrEmpty(accidentReportOther.UnitId))
                    {
                        var unit = BLL.UnitService.GetUnitByUnitId(accidentReportOther.UnitId);
                        if (unit != null)
                        {
                            this.txtUnitName.Text = unit.UnitName;
                        }
                    }

                    if (accidentReportOther.EconomicLoss != null)
                    {
                        this.txtEconomicLoss.Text = Convert.ToString(accidentReportOther.EconomicLoss);
                    }
                    if (accidentReportOther.EconomicOtherLoss != null)
                    {
                        this.txtEconomicOtherLoss.Text = Convert.ToString(accidentReportOther.EconomicOtherLoss);
                    }
                    this.txtReportMan.Text    = accidentReportOther.ReportMan;
                    this.txtReporterUnit.Text = accidentReportOther.ReporterUnit;
                    if (accidentReportOther.ReportDate != null)
                    {
                        this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.ReportDate);
                    }
                    this.txtProcessDescription.Text   = accidentReportOther.ProcessDescription;
                    this.txtEmergencyMeasures.Text    = accidentReportOther.EmergencyMeasures;
                    this.txtImmediateCause.Text       = accidentReportOther.ImmediateCause;
                    this.txtIndirectReason.Text       = accidentReportOther.IndirectReason;
                    this.txtCorrectivePreventive.Text = accidentReportOther.CorrectivePreventive;
                    if (!string.IsNullOrEmpty(accidentReportOther.CompileMan))
                    {
                        var user = BLL.UserService.GetUserByUserId(accidentReportOther.CompileMan);
                        if (user != null)
                        {
                            this.txtCompileManName.Text = user.UserName;
                        }
                    }
                    if (accidentReportOther.CompileDate != null)
                    {
                        this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.CompileDate);
                    }
                }
                BindGrid();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var unit = BLL.CommonService.GetIsThisUnit();
                if (unit != null && !string.IsNullOrEmpty(unit.UnitCode))
                {
                    string url = "../Images/SUBimages/" + unit.UnitCode + ".gif";
                    if (url.Contains('*'))
                    {
                        url = url.Replace('*', '-');
                    }
                    this.Image1.ImageUrl = url;
                }

                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
                {
                    this.lblProjectName.Text = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
                }
                this.txtAccidentReportOtherName.Text = "管理体系文件-施工管理";
                //this.drpAccidentTypeId.DataValueField = "AccidentTypeId";
                //this.drpAccidentTypeId.DataTextField = "AccidentTypeName";
                //this.drpAccidentTypeId.DataSource = BLL.AccidentTypeService.GetAccidentTypeList();
                //this.drpAccidentTypeId.DataBind();
                //Funs.FineUIPleaseSelect(this.drpAccidentTypeId);
                BLL.ConstValue.InitConstValueDropDownList(this.drpAccidentTypeId, BLL.ConstValue.Group_AccidentInvestigationProcessingReport, true);
                //this.drpWorkAreaId.DataValueField = "WorkAreaId";
                //this.drpWorkAreaId.DataTextField = "WorkAreaName";
                //this.drpWorkAreaId.DataSource = BLL.WorkAreaService.GetWorkAreaByProjectList(this.CurrUser.LoginProjectId);
                //this.drpWorkAreaId.DataBind();
                //Funs.FineUIPleaseSelect(this.drpWorkAreaId);
                this.drpUnitId.DataValueField = "UnitId";
                this.drpUnitId.DataTextField  = "UnitName";
                BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
                BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.CurrUser.LoginProjectId, true);
                this.AccidentReportOtherId     = Request.Params["AccidentReportOtherId"];
                this.txtEconomicLoss.Text      = "0";
                this.txtEconomicOtherLoss.Text = "0";
                if (!string.IsNullOrEmpty(this.AccidentReportOtherId))
                {
                    Model.Accident_AccidentReportOther accidentReportOther = BLL.AccidentReportOtherService.GetAccidentReportOtherById(this.AccidentReportOtherId);
                    if (accidentReportOther != null)
                    {
                        this.txtAccidentReportOtherCode.Text = accidentReportOther.AccidentReportOtherCode;
                        this.txtAccidentReportOtherName.Text = accidentReportOther.AccidentReportOtherName;
                        if (!string.IsNullOrEmpty(accidentReportOther.AccidentTypeId))
                        {
                            this.drpAccidentTypeId.SelectedValue = accidentReportOther.AccidentTypeId;
                        }
                        this.txtAbstract.Text = accidentReportOther.Abstract;
                        if (accidentReportOther.AccidentDate != null)
                        {
                            this.txtAccidentDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.AccidentDate);
                        }
                        this.txtWorkArea.Text = accidentReportOther.WorkArea;
                        if (accidentReportOther.PeopleNum != null)
                        {
                            this.txtPeopleNum.Text = Convert.ToString(accidentReportOther.PeopleNum);
                        }
                        if (!string.IsNullOrEmpty(accidentReportOther.UnitId))
                        {
                            this.drpUnitId.SelectedValue = accidentReportOther.UnitId;
                        }

                        if (accidentReportOther.EconomicLoss != null)
                        {
                            this.txtEconomicLoss.Text = Convert.ToString(accidentReportOther.EconomicLoss);
                        }
                        if (accidentReportOther.EconomicOtherLoss != null)
                        {
                            this.txtEconomicOtherLoss.Text = Convert.ToString(accidentReportOther.EconomicOtherLoss);
                        }
                        this.txtReportMan.Text    = accidentReportOther.ReportMan;
                        this.txtReporterUnit.Text = accidentReportOther.ReporterUnit;
                        if (accidentReportOther.ReportDate != null)
                        {
                            this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.ReportDate);
                        }
                        this.txtProcessDescription.Text   = accidentReportOther.ProcessDescription;
                        this.txtEmergencyMeasures.Text    = accidentReportOther.EmergencyMeasures;
                        this.txtImmediateCause.Text       = accidentReportOther.ImmediateCause;
                        this.txtIndirectReason.Text       = accidentReportOther.IndirectReason;
                        this.txtCorrectivePreventive.Text = accidentReportOther.CorrectivePreventive;
                        if (!string.IsNullOrEmpty(accidentReportOther.CompileMan))
                        {
                            this.drpCompileMan.SelectedValue = accidentReportOther.CompileMan;
                        }
                        if (accidentReportOther.CompileDate != null)
                        {
                            this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", accidentReportOther.CompileDate);
                        }
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(accidentReportOther.FileContent);
                    }
                    BindGrid();
                }
                else
                {
                    this.txtAccidentReportOtherCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectAccidentReportOtherMenuId, this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
                    var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectAccidentReportOtherMenuId, this.CurrUser.LoginProjectId);
                    if (codeTemplateRule != null)
                    {
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template);
                    }
                    this.drpCompileMan.SelectedValue = this.CurrUser.UserId;
                    this.txtCompileDate.Text         = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId    = BLL.Const.ProjectAccidentReportOtherMenuId;
                this.ctlAuditFlow.DataId    = this.AccidentReportOtherId;
                this.ctlAuditFlow.ProjectId = this.CurrUser.LoginProjectId;
            }
        }