コード例 #1
0
        /// <summary>
        /// 编辑贷款
        /// </summary>
        /// <param name="userFromCookie"></param>
        /// <param name="context"></param>
        private void EditLoan(DriveMgr.Model.User userFromCookie, HttpContext context)
        {
            if (userFromCookie != null && new DriveMgr.BLL.Authority().IfAuthority("loan", "edit", userFromCookie.Id))
            {
                int id = Convert.ToInt32(context.Request.Params["id"]);
                DriveMgr.Model.LoanModel loanEdit = loanBll.GetLoanModel(id);
                string ui_loan_Bank_edit          = context.Request.Params["ui_loan_Bank_edit"] ?? "";
                string ui_loan_Lenders_edit       = context.Request.Params["ui_loan_Lenders_edit"] ?? "";
                string ui_loan_LoanAmount_edit    = context.Request.Params["ui_loan_LoanAmount_edit"] ?? "";
                string ui_loan_LoanDate_edit      = context.Request.Params["ui_loan_LoanDate_edit"] ?? "";
                string ui_loan_Remark_edit        = context.Request.Params["ui_loan_Remark_edit"] ?? "";

                loanEdit.Bank       = ui_loan_Bank_edit.Trim();
                loanEdit.Lenders    = ui_loan_Lenders_edit.Trim();
                loanEdit.LoanAmount = decimal.Parse(ui_loan_LoanAmount_edit);
                loanEdit.LoanDate   = DateTime.Parse(ui_loan_LoanDate_edit);
                loanEdit.Remark     = ui_loan_Remark_edit.Trim();

                loanEdit.UpdatePerson = userFromCookie.UserId;
                loanEdit.UpdateDate   = DateTime.Now;

                if (loanBll.UpdateLoan(loanEdit))
                {
                    userOperateLog.OperateInfo = "修改贷款费用";
                    userOperateLog.IfSuccess   = true;
                    userOperateLog.Description = "修改成功,贷款费用主键:" + loanEdit.Id;
                    context.Response.Write("{\"msg\":\"修改成功!\",\"success\":true}");
                }
                else
                {
                    userOperateLog.OperateInfo = "修改贷款费用";
                    userOperateLog.IfSuccess   = false;
                    userOperateLog.Description = "修改失败";
                    context.Response.Write("{\"msg\":\"修改失败!\",\"success\":false}");
                }
            }
            else
            {
                userOperateLog.OperateInfo = "修改贷款费用";
                userOperateLog.IfSuccess   = false;
                userOperateLog.Description = "无权限,请联系管理员";
                context.Response.Write("{\"msg\":\"无权限,请联系管理员!\",\"success\":false}");
            }
            DriveMgr.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
        }
コード例 #2
0
ファイル: Loan.svc.cs プロジェクト: jangocheng/CHLMS
 public string GetLoanModel(int id)
 {
     return(JsonConvert.SerializeObject(_bll.GetLoanModel(id)));
 }