提交代码

This commit is contained in:
2024-10-30 17:15:30 +08:00
parent a2afd22163
commit 254c7ac7c0
24 changed files with 1527 additions and 828 deletions
@@ -1093,11 +1093,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 != 0)
{
this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 != 0)
{
this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4);
}
@@ -1105,11 +1105,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 != 0)
{
this.Grid1.Rows[16].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E22, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 != 0)
{
this.Grid1.Rows[16].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F22, 4);
}
@@ -1117,11 +1117,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[16].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 != 0)
{
this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 != 0)
{
this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4);
}
@@ -1129,11 +1129,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 != 0)
{
this.Grid1.Rows[20].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E26, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 != 0)
{
this.Grid1.Rows[20].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F26, 4);
}
@@ -1141,11 +1141,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[20].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 != 0)
{
this.Grid1.Rows[22].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E28, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 != 0)
{
this.Grid1.Rows[22].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F28, 4);
}
@@ -1153,11 +1153,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[22].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString()), 2).ToString() + "%";
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 != 0)
{
this.Grid1.Rows[36].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E42, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 > 0)
if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 != 0)
{
this.Grid1.Rows[36].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F42, 4);
}
@@ -1165,11 +1165,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[36].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString()), 2).ToString() + "%";
}
if (E64 > 0 && E65 > 0 && E20 > 0)
if (E64 != 0 && E65 != 0 && E20 != 0)
{
this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4);
}
if (F64 > 0 && F65 > 0 && F20 > 0)
if (F64 != 0 && F65 != 0 && F20 != 0)
{
this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4);
}
@@ -1265,6 +1265,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else if (code=="3")
{
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
@@ -1280,26 +1284,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSave_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
/* bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}*/
Save("add");
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@@ -1332,26 +1336,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSubmit_Click(object sender, EventArgs e)
{
//bool isEmpty = false;
//foreach (JObject mergedRow in Grid1.GetMergedData())
//{
// JObject values = mergedRow.Value<JObject>("values");
// int rowIndex = mergedRow.Value<int>("index");
// string sortIndex = values.Value<string>("SortIndex");
// if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
// {
// if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
// {
// isEmpty = true;
// break;
// }
// }
//}
//if (isEmpty)
//{
// ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
// return;
//}
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "18" || sortIndex == "37" || sortIndex == "38")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("submit");
}
#endregion