报表修改
This commit is contained in:
@@ -80,14 +80,26 @@
|
||||
<Items>
|
||||
<f:Label ID="txtUnitName" runat="server" Hidden="true">
|
||||
</f:Label>
|
||||
<f:Label ID="txtQuarter" runat="server">
|
||||
<f:Label ID="txtQuarter" runat="server" LabelWidth="130px">
|
||||
</f:Label>
|
||||
<f:Label ID="txtCompileDate" runat="server">
|
||||
<f:Label ID="txtCompileDate" runat="server" LabelWidth="130px">
|
||||
</f:Label>
|
||||
<f:Label ID="lbHandleMan" runat="server">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server" Hidden="true">
|
||||
</f:Label>
|
||||
<f:Label ID="txtKeyWorkNum" runat="server" Label="重点工作任务数" LabelWidth="130px">
|
||||
</f:Label>
|
||||
<f:Label ID="txtKeyWorkOKNum" runat="server" Label="重点工作完成数" LabelWidth="130px">
|
||||
</f:Label>
|
||||
<f:Label ID="txtKeyWorkOKRate" runat="server" Label="综合完成率">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
|
||||
@@ -62,6 +62,9 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
txtUnitName.Text = string.Empty;
|
||||
txtQuarter.Text = string.Empty;
|
||||
txtCompileDate.Text = string.Empty;
|
||||
txtKeyWorkNum.Text = string.Empty;
|
||||
txtKeyWorkOKNum.Text = string.Empty;
|
||||
txtKeyWorkOKRate.Text = string.Empty;
|
||||
this.lbHandleMan.Text = string.Empty;
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
@@ -105,6 +108,18 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
this.ActionWorkLedgerId = report.ActionWorkLedgerId;
|
||||
txtUnitName.Text = "单位:" + report.UnitName;
|
||||
txtQuarter.Text = "季度:" + report.Quarters;
|
||||
if (report.KeyWorkNum != null)
|
||||
{
|
||||
txtKeyWorkNum.Text = report.KeyWorkNum.ToString();
|
||||
}
|
||||
if (report.KeyWorkOKNum != null)
|
||||
{
|
||||
txtKeyWorkOKNum.Text = report.KeyWorkOKNum.ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(report.KeyWorkOKRate))
|
||||
{
|
||||
txtKeyWorkOKRate.Text = report.KeyWorkOKRate;
|
||||
}
|
||||
if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.lbHandleMan.Hidden = true;
|
||||
|
||||
@@ -228,6 +228,42 @@ namespace FineUIPro.Web.ZHGL.Information {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtKeyWorkNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkOKNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtKeyWorkOKNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkOKRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtKeyWorkOKRate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" ID="txtKeyWorkNum" Label="重点工作任务数" NoDecimal="true" LabelWidth="130px" NoNegative="true" Required="true" ShowRedStar="true" AutoPostBack="true" OnTextChanged="txtKeyWorkNum_TextChanged"></f:NumberBox>
|
||||
<f:NumberBox runat="server" ID="txtKeyWorkOKNum" Label="重点工作完成数" NoDecimal="true" LabelWidth="130px" NoNegative="true" Required="true" ShowRedStar="true" AutoPostBack="true" OnTextChanged="txtKeyWorkNum_TextChanged"></f:NumberBox>
|
||||
<f:TextBox ID="txtKeyWorkOKRate" runat="server" Label="综合完成率" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
|
||||
@@ -99,6 +99,18 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
{
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ActionWorkLedger.ReportDate);
|
||||
}
|
||||
if (ActionWorkLedger.KeyWorkNum != null)
|
||||
{
|
||||
this.txtKeyWorkNum.Text = ActionWorkLedger.KeyWorkNum.ToString();
|
||||
}
|
||||
if (ActionWorkLedger.KeyWorkOKNum != null)
|
||||
{
|
||||
this.txtKeyWorkOKNum.Text = ActionWorkLedger.KeyWorkOKNum.ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ActionWorkLedger.KeyWorkOKRate))
|
||||
{
|
||||
this.txtKeyWorkOKRate.Text = ActionWorkLedger.KeyWorkOKRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -237,6 +249,9 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
}
|
||||
ActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
ActionWorkLedger.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
ActionWorkLedger.KeyWorkNum = Funs.GetNewIntOrZero(this.txtKeyWorkNum.Text.Trim());
|
||||
ActionWorkLedger.KeyWorkOKNum = Funs.GetNewIntOrZero(this.txtKeyWorkOKNum.Text.Trim());
|
||||
ActionWorkLedger.KeyWorkOKRate = this.txtKeyWorkOKRate.Text.Trim();
|
||||
if (string.IsNullOrEmpty(this.ActionWorkLedgerId))
|
||||
{
|
||||
this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger)); ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
|
||||
@@ -530,5 +545,17 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void txtKeyWorkNum_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
decimal keyWorkNum = Funs.GetNewDecimalOrZero(this.txtKeyWorkNum.Text.Trim());
|
||||
decimal keyWorkOKNum = Funs.GetNewDecimalOrZero(this.txtKeyWorkOKNum.Text.Trim());
|
||||
string rate = string.Empty;
|
||||
if (keyWorkNum > 0)
|
||||
{
|
||||
rate = (decimal.Round(keyWorkOKNum / keyWorkNum, 4) * 100).ToString("0.##") + "%";
|
||||
}
|
||||
this.txtKeyWorkOKRate.Text = rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,33 @@ namespace FineUIPro.Web.ZHGL.Information {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker dpkCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtKeyWorkNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkOKNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtKeyWorkOKNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtKeyWorkOKRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtKeyWorkOKRate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -359,17 +359,90 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
|
||||
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.SUBQHSEDB 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user