Beispiel #1
0
 /// <summary>
 /// 新增经纪人银行卡
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Insert(SysAgentBankEntity model)
 {
     try
     {
         using (var db = GetInstance())
         {
             model.createtime = DateTime.Now;
             return(db.Insertable(model).ExecuteReturnIdentity());
         }
     }
     catch (Exception ex)
     {
         new LogLogic().Write(Level.Error, "新增商户", ex.Message, ex.StackTrace);
     }
     return(0);
 }
Beispiel #2
0
 public ActionResult Form(SysAgentBankEntity model)
 {
     if (model.id == 0)
     {
         var agentModel = new SysUserLogic().CheckUserName(model.AgentName);
         if (agentModel == null)
         {
             return(Error("经纪人不存在!"));
         }
         model.AgentID = agentModel.Id;
         model.ShopID  = agentModel.ShopID;
         int row = sysAgentBankLogic.Insert(model);
         return(row > 0 ? Success() : Error());
     }
     else
     {
         int row = sysAgentBankLogic.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
Beispiel #3
0
 /// <summary>
 /// 更新经纪人银行卡
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Update(SysAgentBankEntity model)
 {
     try
     {
         using (var db = GetInstance())
         {
             return(db.Updateable <SysAgentBankEntity>().SetColumns(it => new SysAgentBankEntity
             {
                 bankano = model.bankano,
                 CategoryCode = model.CategoryCode,
                 payType = model.payType,
                 bankaccount = model.bankaccount,
                 address = model.address
             }).Where(it => it.id == model.id).ExecuteCommand());
         }
     }
     catch (Exception ex)
     {
         new LogLogic().Write(Level.Error, "更新经纪人银行卡", ex.Message, ex.StackTrace);
     }
     return(0);
 }
Beispiel #4
0
        public ActionResult GetForm(int primaryKey)
        {
            SysAgentBankEntity entity = sysAgentBankLogic.Get(primaryKey);

            return(Content(entity.ToJson()));
        }