增加因子,特性加点增加主芯截面

This commit is contained in:
2026-09-03 11:44:53 +08:00
parent f85e5baa8d
commit 5ef31cf4c2
47 changed files with 2736 additions and 549 deletions
+75 -165
View File
@@ -14,6 +14,7 @@ using GThinking.N_MODEL.Page;
using GThinking.N_MISPRO.Utility;
using GThinking.N_PUBLIC;
using GThinking.N_MODEL.Dialog;
using GThinking.N_CONTROL;
namespace GThinking.N_XLXSBJ
{
@@ -86,64 +87,41 @@ namespace GThinking.N_XLXSBJ
datWHSJ.Enabled = false;
# region 给调价因子控件设只读性
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy || ControlState == TControlState.ctsEdit)
{
txtTJYZ1.Enabled = false;
txtTJYZ2.Enabled = false;
txtTJYZ3.Enabled = false;
txtTJYZ4.Enabled = false;
txtTJYZ5.Enabled = false;
txtTJYZ6.Enabled = false;
txtTJYZ7.Enabled = false;
txtTJYZ8.Enabled = false;
txtTJYZ9.Enabled = false;
txtTJYZ10.Enabled = false;
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
for (int i = 0; i < sTJYZList.Length; i++)
// 1. 先禁用所有 txtTJYZ1 ~ txtTJYZ10
for (int i = 1; i <= 20; i++)
{
if (sTJYZList[i].StartsWith("JZ01|"))
gtNumTextBox txt = FindControl("txtTJYZ" + i) as gtNumTextBox;
if (txt != null)
{
txtTJYZ1.Enabled = true;
txt.Enabled = false;
}
else if (sTJYZList[i].StartsWith("JZ02|"))
}
// 2. 解析 TJYZList,启用匹配的控件
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
foreach (string item in sTJYZList)
{
// 检查格式:以 "JZ" + 两位数字 + "|" 开头
if (item.Length >= 5 && item.StartsWith("JZ") && char.IsDigit(item[2]) && char.IsDigit(item[3]) && item[4] == '|')
{
txtTJYZ2.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ03|"))
{
txtTJYZ3.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ04|"))
{
txtTJYZ4.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ05|"))
{
txtTJYZ5.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ06|"))
{
txtTJYZ6.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ07|"))
{
txtTJYZ7.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ08|"))
{
txtTJYZ8.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ09|"))
{
txtTJYZ9.Enabled = true;
}
else if (sTJYZList[i].StartsWith("JZ10|"))
{
txtTJYZ10.Enabled = true;
string numStr = item.Substring(2, 2); // 提取 "01" ~ "10"
int index;
if (int.TryParse(numStr, out index))
{
// 注意控件ID不带前导零,如 "txtTJYZ1"
gtNumTextBox txt = FindControl("txtTJYZ" + index) as gtNumTextBox;
if (txt != null)
{
txt.Enabled = true;
}
}
}
}
}
#endregion
}
@@ -192,26 +170,21 @@ namespace GThinking.N_XLXSBJ
double dYZZ = CMISproConvert.StrToFloat(ds.Tables[0].Rows[i]["XLXSJGBYZZ3_YZZ"].ToString().Trim());
if (PageParam.GetRTrimString("TJYZList").Contains(sYZID + "|"))
{
if (sYZID.Equals("JZ01"))
txtTJYZ1.Value = dYZZ;
else if (sYZID.Equals("JZ02"))
txtTJYZ2.Value = dYZZ;
else if (sYZID.Equals("JZ03"))
txtTJYZ3.Value = dYZZ;
else if (sYZID.Equals("JZ04"))
txtTJYZ4.Value = dYZZ;
else if (sYZID.Equals("JZ05"))
txtTJYZ5.Value = dYZZ;
else if (sYZID.Equals("JZ06"))
txtTJYZ6.Value = dYZZ;
else if (sYZID.Equals("JZ07"))
txtTJYZ7.Value = dYZZ;
else if (sYZID.Equals("JZ08"))
txtTJYZ8.Value = dYZZ;
else if (sYZID.Equals("JZ09"))
txtTJYZ9.Value = dYZZ;
else if (sYZID.Equals("JZ10"))
txtTJYZ10.Value = dYZZ;
if (sYZID.StartsWith("JZ") && sYZID.Length == 4) // 确保格式为 "JZ01" ~ "JZ10"
{
string numStr = sYZID.Substring(2, 2); // 提取 "01" ~ "10"
int index;
if (int.TryParse(numStr, out index) )
{
// 注意控件ID不带前导零,如 "txtTJYZ1"
gtNumTextBox txt = FindControl("txtTJYZ" + index) as gtNumTextBox;
if (txt != null)
{
txt.Value = dYZZ;
}
}
}
}
}
#endregion
@@ -306,65 +279,24 @@ namespace GThinking.N_XLXSBJ
sql.ParamByName("pWHRID").Value = tSession.UserId;
sql.ParamByName("pWHSJ").Value = tNow;
if (sTJYZList[i].StartsWith("JZ01|"))
string item = sTJYZList[i];
// 检查是否以 "JZ" + 两位数字 + "|" 开头
if (item.Length >= 5 && item.StartsWith("JZ") && char.IsDigit(item[2]) && char.IsDigit(item[3]) && item[4] == '|')
{
sql.ParamByName("pYZID").Value = "JZ01";
sql.ParamByName("pYZZ").Value = txtTJYZ1.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ02|"))
{
sql.ParamByName("pYZID").Value = "JZ02";
sql.ParamByName("pYZZ").Value = txtTJYZ2.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ03|"))
{
sql.ParamByName("pYZID").Value = "JZ03";
sql.ParamByName("pYZZ").Value = txtTJYZ3.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ04|"))
{
sql.ParamByName("pYZID").Value = "JZ04";
sql.ParamByName("pYZZ").Value = txtTJYZ4.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ05|"))
{
sql.ParamByName("pYZID").Value = "JZ05";
sql.ParamByName("pYZZ").Value = txtTJYZ5.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ06|"))
{
sql.ParamByName("pYZID").Value = "JZ06";
sql.ParamByName("pYZZ").Value = txtTJYZ6.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ07|"))
{
sql.ParamByName("pYZID").Value = "JZ07";
sql.ParamByName("pYZZ").Value = txtTJYZ7.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ08|"))
{
sql.ParamByName("pYZID").Value = "JZ08";
sql.ParamByName("pYZZ").Value = txtTJYZ8.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ09|"))
{
sql.ParamByName("pYZID").Value = "JZ09";
sql.ParamByName("pYZZ").Value = txtTJYZ9.Value;
dberp.ExecSQL(sql);
}
else if (sTJYZList[i].StartsWith("JZ10|"))
{
sql.ParamByName("pYZID").Value = "JZ10";
sql.ParamByName("pYZZ").Value = txtTJYZ10.Value;
dberp.ExecSQL(sql);
string numStr = item.Substring(2, 2); // 提取 "01" ~ "10"
int index;
if (int.TryParse(numStr, out index) )
{
// 动态构造控件ID(不带前导零)
gtNumTextBox txt = FindControl("txtTJYZ" + index) as gtNumTextBox;
if (txt != null)
{
sql.ParamByName("pYZID").Value = "JZ" + numStr; // 保持 "JZ01" 格式
sql.ParamByName("pYZZ").Value = txt.Value;
dberp.ExecSQL(sql);
}
}
}
}
#endregion
@@ -404,45 +336,23 @@ namespace GThinking.N_XLXSBJ
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
for (int i = 0; i < sTJYZList.Length; i++)
{
if (sTJYZList[i].StartsWith("JZ01|"))
string item = sTJYZList[i];
// 检查格式:以 "JZ" + 两位数字 + "|" 开头
if (item.Length >= 5 && item.StartsWith("JZ") && char.IsDigit(item[2]) && char.IsDigit(item[3]) && item[4] == '|')
{
lblTJYZ1.Text = sTJYZList[i].Replace("JZ01|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ02|"))
{
lblTJYZ2.Text = sTJYZList[i].Replace("JZ02|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ03|"))
{
lblTJYZ3.Text = sTJYZList[i].Replace("JZ03|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ04|"))
{
lblTJYZ4.Text = sTJYZList[i].Replace("JZ04|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ05|"))
{
lblTJYZ5.Text = sTJYZList[i].Replace("JZ05|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ06|"))
{
lblTJYZ6.Text = sTJYZList[i].Replace("JZ06|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ07|"))
{
lblTJYZ7.Text = sTJYZList[i].Replace("JZ07|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ08|"))
{
lblTJYZ8.Text = sTJYZList[i].Replace("JZ08|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ09|"))
{
lblTJYZ9.Text = sTJYZList[i].Replace("JZ09|", "") + ":";
}
else if (sTJYZList[i].StartsWith("JZ10|"))
{
lblTJYZ10.Text = sTJYZList[i].Replace("JZ10|", "") + ":";
string numStr = item.Substring(2, 2); // 提取 "01" ~ "10"
int index;
if (int.TryParse(numStr, out index))
{
// 动态构造控件ID(不带前导零)
gtLabel lbl = FindControl("lblTJYZ" + index) as gtLabel;
if (lbl != null)
{
// 去掉 "JZxx|" 前缀,加上 ":"
lbl.Text = item.Substring(5) + ":";
}
}
}
}
}