protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestTool.RequestInt("id", 0);
            if (id == 0)
            {
                if (!EX_Admin.Power("supplier_money_add", "添加商家资金"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("supplier_money_edit", "编辑商家资金"))
                {
                    WindowNoPower();
                }
            }
            int user_id = RequestTool.RequestInt("user_id", 0);

            model = B_Lebi_Supplier_Money.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Supplier_Money();
                model.Type_id_MoneyStatus       = 181; //有效资金
                model.Type_id_SupplierMoneyType = 344; //人工调整
                Money = "";
            }
            else
            {
                Money   = FormatMoney(model.Money, "Number");
                user_id = model.Supplier_id;
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_Supplier_Money model)
 {
     D_Lebi_Supplier_Money.Instance.Update(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_Supplier_Money model)
 {
     return(D_Lebi_Supplier_Money.Instance.Add(model));
 }
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_Supplier_Money SafeBindForm(Lebi_Supplier_Money model)
 {
     return(D_Lebi_Supplier_Money.Instance.SafeBindForm(model));
 }
Exemple #5
0
        /// <summary>
        /// 编辑商家资金
        /// </summary>
        public void Money_Edit()
        {
            int        id = RequestTool.RequestInt("id", 0);
            SearchUser su = new SearchUser(CurrentAdmin, CurrentLanguage.Code);

            if (id > 0)
            {
                if (!EX_Admin.Power("supplier_money_edit", "编辑商家资金"))
                {
                    AjaxNoPower();
                    return;
                }
                Lebi_Supplier_Money model = B_Lebi_Supplier_Money.GetModel(id);
                Lebi_Supplier       user  = B_Lebi_Supplier.GetModel(model.Supplier_id);


                if (user == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("商家账号不存在") + "\"}");
                    return;
                }
                model.Type_id_MoneyStatus       = RequestTool.RequestInt("Type_id_MoneyStatus", 0);
                model.Type_id_SupplierMoneyType = RequestTool.RequestInt("Type_id_SupplierMoneyType", 0);
                model.Admin_UserName            = CurrentAdmin.UserName;
                model.Admin_id    = CurrentAdmin.id;
                model.Remark      = RequestTool.RequestString("Remark");
                model.Time_Update = DateTime.Now;
                B_Lebi_Supplier_Money.Update(model);
                EX_Supplier.UpdateUserMoney(user);
                Log.Add("编辑商家资金", "Supplier_Money", id.ToString(), CurrentAdmin, user.UserName);
            }
            else
            {
                if (!EX_Admin.Power("supplier_money_add", "添加商家资金"))
                {
                    AjaxNoPower();
                    return;
                }
                string        Mode          = RequestTool.RequestString("mode");
                string        User_Name_To  = RequestTool.RequestString("User_Name_To");
                string        UserLevel_ids = RequestTool.RequestString("UserLevel_ids");
                string        User_ids      = RequestTool.RequestString("User_ids");
                string        UserName_ids  = RequestTool.RequestString("UserName_ids");
                Lebi_Supplier user          = B_Lebi_Supplier.GetModel("UserName = lbsql{'" + User_Name_To + "'}");
                if (user == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("商家账号不存在") + "\"}");
                    return;
                }
                Lebi_Supplier_Money model = new Lebi_Supplier_Money();
                Log.Add("添加商家资金", "Supplier_Money", id.ToString(), CurrentAdmin, User_Name_To + " ->" + RequestTool.RequestDecimal("Money", 0));
                model.Money = RequestTool.RequestDecimal("Money", 0);
                model.Type_id_MoneyStatus       = RequestTool.RequestInt("Type_id_MoneyStatus", 0);
                model.Type_id_SupplierMoneyType = RequestTool.RequestInt("Type_id_SupplierMoneyType", 0);
                model.Admin_UserName            = CurrentAdmin.UserName;
                model.Admin_id         = CurrentAdmin.id;
                model.Remark           = RequestTool.RequestString("Remark");
                model.Time_Update      = DateTime.Now;
                model.Supplier_id      = user.id;
                model.User_UserName    = user.UserName;
                model.Supplier_SubName = user.SubName;
                B_Lebi_Supplier_Money.Add(model);
                EX_Supplier.UpdateUserMoney(user);
            }
            string result = "{\"msg\":\"OK\"}";

            Response.Write(result);
        }