This commit is contained in:
2026-03-24 17:43:52 +08:00
parent d36cec32ea
commit 2b9435744a
8 changed files with 126 additions and 21 deletions
@@ -55,7 +55,6 @@ namespace FineUIPro.Web.CQMS.Check
Model.Check_RewardAndPunish RewardAndPunish = BLL.RewardAndPunishService.GetRewardAndPunishById(RewardAndPunishID);
if (RewardAndPunish != null)
{
//this.CurrUser.LoginProjectId = RewardAndPunish.ProjectId;
this.drpRewardAndPunishType.SelectedValue = RewardAndPunish.RewardAndPunishType;
@@ -169,7 +168,19 @@ namespace FineUIPro.Web.CQMS.Check
RewardAndPunish.Type = int.Parse(this.drpType.SelectedValue);
RewardAndPunish.ResponseUnit = this.drpResponseUnit.SelectedValue;
// RewardAndPunish.NoticeUnit = this.drpNoticeUnit.SelectedValue;
RewardAndPunish.Money = Decimal.Parse(this.txtMoney.Text);
if (!string.IsNullOrWhiteSpace(this.txtMoney.Text))
{
decimal moneyValue;
if (decimal.TryParse(this.txtMoney.Text.Trim(), out moneyValue))
{
RewardAndPunish.Money = moneyValue;
}
else
{
Alert.ShowInTop("金额必须为有效数字!", MessageBoxIcon.Warning);
return;
}
}
RewardAndPunish.Date = Convert.ToDateTime(this.dpDate.Text.Trim());
RewardAndPunish.Description = this.txtDescription.Text;
RewardAndPunish.CreateMan = this.CurrUser.UserId;
@@ -231,17 +242,36 @@ namespace FineUIPro.Web.CQMS.Check
{
if (this.drpType.SelectedValue == "1")
{
this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
"Check_RewardAndPunish", "RewardAndPunishCode", $"JL");
// this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
// "Check_RewardAndPunish", "RewardAndPunishCode", $"JL");
this.txtRewardAndPunishCode.Text = BLL.RewardAndPunishService.getCode(SysTemType,"JL");
}
else
{
this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
"Check_RewardAndPunish", "RewardAndPunishCode", $"CF");
// this.txtRewardAndPunishCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5",
// "Check_RewardAndPunish", "RewardAndPunishCode", $"CF");
this.txtRewardAndPunishCode.Text = BLL.RewardAndPunishService.getCode(SysTemType,"CF");
}
drpRewardAndPunishType_Click(sender, e);
}
protected void getCode(string type)
{
var maxCode = Funs.DB.Check_RewardAndPunish
.Where(x => x.SysTemType == SysTemType && x.RewardAndPunishCode.Contains(type))
.Max(x => x.RewardAndPunishCode);
if (maxCode != null)
{
//取最后5 位
var code = maxCode.Substring(maxCode.Length - 5);
var codeNum = int.Parse(code);
codeNum++;
this.txtRewardAndPunishCode.Text = $"{type}{codeNum:D5}";
}
else
{
this.txtRewardAndPunishCode.Text = $"{type}00001";
}
}
protected void drpRewardAndPunishType_Click(object sender, EventArgs e)
{