Ejemplo n.º 1
0
 public ActionResult GetWithdrawPageList(int uid, int pageIndex = 1, int pageSize = 10)
 {
     try
     {
         if (uid != distributor.Id)
         {
             return(Json(new { ok = false, error = "无权操作" }));
         }
         if (distributor.Distributor_Status != (int)Distributor_Status.Normal)
         {
             return(Json(new { ok = false, error = "分销商待审核或已冻结" }));
         }
         if (pageIndex <= 1)
         {
             pageIndex = 1;
         }
         if (pageIndex <= 0)
         {
             pageSize = 10;
         }
         int count    = 0;
         var dataList = WithdrawBLL.SearchList(pageIndex, pageSize, new WithdrawSearchInfo {
             Distributor_Id = uid
         }, ref count);
         dataList.ForEach(k => k.Status_Desc = EnumHelper.ReadEnumChineseName <Withdraw_Status>(k.Status));
         return(Json(new { ok = true, user = distributor, data = dataList, count = dataList.Count }));
     }
     catch (Exception ex)
     {
         return(Json(new { ok = false, error = ex.Message }));
     }
 }
Ejemplo n.º 2
0
 public ActionResult ApplyWithdraw(int uid, decimal amount)
 {
     try
     {
         if (uid != distributor.Id)
         {
             return(Json(new { ok = false, error = "无权操作" }));
         }
         if (WithdrawBLL.SearchList(new WithdrawSearchInfo {
             Distributor_Id = uid, Status = (int)Withdraw_Status.Apply
         }).Count > 0)
         {
             return(Json(new { ok = false, error = "您已有待审核的提现申请,暂不能再次提交提现申请" }));
         }
         if (amount <= 0)
         {
             return(Json(new { ok = false, error = "请输入正确的提现金额" }));
         }
         if (amount > distributor.Total_Commission - distributor.Total_Withdraw)
         {
             return(Json(new { ok = false, error = "提现金额超出可提现额度[" + (distributor.Total_Commission - distributor.Total_Withdraw) + "元]" }));
         }
         int wid = WithdrawBLL.Add(new WithdrawInfo
         {
             Distributor_Id = uid,
             Amount         = amount,
             Time           = DateTime.Now,
             Status         = (int)Withdraw_Status.Apply
         });
         if (wid > 0)
         {
             return(Json(new { ok = true }));
         }
         else
         {
             return(Json(new { ok = false, error = "系统忙" }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { ok = false, error = ex.Message }));
     }
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id = RequestHelper.GetQueryString <int>("ID");
                entity = WithdrawBLL.Read(id);
                //当前分销商
                distributor = UserBLL.Read(entity.Distributor_Id);
                if (entity.Id <= 0 || distributor.Id <= 0)
                {
                    ScriptHelper.Alert("参数错误", RequestHelper.RawUrl);
                }

                entity.UserName = HttpUtility.UrlDecode(distributor.UserName, System.Text.Encoding.UTF8);
                entity.RealName = distributor.RealName;
                entity.Mobile   = distributor.Mobile;

                //审核操作记录
                actions = Withdraw_OperateBLL.ReadListByWithdraw(entity.Id);
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadWithdraw", PowerCheckType.Single);
                //状态
                var list = EnumHelper.ReadEnumList <Withdraw_Status>();
                foreach (EnumInfo item in list)
                {
                    Status.Items.Add(new ListItem(item.ChineseName, item.Value.ToString()));
                }
                Status.Items.Insert(0, new ListItem("请选择", string.Empty));

                int      distributorId = RequestHelper.GetQueryString <int>("distributorId");
                UserInfo distributor   = UserBLL.Read(distributorId);
                StartTime.Text = RequestHelper.GetQueryString <string>("StartTime");
                EndTime.Text   = RequestHelper.GetQueryString <string>("EndTime");
                UserName.Text  = HttpUtility.UrlDecode((distributor.Id > 0 ? distributor.UserName : RequestHelper.GetQueryString <string>("UserName")), System.Text.Encoding.UTF8);
                Mobile.Text    = RequestHelper.GetQueryString <string>("Mobile");
                Status.Text    = RequestHelper.GetQueryString <string>("Status");
                var dataList = WithdrawBLL.SearchList(
                    CurrentPage,
                    PageSize,
                    new WithdrawSearchInfo
                {
                    Distributor_Id = distributorId,
                    StartTime      = RequestHelper.GetQueryString <DateTime>("StartTime"),
                    EndTtime       = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndTime")),
                    UserName       = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8),
                    Mobile         = RequestHelper.GetQueryString <string>("Mobile"),
                    Status         = RequestHelper.GetQueryString <int>("Status")
                },
                    ref Count);
                dataList.ForEach(k => k.UserName = HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8));
                BindControl(dataList, RecordList, MyPager);
            }
        }
Ejemplo n.º 5
0
        private void WithdrawOperate(Withdraw_Operate operate)
        {
            int id      = RequestHelper.GetQueryString <int>("ID");
            var _entity = WithdrawBLL.Read(id);

            if (_entity.Id <= 0)
            {
                ScriptHelper.Alert("记录不存在", RequestHelper.RawUrl);
            }
            if (_entity.Status != (int)Withdraw_Status.Apply)
            {
                ScriptHelper.Alert("当前状态不能执行此操作", RequestHelper.RawUrl);
            }
            #region 提现完成操作  判断分销商状态是否正常,剩余可提现额度是否满足本次提现
            if (operate == Withdraw_Operate.Pass)
            {
                distributor = UserBLL.Read(_entity.Distributor_Id);
                if (distributor.Distributor_Status != (int)Distributor_Status.Normal)
                {
                    ScriptHelper.Alert("当前分销商已冻结或待审核,不能执行此操作", RequestHelper.RawUrl);
                }
                if (distributor.Total_Commission - distributor.Total_Withdraw < 0)
                {
                    ScriptHelper.Alert("当前提现金额已超出分销商剩余提现额度,不能执行此操作", RequestHelper.RawUrl);
                }
            }
            #endregion
            if (WithdrawBLL.Operate(id, operate, Cookies.Admin.GetAdminID(false), Note.Text))
            {
                ScriptHelper.Alert("操作成功", RequestHelper.RawUrl);
            }
            else
            {
                ScriptHelper.Alert("操作失败", RequestHelper.RawUrl);
            }
        }