1
This commit is contained in:
@@ -9,14 +9,42 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
{
|
||||
public partial class ProjectArchitectureReport : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false);
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.InitDropDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) )
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
drpUnit.DataValueField = "UnitId";
|
||||
@@ -24,12 +52,29 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
drpUnit.DataBind();
|
||||
this.drpUnit.Readonly = true;
|
||||
////取上个报表时间
|
||||
DateTime showDate = System.DateTime.Now.AddMonths(-3);
|
||||
this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
DateTime showDate = System.DateTime.Now.AddMonths(-1);
|
||||
drpMonth.SelectedValue = showDate.Month.ToString();
|
||||
drpYear.SelectedValue = showDate.Year.ToString();
|
||||
GetValue();
|
||||
}
|
||||
}
|
||||
private void InitDropDownList()
|
||||
{
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false);
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
|
||||
}
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.GetButtonPower();
|
||||
this.InitDropDownList();
|
||||
this.GetValue();
|
||||
}
|
||||
|
||||
private void SetEmpty()
|
||||
{
|
||||
@@ -46,9 +91,13 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
#region 获取记录值
|
||||
private void GetValue()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
|
||||
int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue);
|
||||
Model.View_Environmental_ProjectArchitectureReport report = Funs.DB.View_Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.Quarters == Quarters && e.Year == year);
|
||||
int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue);
|
||||
Model.View_Environmental_ProjectArchitectureReport report = Funs.DB.View_Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == this.ProjectId && e.Month == month && e.Year == year);
|
||||
if (report != null)
|
||||
{
|
||||
string upState = string.Empty;
|
||||
@@ -60,7 +109,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
{
|
||||
upState = "(未上报)";
|
||||
}
|
||||
this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState;
|
||||
this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState;
|
||||
lbUnitName.Text = "填报企业:" + report.ProjectName;
|
||||
if (report.FillingDate != null)
|
||||
{
|
||||
@@ -162,7 +211,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ProjectArchitectureReportMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.PersonId, BLL.Const.ProjectArchitectureReportMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -179,13 +228,13 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
}
|
||||
}
|
||||
|
||||
var getReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
var getReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
this.btnAudit1.Hidden = true;
|
||||
this.btnAudit2.Hidden = true;
|
||||
if (getReport != null)
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
//if (getReport.HandleMan == this.CurrUser.PersonId) //当前人是下一步办理入
|
||||
//if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
|
||||
//{
|
||||
// if (getReport.HandleState == BLL.Const.HandleState_2)
|
||||
// {
|
||||
@@ -199,10 +248,16 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
// }
|
||||
// else if (getReport.HandleState == BLL.Const.HandleState_4)
|
||||
// {
|
||||
this.btnUpdata.Hidden = false;
|
||||
// this.btnUpdata.Hidden = false;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
btnEdit.Hidden = true;
|
||||
btnDelete.Hidden = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -214,7 +269,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -224,7 +279,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
|
||||
@@ -242,7 +297,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
|
||||
@@ -260,7 +315,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
|
||||
@@ -278,7 +333,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - ")));
|
||||
@@ -296,10 +351,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnDelete);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnDelete);
|
||||
BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId);
|
||||
BLL.ProjectArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId);
|
||||
BLL.ProjectArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId);
|
||||
@@ -342,7 +397,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString());
|
||||
if (report != null)
|
||||
{
|
||||
return report.Year + "年" + report.Quarters + "月";
|
||||
return report.Year + "年" + report.Month + "月";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
@@ -363,7 +418,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText);
|
||||
if (unit != null)
|
||||
{
|
||||
this.CurrUser.LoginProjectId = unit.UnitId;
|
||||
//this.CurrUser.LoginProjectId = unit.UnitId;.
|
||||
drpUnit.SelectedValue = unit.UnitId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +435,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void BtnBulletLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetQuartersChange("-");
|
||||
SetMonthChange("-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -389,30 +445,30 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void BulletRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetQuartersChange("+");
|
||||
SetMonthChange("+");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 月份加减变化
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SetQuartersChange(string type)
|
||||
private void SetMonthChange(string type)
|
||||
{
|
||||
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString());
|
||||
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue);
|
||||
if (nowDate.HasValue)
|
||||
{
|
||||
DateTime showDate = new DateTime();
|
||||
if (type == "+")
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(3);
|
||||
showDate = nowDate.Value.AddMonths(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(-3);
|
||||
showDate = nowDate.Value.AddMonths(-1);
|
||||
}
|
||||
|
||||
this.drpYear.SelectedValue = showDate.Year.ToString();
|
||||
this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
drpMonth.SelectedValue = showDate.Month.ToString();
|
||||
///值变化
|
||||
GetValue();
|
||||
}
|
||||
@@ -427,7 +483,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
||||
/// <param name="e"></param>
|
||||
protected void btnSee_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
|
||||
Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.ProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - ")));
|
||||
|
||||
Reference in New Issue
Block a user