615 lines
35 KiB
C#
615 lines
35 KiB
C#
using BLL;
|
|
using Model;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web.Services;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace FineUIPro.Web.ZHGL.Information
|
|
{
|
|
public partial class DCGLKeyProjectRectificationSituationLedgerSave : PageBase
|
|
{
|
|
#region 定义变量
|
|
/// <summary>
|
|
/// 报表主键Id
|
|
/// </summary>
|
|
public string Id
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["Id"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["Id"] = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.GetButtonPower();
|
|
//BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false);
|
|
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
|
|
//是否制定自查整治方案
|
|
BLL.ConstValue.InitConstValueRadioButtonList(this.rblHasPlan, ConstValue.Group_0001, "False");
|
|
//是否成立工作专班
|
|
BLL.ConstValue.InitConstValueRadioButtonList(this.rblHasWorkTeam, ConstValue.Group_0001, "False");
|
|
this.drpUnit.DataTextField = "UnitName";
|
|
this.drpUnit.DataValueField = "UnitId";
|
|
this.drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
|
|
this.drpUnit.DataBind();
|
|
this.drpUnit.Readonly = true;
|
|
string unitId = Request.QueryString["UnitId"];
|
|
string year = Request.QueryString["Year"];
|
|
this.Id = Request.QueryString["Id"];
|
|
|
|
if (!string.IsNullOrEmpty(this.Id))
|
|
{
|
|
var report = BLL.DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerById(Id);
|
|
if (report != null)
|
|
{
|
|
this.btnSave.Hidden = true;
|
|
this.btnSubmit.Hidden = true;
|
|
//this.btnCopy.Hidden = true;
|
|
if (report.HandleState == BLL.Const.HandleState_4)
|
|
{
|
|
this.btnUpdata.Hidden = false;
|
|
}
|
|
else
|
|
{
|
|
if (report.HandleMan == this.CurrUser.UserId || this.CurrUser.UserId == BLL.Const.sysglyId)
|
|
{
|
|
this.btnSave.Hidden = false;
|
|
this.btnSubmit.Hidden = false;
|
|
}
|
|
}
|
|
if (report.UpState == BLL.Const.UpState_3)
|
|
{
|
|
this.btnSave.Hidden = true;
|
|
this.btnUpdata.Hidden = true;
|
|
}
|
|
//drpMonth.SelectedValue = report.Month.ToString();
|
|
drpYear.SelectedValue = report.Year.ToString();
|
|
drpUnit.SelectedValue = report.UnitId;
|
|
if (report.CompileDate != null)
|
|
{
|
|
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", report.CompileDate);
|
|
}
|
|
this.txtDutyPerson.Text = report.DutyPerson;
|
|
this.rblHasPlan.SelectedValue = report.HasPlan ? "True" : "False";
|
|
if (report.PlanDate != null)
|
|
{
|
|
this.txtPlanDate.Text = string.Format("{0:yyyy-MM-dd}", report.PlanDate);
|
|
}
|
|
this.rblHasWorkTeam.SelectedValue = report.HasWorkTeam ? "True" : "False";
|
|
if (report.TeamDate != null)
|
|
{
|
|
this.txtTeamDate.Text = string.Format("{0:yyyy-MM-dd}", report.TeamDate);
|
|
}
|
|
this.txtKeyProjectNum.Text = report.KeyProjectNum.ToString();
|
|
this.txtRemark.Text = report.Remark;
|
|
|
|
this.txtStockCompanyKeyProjectCheckNum.Text = report.StockCompanyKeyProjectCheckNum.ToString();
|
|
this.txtStockCompanyKeyProjectProblemNum.Text = report.StockCompanyKeyProjectProblemNum.ToString();
|
|
this.txtStockCompanyKeyProjectProblemRectifiedNum.Text = report.StockCompanyKeyProjectProblemRectifiedNum.ToString();
|
|
|
|
this.txtStockCompanyOtherProjectCheckNum.Text = report.StockCompanyOtherProjectCheckNum.ToString();
|
|
this.txtStockCompanyOtherProjectProblemNum.Text = report.StockCompanyOtherProjectProblemNum.ToString();
|
|
this.txtStockCompanyOtherProjectProblemRectifiedNum.Text = report.StockCompanyOtherProjectProblemRectifiedNum.ToString();
|
|
|
|
this.txtBranchCompanyKeyProjectCheckNum.Text = report.BranchCompanyKeyProjectCheckNum.ToString();
|
|
this.txtBranchCompanyKeyProjectProblemNum.Text = report.BranchCompanyKeyProjectProblemNum.ToString();
|
|
this.txtBranchCompanyKeyProjectProblemRectifiedNum.Text = report.BranchCompanyKeyProjectProblemRectifiedNum.ToString();
|
|
|
|
this.txtBranchCompanyOtherProjectCheckNum.Text = report.BranchCompanyOtherProjectCheckNum.ToString();
|
|
this.txtBranchCompanyOtherProjectProblemNum.Text = report.BranchCompanyOtherProjectProblemNum.ToString();
|
|
this.txtBranchCompanyOtherProjectProblemRectifiedNum.Text = report.BranchCompanyOtherProjectProblemRectifiedNum.ToString();
|
|
|
|
this.txtProjectSelfCheckNum.Text = report.ProjectSelfCheckNum.ToString();
|
|
this.txtProjectSelfCheckProblemNum.Text = report.ProjectSelfCheckProblemNum.ToString();
|
|
this.txtProjectSelfCheckProblemRectifiedNum.Text = report.ProjectSelfCheckProblemRectifiedNum.ToString();
|
|
|
|
this.txtKeyProjectProblemNumType1.Text = report.KeyProjectProblemNumType1.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType1.Text = report.KeyProjectProblemRectifiedNumType1.ToString();
|
|
this.txtKeyProjectProblemNumType2.Text = report.KeyProjectProblemNumType2.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType2.Text = report.KeyProjectProblemRectifiedNumType2.ToString();
|
|
this.txtKeyProjectProblemNumType3.Text = report.KeyProjectProblemNumType3.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType3.Text = report.KeyProjectProblemRectifiedNumType3.ToString();
|
|
this.txtKeyProjectProblemNumType4.Text = report.KeyProjectProblemNumType4.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType4.Text = report.KeyProjectProblemRectifiedNumType4.ToString();
|
|
this.txtKeyProjectProblemNumType5.Text = report.KeyProjectProblemNumType5.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType5.Text = report.KeyProjectProblemRectifiedNumType5.ToString();
|
|
this.txtKeyProjectProblemNumType6.Text = report.KeyProjectProblemNumType6.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType6.Text = report.KeyProjectProblemRectifiedNumType6.ToString();
|
|
this.txtKeyProjectProblemNumType7.Text = report.KeyProjectProblemNumType7.ToString();
|
|
this.txtKeyProjectProblemRectifiedNumType7.Text = report.KeyProjectProblemRectifiedNumType7.ToString();
|
|
|
|
this.txtOtherProjectProblemNumType1.Text = report.OtherProjectProblemNumType1.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType1.Text = report.OtherProjectProblemRectifiedNumType1.ToString();
|
|
this.txtOtherProjectProblemNumType2.Text = report.OtherProjectProblemNumType2.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType2.Text = report.OtherProjectProblemRectifiedNumType2.ToString();
|
|
this.txtOtherProjectProblemNumType3.Text = report.OtherProjectProblemNumType3.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType3.Text = report.OtherProjectProblemRectifiedNumType3.ToString();
|
|
this.txtOtherProjectProblemNumType4.Text = report.OtherProjectProblemNumType4.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType4.Text = report.OtherProjectProblemRectifiedNumType4.ToString();
|
|
this.txtOtherProjectProblemNumType5.Text = report.OtherProjectProblemNumType5.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType5.Text = report.OtherProjectProblemRectifiedNumType5.ToString();
|
|
this.txtOtherProjectProblemNumType6.Text = report.OtherProjectProblemNumType6.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType6.Text = report.OtherProjectProblemRectifiedNumType6.ToString();
|
|
this.txtOtherProjectProblemNumType7.Text = report.OtherProjectProblemNumType7.ToString();
|
|
this.txtOtherProjectProblemRectifiedNumType7.Text = report.OtherProjectProblemRectifiedNumType7.ToString();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//this.btnCopy.Hidden = false;
|
|
//drpMonth.SelectedValue = months;
|
|
drpYear.SelectedValue = year;
|
|
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
|
this.txtDutyPerson.Text = this.CurrUser.UserName;
|
|
|
|
|
|
//this.txtRecordableIncidentRate.Text = "0";
|
|
//this.txtLostTimeRate.Text = "0";
|
|
//this.txtLostTimeInjuryRate.Text = "0";
|
|
//this.txtDeathAccidentFrequency.Text = "0";
|
|
//this.txtAccidentMortality.Text = "0";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 关闭窗口
|
|
/// <summary>
|
|
/// 关闭窗口
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
Model.DCGL_Report_KeyProjectRectificationSituationLedger report = BLL.DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerById(Id);
|
|
if (report.HandleMan == this.CurrUser.UserId)
|
|
{
|
|
this.btnSave.Hidden = false;
|
|
this.btnSubmit.Hidden = false;
|
|
}
|
|
else
|
|
{
|
|
this.btnSave.Hidden = true;
|
|
this.btnSubmit.Hidden = true;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 保存、提交、上报
|
|
/// <summary>
|
|
/// 保存数据
|
|
/// </summary>
|
|
/// <param name="type"></param>
|
|
private void Save(string type)
|
|
{
|
|
Model.DCGL_Report_KeyProjectRectificationSituationLedger report = new DCGL_Report_KeyProjectRectificationSituationLedger();
|
|
report.UnitId = drpUnit.SelectedValue;
|
|
report.Year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
|
|
report.HasPlan = this.rblHasPlan.SelectedValue == "True";
|
|
report.HasWorkTeam = this.rblHasWorkTeam.SelectedValue == "True";
|
|
if (!string.IsNullOrEmpty(txtPlanDate.Text.Trim()))
|
|
{
|
|
report.PlanDate = Convert.ToDateTime(txtPlanDate.Text.Trim());
|
|
}
|
|
if (!string.IsNullOrEmpty(txtTeamDate.Text.Trim()))
|
|
{
|
|
report.TeamDate = Convert.ToDateTime(txtTeamDate.Text.Trim());
|
|
}
|
|
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
|
{
|
|
report.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
|
|
}
|
|
report.DutyPerson = this.txtDutyPerson.Text.Trim();
|
|
report.Remark = this.txtRemark.Text.Trim();
|
|
|
|
report.KeyProjectNum = Funs.GetNewIntOrZero(this.txtKeyProjectNum.Text.Trim());
|
|
|
|
report.StockCompanyKeyProjectCheckNum = Funs.GetNewIntOrZero(this.txtStockCompanyKeyProjectCheckNum.Text.Trim());
|
|
report.StockCompanyKeyProjectProblemNum = Funs.GetNewIntOrZero(this.txtStockCompanyKeyProjectProblemNum.Text.Trim());
|
|
report.StockCompanyKeyProjectProblemRectifiedNum = Funs.GetNewIntOrZero(this.txtStockCompanyKeyProjectProblemRectifiedNum.Text.Trim());
|
|
|
|
report.StockCompanyOtherProjectCheckNum = Funs.GetNewIntOrZero(this.txtStockCompanyOtherProjectCheckNum.Text.Trim());
|
|
report.StockCompanyOtherProjectProblemNum = Funs.GetNewIntOrZero(this.txtStockCompanyOtherProjectProblemNum.Text.Trim());
|
|
report.StockCompanyOtherProjectProblemRectifiedNum = Funs.GetNewIntOrZero(this.txtStockCompanyOtherProjectProblemRectifiedNum.Text.Trim());
|
|
|
|
report.BranchCompanyKeyProjectCheckNum = Funs.GetNewIntOrZero(this.txtBranchCompanyKeyProjectCheckNum.Text.Trim());
|
|
report.BranchCompanyKeyProjectProblemNum = Funs.GetNewIntOrZero(this.txtBranchCompanyKeyProjectProblemNum.Text.Trim());
|
|
report.BranchCompanyKeyProjectProblemRectifiedNum = Funs.GetNewIntOrZero(this.txtBranchCompanyKeyProjectProblemRectifiedNum.Text.Trim());
|
|
|
|
report.BranchCompanyOtherProjectCheckNum = Funs.GetNewIntOrZero(this.txtBranchCompanyOtherProjectCheckNum.Text.Trim());
|
|
report.BranchCompanyOtherProjectProblemNum = Funs.GetNewIntOrZero(this.txtBranchCompanyOtherProjectProblemNum.Text.Trim());
|
|
report.BranchCompanyOtherProjectProblemRectifiedNum = Funs.GetNewIntOrZero(this.txtBranchCompanyOtherProjectProblemRectifiedNum.Text.Trim());
|
|
|
|
report.ProjectSelfCheckNum = Funs.GetNewIntOrZero(this.txtProjectSelfCheckNum.Text.Trim());
|
|
report.ProjectSelfCheckProblemNum = Funs.GetNewIntOrZero(this.txtProjectSelfCheckProblemNum.Text.Trim());
|
|
report.ProjectSelfCheckProblemRectifiedNum = Funs.GetNewIntOrZero(this.txtProjectSelfCheckProblemRectifiedNum.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType1 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType1.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType1 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType1.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType2 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType2.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType2 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType2.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType3 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType3.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType3 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType3.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType4 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType4.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType4 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType5.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType5 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType5.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType5 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType5.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType6 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType6.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType6 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType6.Text.Trim());
|
|
|
|
report.KeyProjectProblemNumType7 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemNumType7.Text.Trim());
|
|
report.KeyProjectProblemRectifiedNumType7 = Funs.GetNewIntOrZero(this.txtKeyProjectProblemRectifiedNumType7.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType1 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType1.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType1 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType1.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType2 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType2.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType2 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType2.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType3 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType3.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType3 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType3.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType4 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType4.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType4 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType4.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType5 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType5.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType5 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType5.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType6 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType6.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType6 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType6.Text.Trim());
|
|
|
|
report.OtherProjectProblemNumType7 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemNumType7.Text.Trim());
|
|
report.OtherProjectProblemRectifiedNumType7 = Funs.GetNewIntOrZero(this.txtOtherProjectProblemRectifiedNumType7.Text.Trim());
|
|
if (string.IsNullOrEmpty(Id))
|
|
{
|
|
DCGL_Report_KeyProjectRectificationSituationLedger old = DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue));
|
|
if (old == null)
|
|
{
|
|
report.Id = SQLHelper.GetNewID(typeof(Model.DCGL_Report_KeyProjectRectificationSituationLedger));
|
|
report.UpState = BLL.Const.UpState_2;
|
|
report.CompileManName = this.CurrUser.UserName;
|
|
report.CompileMan = this.CurrUser.UserId;
|
|
report.CompileDate = DateTime.Now;
|
|
report.HandleState = BLL.Const.HandleState_1;
|
|
report.HandleMan = this.CurrUser.UserId;
|
|
BLL.DCGL_KeyProjectRectificationSituationLedgerService.AddKeyProjectRectificationSituationLedger(report);
|
|
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString(), report.Id, BLL.Const.DCGLKeyProjectRectificationSituationLedgerMenuId, BLL.Const.BtnAdd);
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("该年份记录已存在!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Model.DCGL_Report_KeyProjectRectificationSituationLedger oldReport = BLL.DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerById(Id);
|
|
if (oldReport != null)
|
|
{
|
|
report.HandleMan = oldReport.HandleMan;
|
|
report.HandleState = oldReport.HandleState;
|
|
}
|
|
report.Id = Id;
|
|
report.UpState = BLL.Const.UpState_2;
|
|
BLL.DCGL_KeyProjectRectificationSituationLedgerService.UpdateKeyProjectRectificationSituationLedger(report);
|
|
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString(), report.Id, BLL.Const.DCGLKeyProjectRectificationSituationLedgerMenuId, BLL.Const.BtnModify);
|
|
}
|
|
Id = report.Id;
|
|
|
|
if (type == "updata") //数据同步
|
|
{
|
|
if (report.UpState == BLL.Const.UpState_2)
|
|
{
|
|
string code = CNCECHSSEWebService.UpKeyProjectRectificationSituationLedger(report.Id, this.CurrUser);
|
|
if (code == "1")
|
|
{
|
|
WorkflowTodoitemsService.DoneWorkflow_TodoItems(report.Id, this.CurrUser.UserId);//完成当前人待办
|
|
ShowNotify("同步成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
else if (type == "submit")
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=KeyProjectRectificationSituationLedger&Id={0}", report.Id, "编辑 - ")));
|
|
}
|
|
else if (type == "add")
|
|
{
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
return;
|
|
}
|
|
}
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
Save("add");
|
|
}
|
|
|
|
protected void btnUpdata_Click(object sender, EventArgs e)
|
|
{
|
|
Save("updata");
|
|
}
|
|
|
|
protected void btnSubmit_Click(object sender, EventArgs e)
|
|
{
|
|
Save("submit");
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 获取按钮权限
|
|
/// <summary>
|
|
/// 获取按钮权限
|
|
/// </summary>
|
|
/// <param name="button"></param>
|
|
/// <returns></returns>
|
|
private void GetButtonPower()
|
|
{
|
|
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DCGLKeyProjectRectificationSituationLedgerMenuId);
|
|
if (buttonList.Count() > 0)
|
|
{
|
|
if (buttonList.Contains(BLL.Const.BtnSave))
|
|
{
|
|
this.btnSave.Hidden = false;
|
|
//this.btnCopy.Hidden = false;
|
|
}
|
|
//if (buttonList.Contains(BLL.Const.BtnSaveUp))
|
|
//{
|
|
// this.btnUpdata.Hidden = false;
|
|
//}
|
|
if (buttonList.Contains(BLL.Const.BtnSubmit))
|
|
{
|
|
this.btnSubmit.Hidden = false;
|
|
//this.btnCopy.Hidden = false;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 复制上个月数据
|
|
/// <summary>
|
|
/// 复制上个月的数据
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnCopy_Click(object sender, EventArgs e)
|
|
{
|
|
//DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue);
|
|
//if (nowDate.HasValue)
|
|
//{
|
|
// DateTime showDate = new DateTime();
|
|
// showDate = nowDate.Value.AddMonths(-1);
|
|
// Model.DCGL_Report_KeyProjectRectificationSituationLedger report = BLL.DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerByUnitIdDate(this.drpUnit.SelectedValue, showDate.Year);
|
|
// if (report != null)
|
|
// {
|
|
// Model.DCGL_Report_KeyProjectRectificationSituationLedger newModel = new DCGL_Report_KeyProjectRectificationSituationLedger();
|
|
// this.Id = SQLHelper.GetNewID(typeof(Model.DCGL_Report_KeyProjectRectificationSituationLedger));
|
|
// newModel.Id = this.Id;
|
|
// newModel.UnitId = this.drpUnit.SelectedValue;
|
|
// newModel.Year = Convert.ToInt32(this.drpYear.SelectedValue);
|
|
// newModel.Month = Convert.ToInt32(this.drpMonth.SelectedValue);
|
|
// newModel.FillingMan = this.CurrUser.UserName;
|
|
// newModel.FillingDate = DateTime.Now;
|
|
// newModel.DutyPerson = this.CurrUser.UserName;
|
|
// newModel.RecordableIncidentRate = report.RecordableIncidentRate;
|
|
// newModel.LostTimeRate = report.LostTimeRate;
|
|
// newModel.LostTimeInjuryRate = report.LostTimeInjuryRate;
|
|
// newModel.DeathAccidentFrequency = report.DeathAccidentFrequency;
|
|
// newModel.AccidentMortality = report.AccidentMortality;
|
|
// newModel.UpState = BLL.Const.UpState_2;
|
|
// newModel.HandleState = BLL.Const.HandleState_1;
|
|
// newModel.HandleMan = this.CurrUser.UserId;
|
|
// newModel.InputCosts = report.InputCosts;
|
|
// newModel.TrainNum = report.TrainNum;
|
|
// newModel.GeneralHazardNum = report.GeneralHazardNum;
|
|
// newModel.MajorHazardNum = report.MajorHazardNum;
|
|
// newModel.NotProofLargeProjectNum = report.NotProofLargeProjectNum;
|
|
// newModel.ProofLargeProjectNum = report.ProofLargeProjectNum;
|
|
// newModel.FireLicenseNum = report.FireLicenseNum;
|
|
// newModel.LimitLicenseNum = report.LimitLicenseNum;
|
|
// newModel.HighLicenseNum = report.HighLicenseNum;
|
|
// newModel.HoistingLicenseNum = report.HoistingLicenseNum;
|
|
// newModel.BreakGroundLicenseNum = report.BreakGroundLicenseNum;
|
|
// newModel.ElectricityLicenseNum = report.ElectricityLicenseNum;
|
|
// newModel.RTLicenseNum = report.RTLicenseNum;
|
|
// newModel.NightLicenseNum = report.NightLicenseNum;
|
|
// newModel.CommissionerNum = report.CommissionerNum;
|
|
// newModel.SoleDutyNum = report.SoleDutyNum;
|
|
// BLL.DCGL_KeyProjectRectificationSituationLedgerService.AddMillionsMonthlyReport(newModel);
|
|
|
|
// items = BLL.MillionsMonthlyReportItemService.GetItems(report.Id);
|
|
// if (items.Count > 0)
|
|
// {
|
|
// foreach (var item in items)
|
|
// {
|
|
// if (item.Affiliation != "本月合计" || item.Name != "本月合计")
|
|
// {
|
|
// Model.Information_MillionsMonthlyReportItem newItem = new Information_MillionsMonthlyReportItem
|
|
// {
|
|
// MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
|
|
// Id = this.Id,
|
|
// SortIndex = item.SortIndex,
|
|
// Affiliation = item.Affiliation,
|
|
// Name = item.Name,
|
|
// PostPersonNum = item.PostPersonNum,
|
|
// SnapPersonNum = item.SnapPersonNum,
|
|
// ContractorNum = item.ContractorNum,
|
|
// SumPersonNum = item.SumPersonNum,
|
|
// TotalWorkNum = item.TotalWorkNum,
|
|
// SeriousInjuriesNum = item.SeriousInjuriesNum,
|
|
// SeriousInjuriesPersonNum = item.SeriousInjuriesPersonNum,
|
|
// SeriousInjuriesLossHour = item.SeriousInjuriesLossHour,
|
|
// MinorAccidentNum = item.MinorAccidentNum,
|
|
// MinorAccidentPersonNum = item.MinorAccidentPersonNum,
|
|
// MinorAccidentLossHour = item.MinorAccidentLossHour,
|
|
// DeathAccidentNum = item.DeathAccidentNum,
|
|
// DeathAccidentPersonNum = item.DeathAccidentPersonNum,
|
|
// DeathAccidentLossHour = item.DeathAccidentLossHour,
|
|
// RestrictedWorkPersonNum = item.RestrictedWorkPersonNum,
|
|
// RestrictedWorkLossHour = item.RestrictedWorkLossHour,
|
|
// MedicalTreatmentPersonNum = item.MedicalTreatmentPersonNum,
|
|
// MedicalTreatmentLossHour = item.MedicalTreatmentLossHour,
|
|
// FireNum = item.FireNum,
|
|
// EnvironmenNum = item.EnvironmenNum,
|
|
// TrafficNum = item.TrafficNum,
|
|
// EquipmentNum = item.EquipmentNum,
|
|
// QualityNum = item.QualityNum,
|
|
// OtherNum = item.OtherNum,
|
|
// FirstAidDressingsNum = item.FirstAidDressingsNum,
|
|
// AttemptedEventNum = item.AttemptedEventNum,
|
|
// LossDayNum = item.LossDayNum
|
|
// };
|
|
// BLL.MillionsMonthlyReportItemService.AddMillionsMonthlyReportItem(newItem);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// GetValues(newModel.Id);
|
|
// }
|
|
//}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取复制的值绑定到文本中
|
|
/// </summary>
|
|
private void GetValues(string Id)
|
|
{
|
|
var report = BLL.DCGL_KeyProjectRectificationSituationLedgerService.GetKeyProjectRectificationSituationLedgerById(Id);
|
|
//if (report != null)
|
|
//{
|
|
// drpMonth.SelectedValue = report.Month.ToString();
|
|
// drpYear.SelectedValue = report.Year.ToString();
|
|
// drpUnit.SelectedValue = report.UnitId;
|
|
// if (report.FillingDate != null)
|
|
// {
|
|
// txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate);
|
|
// }
|
|
// txtDutyPerson.Text = report.DutyPerson;
|
|
// if (report.RecordableIncidentRate != null)
|
|
// {
|
|
// txtRecordableIncidentRate.Text = report.RecordableIncidentRate.ToString();
|
|
// }
|
|
// if (report.LostTimeRate != null)
|
|
// {
|
|
// txtLostTimeRate.Text = report.LostTimeRate.ToString();
|
|
// }
|
|
// if (report.LostTimeInjuryRate != null)
|
|
// {
|
|
// txtLostTimeInjuryRate.Text = report.LostTimeInjuryRate.ToString();
|
|
// }
|
|
// if (report.DeathAccidentFrequency != null)
|
|
// {
|
|
// txtDeathAccidentFrequency.Text = report.DeathAccidentFrequency.ToString();
|
|
// }
|
|
// if (report.AccidentMortality != null)
|
|
// {
|
|
// txtAccidentMortality.Text = report.AccidentMortality.ToString();
|
|
// }
|
|
// if (report.InputCosts != null)
|
|
// {
|
|
// this.txtInputCosts.Text = Convert.ToString(report.InputCosts);
|
|
// }
|
|
// if (report.TrainNum != null)
|
|
// {
|
|
// this.txtTrainNum.Text = Convert.ToString(report.TrainNum);
|
|
// }
|
|
// if (report.GeneralHazardNum != null)
|
|
// {
|
|
// this.txtGeneralHazardNum.Text = Convert.ToString(report.GeneralHazardNum);
|
|
// }
|
|
// if (report.MajorHazardNum != null)
|
|
// {
|
|
// this.txtMajorHazardNum.Text = Convert.ToString(report.MajorHazardNum);
|
|
// }
|
|
// if (report.NotProofLargeProjectNum != null)
|
|
// {
|
|
// this.txtNotProofLargeProjectNum.Text = Convert.ToString(report.NotProofLargeProjectNum);
|
|
// }
|
|
// if (report.ProofLargeProjectNum != null)
|
|
// {
|
|
// this.txtProofLargeProjectNum.Text = Convert.ToString(report.ProofLargeProjectNum);
|
|
// }
|
|
// if (report.FireLicenseNum != null)
|
|
// {
|
|
// this.txtFireLicenseNum.Text = Convert.ToString(report.FireLicenseNum);
|
|
// }
|
|
// if (report.LimitLicenseNum != null)
|
|
// {
|
|
// this.txtLimitLicenseNum.Text = Convert.ToString(report.LimitLicenseNum);
|
|
// }
|
|
// if (report.HighLicenseNum != null)
|
|
// {
|
|
// this.txtHighLicenseNum.Text = Convert.ToString(report.HighLicenseNum);
|
|
// }
|
|
// if (report.HoistingLicenseNum != null)
|
|
// {
|
|
// this.txtHoistingLicenseNum.Text = Convert.ToString(report.HoistingLicenseNum);
|
|
// }
|
|
// if (report.BreakGroundLicenseNum != null)
|
|
// {
|
|
// this.txtBreakGroundLicenseNum.Text = Convert.ToString(report.BreakGroundLicenseNum);
|
|
// }
|
|
// if (report.ElectricityLicenseNum != null)
|
|
// {
|
|
// this.txtElectricityLicenseNum.Text = Convert.ToString(report.ElectricityLicenseNum);
|
|
// }
|
|
// if (report.RTLicenseNum != null)
|
|
// {
|
|
// this.txtRTLicenseNum.Text = Convert.ToString(report.RTLicenseNum);
|
|
// }
|
|
// if (report.NightLicenseNum != null)
|
|
// {
|
|
// this.txtNightLicenseNum.Text = Convert.ToString(report.NightLicenseNum);
|
|
// }
|
|
// if (report.CommissionerNum != null)
|
|
// {
|
|
// this.txtCommissionerNum.Text = Convert.ToString(report.CommissionerNum);
|
|
// }
|
|
// if (report.SoleDutyNum != null)
|
|
// {
|
|
// this.txtSoleDutyNum.Text = Convert.ToString(report.SoleDutyNum);
|
|
// }
|
|
// items = BLL.MillionsMonthlyReportItemService.GetItems(Id);
|
|
// this.Grid1.DataSource = items;
|
|
// this.Grid1.DataBind();
|
|
//}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
} |