安全管理报表
This commit is contained in:
@@ -40,18 +40,28 @@ namespace FineUIPro.Web.ReportManage.SafeEnvBudget
|
||||
if (!IsPostBack)
|
||||
{
|
||||
///单位
|
||||
BLL.ProjectUnitService.InitUnitByProjectIdDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
|
||||
//BLL.ProjectUnitService.InitUnitByProjectIdDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
|
||||
UnitService.InitBranchUnitDropDownList(this.drpUnitId, true, true);
|
||||
if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true)
|
||||
{
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnitId.Readonly = true;
|
||||
}
|
||||
|
||||
this.DataId = Request.Params["dataId"];
|
||||
if (!string.IsNullOrEmpty(this.DataId))
|
||||
{
|
||||
var data = BLL.SafetyManagementDataService.GetSafetyManagementDataById(this.DataId);
|
||||
if (data != null)
|
||||
{
|
||||
txtReportDate.Text = data.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.ReportDate) : "";
|
||||
if (!string.IsNullOrEmpty(data.UnitId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = data.UnitId;
|
||||
this.drpUnitId.Readonly = true;
|
||||
}
|
||||
txtReportDate.Text = data.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.ReportDate) : "";
|
||||
this.txtReportDate.Readonly = true;
|
||||
|
||||
txtConAndEPCCount.Text = data.ConAndEPCCount.HasValue ? data.ConAndEPCCount.ToString() : "";
|
||||
txtSurveyAndDesignCount.Text = data.SurveyAndDesignCount.HasValue ? data.SurveyAndDesignCount.ToString() : "";
|
||||
txtWorkingHours.Text = data.WorkingHours.HasValue ? data.WorkingHours.ToString() : "";
|
||||
@@ -157,16 +167,20 @@ namespace FineUIPro.Web.ReportManage.SafeEnvBudget
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
DateTime? reportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
|
||||
var data = BLL.SafetyManagementDataService.GetSafetyManagementDataByReportDate(this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, reportDate);
|
||||
if (data != null)
|
||||
if (string.IsNullOrEmpty(this.DataId))
|
||||
{
|
||||
Alert.ShowInTop("本月安全管理数据已上报!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpUnitId.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpUnitId.SelectedValue))
|
||||
{
|
||||
Alert.ShowInTop("请选择单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
var data = BLL.SafetyManagementDataService.GetSafetyManagementDataByReportDate(this.drpUnitId.SelectedValue, reportDate);
|
||||
//var data = BLL.SafetyManagementDataService.GetSafetyManagementDataByReportDate(this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, reportDate);
|
||||
if (data != null)
|
||||
{
|
||||
Alert.ShowInTop("本月安全管理数据已上报!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpUnitId.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpUnitId.SelectedValue))
|
||||
{
|
||||
Alert.ShowInTop("请选择单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Model.SafetyManagementData newData = new Model.SafetyManagementData();
|
||||
newData.UnitId = this.drpUnitId.SelectedValue;
|
||||
|
||||
Reference in New Issue
Block a user