Beispiel #1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Pan.Model.Credit DataRowToModel(DataRow row)
 {
     Pan.Model.Credit model=new Pan.Model.Credit();
     if (row != null)
     {
         if(row["id"]!=null && row["id"].ToString()!="")
         {
             model.id=int.Parse(row["id"].ToString());
         }
         if(row["name"]!=null)
         {
             model.name=row["name"].ToString();
         }
         if(row["sex"]!=null)
         {
             model.sex=row["sex"].ToString();
         }
         if(row["mobile_num"]!=null)
         {
             model.mobile_num=row["mobile_num"].ToString();
         }
         if(row["i_num"]!=null && row["i_num"].ToString()!="")
         {
             model.i_num=int.Parse(row["i_num"].ToString());
         }
         if(row["collateral"]!=null)
         {
             model.collateral=row["collateral"].ToString();
         }
         if(row["limit_date"]!=null)
         {
             model.limit_date=row["limit_date"].ToString();
         }
         if(row["time"]!=null)
         {
             model.time=row["time"].ToString();
         }
     }
     return model;
 }
Beispiel #2
0
        public ActionResult CreditApply()
        {
            Credit c = new Credit();
            Pan.Model.Credit credit = new Pan.Model.Credit();
            credit.mobile_num = Request.Form["shouji"];
            credit.name = Request.Form["chengwei"];
            credit.sex = Request.Form["gender"];
            credit.time = DateTime.Now.ToString();
            credit.limit_date = Request.Form["qixian"];
            credit.collateral = Request.Form["diyawu"];
            credit.i_num = int.Parse(Request.Form["amount"]);
            c.Add(credit);
            loan.Models.common.MailSender ms = new Models.common.MailSender();
            StringBuilder body = new StringBuilder();
            body.Append("<div>姓名:");
            body.Append(Request.Form["chengwei"]);
            body.Append("</div>");
            body.Append("<div>性别:");
            body.Append(Request.Form["gender"]);
            body.Append("</div>");
            body.Append("<div>联系方式:");
            body.Append(Request.Form["shouji"]);
            body.Append("</div>");
            body.Append("<div>抵押物:");
            body.Append(Request.Form["diyawu"]);
            body.Append("</div>");
            body.Append("<div>贷款金额:");
            body.Append(Request.Form["amount"]);
            body.Append("</div>");
            body.Append("<div>贷款期限:");
            body.Append(Request.Form["qixian"]);
            body.Append("</div>");
            body.Append("<div>申请日期:");
            body.Append(credit.time);
            body.Append("</div>");

            ms.send("贷款申请", body.ToString());
            return Content("<script>alert('申请成功,我们的工作人员会尽快跟您联系。');window.location='/Jikedai.html';</script>");
        }
Beispiel #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Pan.Model.Credit GetModel(int id)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 id,name,sex,mobile_num,i_num,collateral,limit_date,time from Credit ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@id", SqlDbType.Int,4)
            };
            parameters[0].Value = id;

            Pan.Model.Credit model=new Pan.Model.Credit();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }