username@email.com
2025-05-14 99ddfbcecf0fa2881eb3a91028257eef87dab6de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
namespace CY.WebForm.Pages.sysglobal
{
    //吴辉
    //添加修改授信等级规则
    public partial class AddCreditLineLevelRule :  BasePage
    {
        Pay_CreditLineLevelRuleBLL bll_Pay_CreditLineLevelRuleBLL = null;
 
        //初始化
        public AddCreditLineLevelRule()
        {
            bll_Pay_CreditLineLevelRuleBLL = new Pay_CreditLineLevelRuleBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
            {
                //绑定下级授信等级
                List<Pay_CreditLineLevelRule> modellist = bll_Pay_CreditLineLevelRuleBLL.GetModelList().ToList();
                this.ddlNextLevelRule.DataSource = modellist;
                this.ddlNextLevelRule.DataValueField = "Keyid";
                this.ddlNextLevelRule.DataTextField = "LevelName";
                this.ddlNextLevelRule.DataBind();
                this.ddlNextLevelRule.Items.Insert(0, new ListItem("请选择", "-1"));
                this.LevelIconImg.Visible = false;
 
                if (Request["Keyid"].ToInt32() > 0)
                {
                    Pay_CreditLineLevelRule model = bll_Pay_CreditLineLevelRuleBLL.GetModel(Request["keyid"].ToInt32());
                    this.LevelName.Value = model.LevelName.ToString2();
                    this.MaxScore.Value = model.MaxScore.ToString2();
                    if (string.IsNullOrEmpty(model.LevelIcon.ToString2()))
                    {
                        this.LevelIconImg.Visible = false;
                    }
                    else
                    {
                        this.LevelIconImg.Visible = true;
                        this.LevelIconImg.Src = model.LevelIcon.ToString2();
                    }
                    this.Credit.Value = model.Credit.ToString2();
                    this.RebateProportion.Value = model.RebateProportion.ToString2();
                    this.Remark.Value = model.Remark.ToString2();
                    this.ddlNextLevelRule.SelectedValue = model.NextLevelRule.ToString2();
                }
 
            }
        }
 
        //提交表单
        protected void btn_Submit_Config(object sender, EventArgs e)
        {
            Pay_CreditLineLevelRule model = new Pay_CreditLineLevelRule();
 
            if (Request["Keyid"].ToInt32() > 0)
            {
                model = bll_Pay_CreditLineLevelRuleBLL.GetModel(Request["keyid"].ToInt32());
            }
            else
            {model = new Pay_CreditLineLevelRule();}
 
            //上传等级图标
            CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult1 = CY.WebForm.cs.UploadCS.Upload("LevelIcon", model.LevelIcon);
            if (_UpFileResult1.returnerror.Count == 0)
            {
                if (_UpFileResult1.returnfilename.Count > 0)
                {
                    model.LevelIcon = _UpFileResult1.returnfilename[0].ToString2();
                }
                else
                {
                    model.LevelIcon = model.LevelIcon ?? "";
                }
            }
            else
            {   model.LevelIcon = model.LevelIcon ?? "";
                JavaScript.MessageBox(string.Join("<br/>", (string[])_UpFileResult1.returnerror.ToArray(typeof(string))), this);
                return;
            }
 
 
            model.LevelName = this.LevelName.Value.ToString2();
            model.MaxScore = this.MaxScore.Value.ToInt32();
            model.NextLevelRule = this.ddlNextLevelRule.SelectedValue.ToInt32();
            model.Credit = this.Credit.Value.ToDecimal2();
            model.RebateProportion = this.RebateProportion.Value.ToDecimal2();
            model.Remark = this.Remark.Value.ToString2();
            model.Operator = CurrentUser.ShortName.ToString2();
            model.LastUpdateTime = DateTime.Now;
 
            if (Request["Keyid"].ToInt32() > 0)
            {
                bll_Pay_CreditLineLevelRuleBLL.UpdateModel(model);//更新信息
            }
            else
            {
                bll_Pay_CreditLineLevelRuleBLL.InsertModel(model);//添加信息
            }
            JavaScript.RefreshDIVOpener(this);
        }
    }
}