Exemplo n.º 1
0
 /// <summary>
 /// 更新提现数据
 /// </summary>
 /// <param name="model"></param>
 public void UpdateShopWithDraw(ShopWithDrawInfo model)
 {
     //Context.ShopWithDrawInfo.Attach(model);
     //Context.Entry(model).State = System.Data.Entity.EntityState.Modified;
     //Context.SaveChanges();
     DbFactory.Default.Update(model);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 体现明细
        /// </summary>
        /// <param name="userKey">用户key</param>
        /// <param name="id">体现编号</param>
        /// <returns></returns>
        public object GetWithDrawDetailById(string userKey, long id)
        {
            long userId  = UserCookieEncryptHelper.Decrypt(userKey, CookieKeysCollection.USERROLE_SELLERADMIN);
            var  manager = ServiceProvider.Instance <IManagerService> .Create.GetSellerManager(userId);

            ShopWithDrawInfo Models = new ShopWithDrawInfo()
            {
                Id          = 1,
                Account     = "heavenspring007716",
                AccountName = "杨文俊",
                ApplyTime   = DateTime.Now,
                CashAmount  = 25,
                CashType    = Himall.CommonModel.WithdrawType.WeiChat,
                SellerId    = userId,
                SellerName  = manager.UserName,
                DealTime    = null,
                ShopId      = 372,
                ShopRemark  = "",
                PlatRemark  = "",
                Status      = Himall.CommonModel.WithdrawStaus.WatingAudit,
                ShopName    = "绝妙发型屋",
                CashNo      = DateTime.Now.ToString("yyyyMMddHHmmssffff"),
                SerialNo    = ""
            };

            return(Json(new { Status = "OK", Data = Models }));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 商家申请提现
        /// </summary>
        /// <param name="draw">申请提现实体</param>
        /// <returns></returns>
        public static bool ShopApplyWithDraw(ShopWithDraw draw)
        {
            var mAccount = _iBillingService.GetShopAccount(draw.ShopId);

            if (mAccount.Balance >= draw.WithdrawalAmount)
            {
                var    model       = _iShopService.GetShop(draw.ShopId);
                string Account     = "";
                string AccountName = "";
                if (draw.WithdrawType.Equals(WithdrawType.BankCard))
                {
                    Account     = model.BankAccountNumber;
                    AccountName = model.BankAccountName;
                }
                else
                {
                    Account     = model.WeiXinOpenId;
                    AccountName = model.WeiXinTrueName;
                }


                lock (obj)
                {
                    //处理余额
                    var mShopAccountInfo = _iBillingService.GetShopAccount(draw.ShopId);
                    mShopAccountInfo.Balance -= draw.WithdrawalAmount;
                    _iBillingService.UpdateShopAccount(mShopAccountInfo);


                    ShopWithDrawInfo Models = new ShopWithDrawInfo()
                    {
                        Account     = Account,
                        AccountName = AccountName,
                        ApplyTime   = DateTime.Now,
                        CashAmount  = draw.WithdrawalAmount,
                        CashType    = draw.WithdrawType,
                        SellerId    = draw.SellerId,
                        SellerName  = draw.SellerName,
                        ShopId      = draw.ShopId,
                        ShopRemark  = "",
                        Status      = Himall.CommonModel.WithdrawStaus.WatingAudit,
                        ShopName    = model.ShopName,
                        CashNo      = DateTime.Now.ToString("yyyyMMddHHmmssffff")
                    };
                    _iBillingService.AddShopWithDrawInfo(Models);
                }


                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 取消
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static bool CancelShopApplyWithDraw(long Id)
        {
            ShopWithDrawInfo shopWithDrawInfo = BillingApplication._iBillingService.GetShopWithDrawInfo(Id);

            if (shopWithDrawInfo.Status != WithdrawStaus.PayPending)
            {
                return(false);
            }
            shopWithDrawInfo.Status = WithdrawStaus.WatingAudit;
            BillingApplication._iBillingService.UpdateShopWithDraw(shopWithDrawInfo);
            return(true);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 店铺提现申请
 /// </summary>
 /// <param name="item"></param>
 public void AddShopWithDrawInfo(ShopWithDrawInfo info)
 {
     //Context.ShopWithDrawInfo.Add(info);
     //Context.SaveChanges();
     DbFactory.Default.Add(info);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 更新提现数据
 /// </summary>
 /// <param name="model"></param>
 public void UpdateShopWithDraw(ShopWithDrawInfo model)
 {
     Context.ShopWithDrawInfo.Attach(model);
     Context.Entry(model).State = System.Data.Entity.EntityState.Modified;
     Context.SaveChanges();
 }
Exemplo n.º 7
0
 /// <summary>
 /// 店铺提现申请
 /// </summary>
 /// <param name="item"></param>
 public void AddShopWithDrawInfo(ShopWithDrawInfo info)
 {
     Context.ShopWithDrawInfo.Add(info);
     Context.SaveChanges();
 }