Example #1
0
        public ActionResult Edit(int Id = 0, int ChannelType = 0, int BankId = 0, decimal SingleQuota = 0, decimal DayQuota = 0, decimal MouthQuota = 0, int State = 0)
        {
            BankQuota model = new BankQuota();

            if (Id > 0)
            {
                model = bankQuotaDao.Single(Id);

                model.UTime = DateTime.Now;
            }
            bool flag = false;

            model.ChannelType = ChannelType;
            model.BankId      = BankId;
            model.SingleQuota = SingleQuota;
            model.DayQuota    = DayQuota;
            model.MouthQuota  = MouthQuota;
            model.State       = State;
            if (model.ID > 0)
            {
                flag = bankQuotaDao.Update(model);
            }
            else
            {
                flag = bankQuotaDao.Insert(model) > 0;
            }
            int    state = flag ? 0 : -100;
            string msg   = flag ? "操作成功" : "操作失败";
            string url   = "/bankquota/";

            MemcachHelper.Delete(Constant.list_bank_quota_key);//清理缓存
            return(new RedirectResult($"/Prompt?state={state}&msg={msg}&url={url}"));
        }
Example #2
0
 /// <summary>
 /// Delete,根据实体对象删除
 /// </summary>
 /// <returns>返回,成功:true,失败:false</returns>
 public bool Delete(BankQuota entity)
 {
     return(dal.Update(entity));
 }
Example #3
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <returns>返回,成功:true,失败:false</returns>
 public int Insert(BankQuota entity)
 {
     return(dal.Insert(entity));
 }