Ejemplo n.º 1
0
 private void ShowInfo(int _id)
 {
     BLL.daikuan_set   bll   = new BLL.daikuan_set();
     Model.daikuan_set model = bll.GetModel(_id);
     ddlXieHui.SelectedValue = model.xiehui_id.ToString();
     txtRate.Text            = model.rate.ToString();
     txtOverRate.Text        = model.over_rate.ToString();
     txtAmount.Text          = model.amount.ToString();
 }
Ejemplo n.º 2
0
        private void ShowInfo()
        {
            BLL.daikuan_set   bll   = new BLL.daikuan_set();
            Model.daikuan_set model = bll.GetModel(1);

            if (model != null)
            {
                txtRate.Text     = model.rate.ToString();
                txtOverRate.Text = model.over_rate.ToString();
                txtAmount.Text   = model.amount.ToString();
            }
        }
Ejemplo n.º 3
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.daikuan_set   bll   = new BLL.daikuan_set();
            Model.daikuan_set model = bll.GetModel(_id);
            model.xiehui_id = Utils.StrToInt(ddlXieHui.SelectedValue, 0);
            model.rate      = Utils.StrToDecimal(txtRate.Text, 0);
            model.over_rate = Utils.StrToDecimal(txtOverRate.Text, 0);
            model.amount    = Utils.StrToDecimal(txtAmount.Text, 0);

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改利率:" + model.rate); //记录日志
                result = true;
            }

            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.daikuan_set bll     = new BLL.daikuan_set();
            var             isExsit = bll.Exists(1);

            Model.daikuan_set model = new Model.daikuan_set();
            if (isExsit)
            {
                model = bll.GetModel(1);
            }
            model.rate      = Utils.ObjToDecimal(txtRate.Text, 0);
            model.over_rate = Utils.ObjToDecimal(txtOverRate.Text, 0);
            model.amount    = Utils.ObjToDecimal(txtAmount.Text, 0);
            if (isExsit)
            {
                if (!bll.Update(model))
                {
                    JscriptMsg("保存过程中发生错误!", "");
                    return;
                }
                else
                {
                    AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改借款事项信息"); //记录日志
                    JscriptMsg("修改借款事项成功!", "daikuan_set.aspx");
                }
            }
            else
            {
                if (bll.Add(model) > 0)
                {
                    AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加借款事项信息:"); //记录日志
                }
                else
                {
                    JscriptMsg("保存过程中发生错误!", "");
                    return;
                }
            }
        }
Ejemplo n.º 5
0
        private bool DoAdd()
        {
            Model.daikuan model = new Model.daikuan();
            BLL.daikuan   bll   = new BLL.daikuan();
            model.member_id = Utils.StrToInt(txtMemberId.Text, 0);
            model.name      = txtName.Text.Trim();
            if (!string.IsNullOrWhiteSpace(txtGender.Text.Trim()))
            {
                model.gender = txtGender.Text.Trim() == "男" ? "0" : "1";
            }
            model.id_card         = txtIdCard.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.level           = txtLevel.Text.Trim();
            model.member_no       = txtMember.Text.Trim();
            model.can_amount      = Utils.StrToDecimal(txtCanAmount.Text, 0);
            model.amount          = Utils.StrToDecimal(txtAmount.Text, 0);
            model.purpose         = txtPurpose.Text.Trim();
            model.add_time        = Utils.StrToDateTime(txtAddTime.Text.Trim());
            model.lb_person       = txtLbIds.Text.ToString();
            model.lb_person_names = txtLbNames.Text.ToString();
            model.month           = Utils.StrToInt(txtMonth.Text, 0);
            model.member_amount   = Utils.StrToDecimal(txtMemberAmount.Text, 0);
            model.chanye          = ddlChanYe.SelectedValue;
            model.remark          = txtRemark.Text.Trim().ToString();

            BLL.daikuan_set setBll  = new BLL.daikuan_set();
            var             isExsit = setBll.Exists(1);

            Model.daikuan_set setModel = new Model.daikuan_set();
            if (isExsit)
            {
                setModel        = setBll.GetModel(1);
                model.zy_amount = model.amount * (setModel.rate * 0.01m);

                model.wh_amount = model.amount + model.zy_amount;
            }

            #region 保存相册====================
            string[] albumArr    = Request.Form.GetValues("hid_photo_name");
            string[] remarkArr   = Request.Form.GetValues("hid_photo_remark");
            string[] link_urlArr = Request.Form.GetValues("hid_photo_link_url");
            if (albumArr != null && albumArr.Length > 0)
            {
                List <Model.daikuan_albums> ls = new List <Model.daikuan_albums>();
                for (int i = 0; i < albumArr.Length; i++)
                {
                    string[] imgArr = albumArr[i].Split('|');
                    if (imgArr.Length == 3)
                    {
                        if (!string.IsNullOrEmpty(link_urlArr[i]))
                        {
                            ls.Add(new Model.daikuan_albums {
                                original_path = imgArr[1], thumb_path = imgArr[2], link_url = link_urlArr[i]
                            });
                        }
                        if (!string.IsNullOrEmpty(remarkArr[i]))
                        {
                            ls.Add(new Model.daikuan_albums {
                                original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i]
                            });
                        }
                        else
                        {
                            ls.Add(new Model.daikuan_albums {
                                original_path = imgArr[1], thumb_path = imgArr[2]
                            });
                        }
                    }
                }
                model.albums = ls;
            }
            #endregion
            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加借款信息:" + model.name); //记录日志
                return(true);
            }
            return(false);
        }