Пример #1
0
        /// <summary>
        /// 退回申请
        /// </summary>
        /// <param name="salePlatformId"></param>
        /// <param name="applyId"></param>
        protected void ReturnApply(Guid salePlatformId, Guid applyId)
        {
            var errorMsg = new StringBuilder();
            MemberMentionApplyInfo memberMentionApplyInfo = MemberCenterSao.GetMemberMentionApply(salePlatformId, applyId);

            if (memberMentionApplyInfo.State == (int)MemberMentionState.Process)
            {
                #region 退回申请
                try
                {
                    string errorMessage;
                    var    result = MemberCenterSao.ReturnBackWithdrawApply(salePlatformId, applyId, txt_RefuseReason.Text.Trim(), Common.WebControl.RetrunUserAndTime("提现退回"), out errorMessage);
                    if (!result)
                    {
                        throw new Exception("会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + "   " + errorMessage);
                    }
                    Common.WebControl.AddOperationLog(Personnel.PersonnelId, Personnel.RealName, memberMentionApplyInfo.Id, memberMentionApplyInfo.ApplyNo, OperationPoint.MemberWithdrawCash.PayRefuse.GetBusinessInfo(), "提现退回");
                }
                catch (Exception ex)
                {
                    errorMsg.Append("退回申请失败!" + ex.Message).Append("\\n");
                }
                #endregion

                #region 发送短信
                try
                {
                    MemberBaseInfo memberBaseInfo = MemberCenterSao.GetUserBase(salePlatformId, memberMentionApplyInfo.MemberId);
                    if (memberBaseInfo != null)
                    {
                        if (!string.IsNullOrEmpty(memberBaseInfo.Mobile))
                        {
                            //百秀退回申请不发送短信
                            var baishopFilialeId = new Guid("444E0C93-1146-4386-BAE2-CB352DA70499");
                            if (memberMentionApplyInfo.SaleFilialeId != baishopFilialeId)
                            {
                                string msg = "您好,您的提现申请已退回,原因:" + txt_RefuseReason.Text + "。详情可致电4006202020咨询。感谢您对可得网支持!";
                                MailSMSSao.SendShortMessage(memberMentionApplyInfo.SaleFilialeId, memberMentionApplyInfo.SalePlatformId, memberBaseInfo.Mobile, msg);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    errorMsg.Append("退回申请成功,短信发送失败! " + "会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + "   " + ex.Message).Append("\\n");
                }
                #endregion
            }

            if (!string.IsNullOrEmpty(errorMsg.ToString()))
            {
                throw new Exception(errorMsg.ToString());
            }
        }
Пример #2
0
        protected void Ib_Search_Click(object sender, ImageClickEventArgs e)
        {
            NonceOrderState = (OrderState)Convert.ToInt32(RCB_OrderState.SelectedValue);
            StartTime       = RDP_StartTime.SelectedDate ?? DateTime.MinValue;
            //EndTime = RDP_EndTime.SelectedDate != null ? RDP_EndTime.SelectedDate.Value : DateTime.MinValue;
            PaidNo = RTB_PaidNo.Text.Trim();           //支付号
            var orderNo   = RTB_Search.Text.Trim();    //订单号
            var mobil     = RTB_Mobil.Text.Trim();     //手机号
            var realName  = RTB_RealName.Text.Trim();  //收货人
            var userName  = RTB_UserName.Text.Trim();  //会员名
            var expressNo = RTB_ExpressNo.Text.Trim(); //快递号

            if (string.IsNullOrWhiteSpace(PaidNo) && string.IsNullOrWhiteSpace(orderNo) && string.IsNullOrWhiteSpace(mobil) && string.IsNullOrWhiteSpace(realName) && string.IsNullOrWhiteSpace(userName) && string.IsNullOrWhiteSpace(expressNo))
            {
                RefreshRadTextBoxBorderColor(Color.Red);
                RAM.Alert("系统提示:必须满足一个搜索条件!");
                return;
            }
            RefreshRadTextBoxBorderColor(Color.Empty);
            SaleFilialeId  = new Guid(RCB_SaleFiliale.SelectedValue);
            SalePlatformId = new Guid(RCB_SalePlatform.SelectedValue);
            if (!string.IsNullOrEmpty(RTB_UserName.Text))
            {
                var salePlatformId = SalePlatformId;
                if (SaleFilialeId == new Guid("B6B39773-E76E-4A53-9AAC-634E7DF973EA")) //门店总公司
                {
                    salePlatformId = new Guid("3FE5AEF4-2CFD-4998-8D88-385321179B80"); //可得官网
                }
                if (salePlatformId == Guid.Empty)
                {
                    RAM.Alert("温馨提示:通过会员名称搜索数据必须选择具体的销售平台,谢谢配合!");
                    return;
                }
                var info = MemberCenterSao.GetUserBase(salePlatformId, RTB_UserName.Text);
                if (info != null)
                {
                    MemberIdOrConsignee = info.MemberId;
                }
                else
                {
                    RAM.Alert("温馨提示:请核对会员名称是否正确!");
                    return;
                }
            }
            else
            {
                MemberIdOrConsignee = Guid.Empty;
            }
            RGMGO.Rebind();
        }
Пример #3
0
        /// <summary>
        /// 打款完成
        /// </summary>
        /// <param name="salePlatformId"></param>
        /// <param name="applyId"></param>
        protected void PayFinish(Guid salePlatformId, Guid applyId)
        {
            var errorMsg = new StringBuilder();
            MemberMentionApplyInfo memberMentionApplyInfo = MemberCenterSao.GetMemberMentionApply(salePlatformId, applyId);

            if (memberMentionApplyInfo.State == (int)MemberMentionState.Process)
            {
                var orderNoStr = string.Empty;
                if (!string.IsNullOrWhiteSpace(memberMentionApplyInfo.OrderNo))
                {
                    orderNoStr = string.Format("[订单号:{0}]", memberMentionApplyInfo.OrderNo);
                }
                if (!string.IsNullOrWhiteSpace(memberMentionApplyInfo.ThirdPartyOrderNo) || memberMentionApplyInfo.ThirdPartyOrderNo == "-")
                {
                    orderNoStr = string.Format("{0}[第三方平台订单号:{1}]", orderNoStr, memberMentionApplyInfo.ThirdPartyOrderNo);
                }
                var rdescription = string.Format("[余额提现(提现会员:{0};提现申请单号:{1};提现到:{2};操作人:{3}),资金减少,{4})]", memberMentionApplyInfo.UserName, memberMentionApplyInfo.ApplyNo, memberMentionApplyInfo.BankName, Personnel.RealName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                var info = new WasteBookInfo(Guid.NewGuid(), new Guid(RCB_BankAccountsId.SelectedValue),
                                             memberMentionApplyInfo.ApplyNo, rdescription + orderNoStr,
                                             -memberMentionApplyInfo.Amount, (Int32)AuditingState.Yes,
                                             (Int32)WasteBookType.Decrease, memberMentionApplyInfo.SaleFilialeId)
                {
                    LinkTradeCode = memberMentionApplyInfo.ApplyNo,
                    LinkTradeType = (int)WasteBookLinkTradeType.WithdrawDeposit,
                    BankTradeCode = string.Empty,
                    State         = (int)WasteBookState.Currently,
                    IsOut         = false
                };

                var memo        = "提现" + memberMentionApplyInfo.ApplyNo + "取走余额;";
                var description = "提现" + memberMentionApplyInfo.ApplyNo + ",提走余额;" + Common.WebControl.RetrunUserAndTime("提现受理");

                #region 提现
                using (var ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    try
                    {
                        if (info.Income != 0)
                        {
                            _wasteBook.Insert(info);
                        }
                        string errorMessage;
                        var    result = MemberCenterSao.CompleteWithdrawApply(salePlatformId, applyId, memo, description, out errorMessage);
                        if (!result)
                        {
                            throw new Exception("会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + "   " + errorMessage);
                        }
                        //提现打款完成增加操作记录添加
                        Common.WebControl.AddOperationLog(Personnel.PersonnelId, Personnel.RealName, info.WasteBookId, info.TradeCode, OperationPoint.MemberWithdrawCash.PaySuccess.GetBusinessInfo(), string.Empty);
                        ts.Complete();
                    }
                    catch (Exception ex)
                    {
                        errorMsg.Append("提现失败!" + ex.Message).Append("\\n");
                    }
                    finally
                    {
                        ts.Dispose();
                    }
                }
                #endregion

                #region 发送短信
                try
                {
                    MemberBaseInfo memberBaseInfo = MemberCenterSao.GetUserBase(salePlatformId, memberMentionApplyInfo.MemberId);
                    if (memberBaseInfo != null)
                    {
                        if (!string.IsNullOrEmpty(memberBaseInfo.Mobile))
                        {
                            //可得完成打款发送短信
                            var keedeFilialeId = FilialeManager.GetList().First(f => f.Code.ToLower() == "kede").ID;
                            if (memberMentionApplyInfo.SaleFilialeId == keedeFilialeId)
                            {
                                const string MSG = "您好,您的提现申请已收到,现已完成打款,一般2-5个工作日到账,请注意查收。详情可致电4006202020咨询。感谢您对可得网支持!";
                                MailSMSSao.SendShortMessage(memberMentionApplyInfo.SaleFilialeId, memberMentionApplyInfo.SalePlatformId, memberBaseInfo.Mobile, MSG);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    errorMsg.Append("提现成功,短信发送失败! " + "会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + "   " + ex.Message).Append("\\n");
                }
                #endregion
            }

            if (!string.IsNullOrEmpty(errorMsg.ToString()))
            {
                throw new Exception(errorMsg.ToString());
            }
        }