Exemplo n.º 1
0
 public bool Save(RefundsApplyEntity obj)
 {
     try
     {
         Insert("RefundsApplyMap.Insert", obj);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public bool Update(RefundsApplyEntity obj)
 {
     try
     {
         Update("RefundsApplyMap.Update", obj);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 3
0
 public RefundsApplyEntity Load(string code)
 {
     try
     {
         RefundsApplyEntity dinner = QueryForObject <RefundsApplyEntity>("RefundsApplyMap.Load", code);
         return(dinner);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 4
0
        public ActionResult submitReturnsFee(string userid, decimal returnsFee, string remark)
        {
            JsonResult result = new JsonResult();

            try
            {
                UserInfoEntity user = userLogic.Load(userid);
                if (user == null)
                {
                    result.Data = new { status = 200, msg = "用户不存在" };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                RefundsApplyEntity apply = new RefundsApplyEntity();
                apply.ApplyId   = userid + DateTime.Now.ToString("yyMMddHHmmssfff");
                apply.UserId    = userid;
                apply.ApplyDate = DateTime.Now;
                apply.Amount    = returnsFee;
                apply.Reason    = remark;
                apply.IsBack    = "0";
                bool isok = refundLogic.Save(apply);
                if (isok)
                {
                    result.Data = new { status = 100, msg = "success" };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    result.Data = new { status = 200, msg = "failt" };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                result.Data = new { status = 200, msg = ex.Message };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 5
0
        public bool BackUserFee(string applyId, string backUserId)
        {
            using (TransactionScope trans = new TransactionScope())
            {
                try
                {
                    bool isok = true;
                    RefundsApplyEntity entity = access.Load(applyId);
                    entity.BackUserId = backUserId;
                    entity.BackDate   = DateTime.Now;
                    entity.IsBack     = "1";
                    isok = access.Update(entity);
                    if (isok == false)
                    {
                        return(false);
                    }


                    UserInfoEntity user = userAccess.Load(entity.UserId);
                    if (user != null)
                    {
                        UserCardEntity cardEnty = usercardAccess.Load(user.CardId);
                        cardEnty.PreAmount  = cardEnty.PreAmount - entity.Amount;
                        cardEnty.UpdateDate = DateTime.Now;
                        cardEnty.UpdateUser = backUserId;
                        isok = usercardAccess.Update(cardEnty);
                        if (isok == false)
                        {
                            return(false);
                        }
                    }


                    PatiPayListEntity payInfo = new PatiPayListEntity();
                    payInfo.PayId      = backUserId + DateTime.Now.ToString("yyMMddHHmmssff");
                    payInfo.UserId     = entity.UserId;
                    payInfo.CardId     = user.CardId;
                    payInfo.Direction  = -1;
                    payInfo.CreateDate = DateTime.Now;
                    payInfo.CreateUser = backUserId;
                    payInfo.PayAmount  = entity.Amount;
                    isok = paylistLogic.Save(payInfo); // 保存数据。



                    if (isok == true)
                    {
                        trans.Complete();
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch (Exception ex)
                {
                    return(false);
                }
            }
        }
Exemplo n.º 6
0
 public bool Update(RefundsApplyEntity obj)
 {
     return(access.Update(obj));
 }
Exemplo n.º 7
0
 public bool Save(RefundsApplyEntity obj)
 {
     return(access.Save(obj));
 }