/// <summary>
        /// 获取客户提现信息
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public string GetCustomerWithdrawal(string pRequest)
        {
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;

            var rp         = pRequest.DeserializeJSONTo <APIRequest <GetCustomerWithdrawalInfoRP> >();
            var customerId = loggingSessionInfo.ClientID;

            var rd = new GetCustomerWithdrawalInfoRD();


            var bll = new CustomerWithdrawalBLL(loggingSessionInfo);
            var ds  = bll.GetCustomerWithrawalInfo(customerId);

            if (ds.Tables[0].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0)
            {
                GetCustomerWithdrawalInfo customerWithdrawalInfo = new GetCustomerWithdrawalInfo();
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    customerWithdrawalInfo.CustomerName  = row["CustomerName"].ToString();  //客户名称
                    customerWithdrawalInfo.ReceivingBank = row["ReceivingBank"].ToString(); //收款银行
                    if (row["BankAccount"] != DBNull.Value)
                    {
                        int    i = 4;
                        string strBankAccount = row["BankAccount"].ToString();
                        string strLeft        = strBankAccount.Substring(0, i);
                        string strRight       = strBankAccount.Substring(strBankAccount.Length - i, i);
                        customerWithdrawalInfo.BankAccount = strLeft + "**********" + strRight; //收款账号
                    }
                    customerWithdrawalInfo.OpenBank = row["OpenBank"].ToString();               //开户行
                }
                foreach (DataRow row in ds.Tables[2].Rows)
                {
                    customerWithdrawalInfo.CountWithdrawalAmount = row["CountWithdrawalAmount"] != DBNull.Value ? Convert.ToDecimal(row["CountWithdrawalAmount"].ToString()) : 0; //提现总金额
                    customerWithdrawalInfo.BeenAmount            = row["BeenAmount"] != DBNull.Value ? Convert.ToDecimal(row["BeenAmount"].ToString()) : 0;                       //已到账金额
                    customerWithdrawalInfo.WaitForAmount         = row["WaitForAmount"] != DBNull.Value ? Convert.ToDecimal(row["WaitForAmount"].ToString()) : 0;                 //待出账金额
                    customerWithdrawalInfo.CanWithdrawalAmount   = row["WithdrawalAmount"] != DBNull.Value ? Convert.ToDecimal(row["WithdrawalAmount"].ToString()) : 0;           //可提现金额
                    if (row["LastWithdrawalTime"] != DBNull.Value)
                    {
                        customerWithdrawalInfo.LastWithdrawalTime = DateTimeExtensionMethods.To19FormatString(Convert.ToDateTime(row["LastWithdrawalTime"])); //上次提现时间 ;
                    }
                    customerWithdrawalInfo.CautionMoney = row["CautionMoney"] != DBNull.Value ? Convert.ToDecimal(row["CautionMoney"].ToString()) : 0;        //保证金
                    customerWithdrawalInfo.RefundAmount = row["RefundAmount"] != DBNull.Value ? Convert.ToDecimal(row["RefundAmount"].ToString()) : 0;        //退款金额
                }
                //结算信息
                foreach (DataRow row in ds.Tables[1].Rows)
                {
                    customerWithdrawalInfo.PaypalRate = row["PaypalRate"] != DBNull.Value ? Convert.ToDecimal(row["PaypalRate"].ToString()) : 0;
                    customerWithdrawalInfo.CUPRate    = row["CUPRate"] != DBNull.Value ? Convert.ToDecimal(row["CUPRate"].ToString()) : 0;
                    customerWithdrawalInfo.OffPeriod  = row["OffPeriod"] != DBNull.Value ? Convert.ToInt32(row["OffPeriod"].ToString()) : 0;
                    customerWithdrawalInfo.MinAmount  = row["MinAmount"] != DBNull.Value ? Convert.ToInt32(row["MinAmount"].ToString()) : 0;
                    customerWithdrawalInfo.PayRemark  = row["PayRemark"].ToString();
                }
                rd.GetCustomerWithdrawal = customerWithdrawalInfo;
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
示例#2
0
        public void CalendarSelectionChange(object sender, EventArgs e)
        {
            CalendarPlaceHolder.Visible = false;
            DateTime toShow = DateTimeSelector.SelectedDate;

            if (ShowHours)
            {
                DateTime oldDateTime;
                if (DateTimeExtensionMethods.TryParseInTimeZone(this.CurrentStringValue, out oldDateTime))
                {
                    toShow += oldDateTime.TimeOfDay;
                }
            }

            InsertSelectedDate(toShow.FromTimeZoneToUtc());
            this.MessagesPlaceHolder.Controls.Add(new DocumentDirtyEvent());
        }
示例#3
0
        public ActionResult Create(CreateCustomerModel collection)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                // TODO: Add insert logic here
                var dateOfBirth = DateTimeExtensionMethods.ToDateTime(collection.DateOfBirth);
                var customer    = new Customer(collection.FirstName, collection.LastName, dateOfBirth, collection.PhoneNumber, collection.Email, collection.BankAccountNumber);
                customerRepository.Add(customer);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                var errorMessage = ex.InnerException != null ? ex.InnerException.InnerException.Message : ex.Message;
                ModelState.AddModelError("Error", errorMessage);
                return(View());
            }
        }
示例#4
0
 private void SetCalendar(DateTime?date)
 {
     if (date.HasValue == true && date.Value > DateTime.MinValue)
     {
         DateTime parsedTime;
         if (DateTimeExtensionMethods.TryParseInTimeZone(date.Value.ToTimeZoneDateString(), out parsedTime))
         {
             DateTimeSelector.SelectedDate = parsedTime - parsedTime.TimeOfDay;
             DateTimeSelector.VisibleDate  = DateTimeSelector.SelectedDate;
         }
         else
         {
             DateTimeSelector.SelectedDate = date.Value - date.Value.TimeOfDay;
             DateTimeSelector.VisibleDate  = DateTimeSelector.SelectedDate;
         }
     }
     else
     {
         DateTimeSelector.SelectedDate = DateTime.MinValue;
         DateTimeSelector.VisibleDate  = DateTime.Now;
     }
 }
示例#5
0
        public override void BindStateToProperties()
        {
            if (this.ReadOnly)
            {
                return;
            }

            try
            {
                if (string.IsNullOrEmpty(this.CurrentStringValue))
                {
                    this.Date = null;
                }
                else
                {
                    DateTime parsedTime;
                    if (!DateTimeExtensionMethods.TryParseInTimeZone(this.CurrentStringValue, out parsedTime))
                    {
                        throw new FormatException();
                    }

                    if (!ShowHours)
                    {
                        parsedTime -= parsedTime.TimeOfDay;
                    }

                    this.Date = parsedTime.FromTimeZoneToUtc().ToLocalTime();
                }
                this.IsValid = true;
            }
            catch (Exception)
            {
                this.IsValid         = false;
                this.ValidationError = string.Format(StringResourceSystemFacade.GetString("Composite.Management", "Validation.DateTime.InvalidDateFormat"),
                                                     this.CurrentStringValue, SampleDateString);
            }
        }