报表修改
This commit is contained in:
@@ -82,7 +82,7 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnUpdata.Hidden = true;
|
||||
//this.btnUpdata.Hidden = true;
|
||||
}
|
||||
drpMonth.SelectedValue = report.Month.ToString();
|
||||
drpYear.SelectedValue = report.Year.ToString();
|
||||
@@ -329,6 +329,7 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
string code = CNCECHSSEWebService.UpMillionsMonthlyReport(report.MillionsMonthlyReportId, this.CurrUser);
|
||||
if (code == "1")
|
||||
{
|
||||
//WorkflowTodoitemsService.DoneWorkflow_TodoItems(report.MillionsMonthlyReportId, this.CurrUser.UserId);//完成当前人待办
|
||||
ShowNotify("同步成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
@@ -348,21 +349,100 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=MillionsMonthlyReport&Id={0}", report.MillionsMonthlyReportId, "编辑 - ")));
|
||||
}
|
||||
else if (type == "add")
|
||||
{
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("add");
|
||||
string err = AuditData();
|
||||
if (string.IsNullOrEmpty(err))
|
||||
{
|
||||
Save("add");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(err, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("updata");
|
||||
string err = AuditData();
|
||||
if (string.IsNullOrEmpty(err))
|
||||
{
|
||||
Save("updata");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(err, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("submit");
|
||||
string err = AuditData();
|
||||
if (string.IsNullOrEmpty(err))
|
||||
{
|
||||
Save("submit");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(err, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private string AuditData()
|
||||
{
|
||||
string err = string.Empty;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var reports = from x in db.Information_MillionsMonthlyReport
|
||||
where x.FillingDate < DateTime.Now
|
||||
orderby x.FillingDate descending
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(this.MillionsMonthlyReportId))
|
||||
{
|
||||
reports = from x in reports
|
||||
where x.MillionsMonthlyReportId != this.MillionsMonthlyReportId
|
||||
orderby x.FillingDate descending
|
||||
select x;
|
||||
}
|
||||
var reportIds = reports.Select(x => x.MillionsMonthlyReportId).Take(3).ToList();
|
||||
//var items = from x in db.Information_MillionsMonthlyReportItem
|
||||
// where reportIds.Contains(x.MillionsMonthlyReportId)
|
||||
// select new { x.Name, x.TotalWorkNum };
|
||||
var items = from x in db.Information_MillionsMonthlyReportItem
|
||||
where reportIds.Contains(x.MillionsMonthlyReportId)
|
||||
select new { x.Name, x.TotalWorkNum };
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
if (!string.IsNullOrEmpty(values["Name"].ToString()) && !string.IsNullOrEmpty(values["TotalWorkNum"].ToString()))
|
||||
{
|
||||
string name = values.Value<string>("Name");
|
||||
decimal d = values.Value<decimal>("TotalWorkNum");
|
||||
var list = items.Where(x => x.Name == name);
|
||||
decimal a = 0;
|
||||
if (list.Count() > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
a += item.TotalWorkNum ?? 0;
|
||||
}
|
||||
}
|
||||
decimal b = a / list.Count();
|
||||
if (d > b * 5)
|
||||
{
|
||||
err = name + "的总工时数超过前三个月平均值5倍,请核对后重新录入!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -813,10 +893,10 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
};
|
||||
items.Add(item2);
|
||||
var projects = (from x in Funs.DB.Base_Project
|
||||
where projectIds.Contains(x.ProjectId)
|
||||
where projectIds.Contains(x.ProjectId) && (x.IsDelete == null || x.IsDelete == false)
|
||||
select x).ToList();
|
||||
|
||||
if (this.CurrUser.UnitId == BLL.Const.UnitId_CWCEC)
|
||||
if (this.CurrUser.UnitId == CommonService.GetThisUnitId())
|
||||
{
|
||||
projects = BLL.ProjectService.GetProjectWorkList();
|
||||
}
|
||||
@@ -924,6 +1004,16 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
protected void drpDate_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
items.Clear();
|
||||
GetNewItems(drpYear.SelectedValue, drpMonth.SelectedValue);
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
|
||||
Reference in New Issue
Block a user