示例#1
0
        /// <summary>
        /// 标详情页,获取回款汇总信息
        /// </summary>
        public void GetRepayedMsg(Guid projId)
        {
            List <SubscribeTotalInfo> repaylist = new SubscribeBLL().GetRepaymentInfo(projId);

            if (repaylist == null)
            {
                repaylist = new List <SubscribeTotalInfo>();
            }
            foreach (SubscribeTotalInfo item in repaylist)
            {
                switch (item.status)
                {
                case 1:
                    repayedAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                    break;

                case 2:
                    overdueAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                    break;

                case 3:
                    duerepayAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                    break;
                }
            }


            //PrintJson("1", string.Format("{0}|{1}|{2}", ToolStatus.ConvertDetailWanMoney(repayedAmount),
            //        ToolStatus.ConvertDetailWanMoney(overdueAmount), ToolStatus.ConvertDetailWanMoney(duerepayAmount)));
        }
示例#2
0
        public void AddDebitoCredito(String all)
        {
            string[] datos        = all.Split('|');
            string   payment_type = "3"; // Por Defecto tiene Payment Type 3 (Credito)

            // [11] Abrev Tipo de Pago (CR = Credito y DB = Debito)
            if (datos[11] == "DB")
            {
                payment_type = "6"; // Cambia al Payment Type 6 (Debito)
            }

            // Obtiene el Payment ID Credito / Débito
            String paymentID = BL.DB.ExecuteScalar("SELECT id  FROM payments WHERE payment_type=" + payment_type + " LIMIT 1").ToString();

            BL.CurrentTransaction.AddPayment(int.Parse(paymentID), 0, 0, SafeConvert.ToDecimal(x_monto.Text));
            ArrayList payments = BL.CurrentTransaction.GetItems(typeof(TransPayment));

            foreach (TransPayment pay in payments)
            {
                if (pay.Data.Type.ToString() == "Debitor" || pay.Data.Type.ToString() == "CreditCard")
                {
                    if (pay.Data.Notes == "CLP" || pay.Data.Notes == null || pay.Data.Notes == "")
                    {
                        pay.Data.Notes = all;
                    }
                }
            }
        }
示例#3
0
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            IEnumerable <string> headers;

            if (actionContext.Request.Headers.TryGetValues("debug-timeout", out headers))
            {
                Thread.Sleep((int)(SafeConvert.ToDecimal(headers.FirstOrDefault()) * 1000));
            }
            if (actionContext.Request.Headers.TryGetValues("debug-fault", out headers) && headers.Any())
            {
                throw new Exception("Тестовое исключение");
            }
            base.OnActionExecuting(actionContext);
        }
        public void AddCredito(String all)
        {
            String paymentID = BL.DB.ExecuteScalar("SELECT id  FROM payments WHERE payment_type=3 LIMIT 1").ToString();

            BL.CurrentTransaction.AddPayment(int.Parse(paymentID), 0, 0, SafeConvert.ToDecimal(txtMonto.Text));
            ArrayList payments = BL.CurrentTransaction.GetItems(typeof(TransPayment));

            foreach (TransPayment pay in payments)
            {
                if (pay.Data.Type.ToString() == "CreditCard")
                {
                    if (pay.Data.Notes == "CLP" || pay.Data.Notes == null)
                    {
                        pay.Data.Notes = all;
                    }
                }
            }
        }
示例#5
0
        public void AddCheque(String all)
        {
            // Obtiene el Payment ID -- Cheque (El Payment type Cheque en el Kernel siempre será 5)
            String paymentID = BL.DB.ExecuteScalar("SELECT id  FROM payments WHERE payment_type=5 LIMIT 1").ToString();

            BL.CurrentTransaction.AddPayment(int.Parse(paymentID), 0, 0, SafeConvert.ToDecimal(x_monto.Text));
            ArrayList payments = BL.CurrentTransaction.GetItems(typeof(TransPayment));

            //pay.Data.Notes = payments.Count.ToString();
            foreach (TransPayment pay in payments)
            {
                if (pay.Data.Type.ToString() == "Cheque")
                {
                    if (pay.Data.Notes == "" || pay.Data.Notes == null)
                    {
                        pay.Data.Notes = all;
                        //pay.Data.Description = "PAY Type: " + pay.Data.Type.ToString() + ") " + pay.Data.Description + "\n" + campos[0];
                    }
                }
            }
        }
示例#6
0
 public static decimal _ToDecimal(this object obj)
 {
     return(SafeConvert.ToDecimal(obj));
 }
示例#7
0
        protected bool GetData()
        {
            UserBLL userbll = new UserBLL();

            //获取项目信息
            model = bll.GetProjectDetailInfo(projectId.Value);
            if (model == null)
            {
                Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx");
                return(false);
            }
            borrowerUserInfo    = userbll.GetUserBasicInfoModelById(model.UserId.Value);
            borrowerUserInfoExt = userbll.GetUserBasicInfoExtInfo(model.UserId.Value);

            this.GetBorrowerData();

            InterestRateNum1 = ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[0];
            InterestRateNum2 = ToolStatus.DeleteZero(model.InterestRate.Value).Contains(".") ? ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[1] : string.Empty;
            if (model.Status != 3 && model.Status != 6)
            {
                RemainMoney = (int.Parse(ToolStatus.diff(model.TotalShares ?? 0, model.CastedShares ?? 0)) * decimal.Parse(ToolStatus.DeleteZero(model.LowerUnit.Value))).ToString("N2");
            }
            else
            {
                RemainMoney = "0";
            }
            finishProcess      = CommUtils.GetProjectProcess(model);
            SubscribeUserCount = CommUtils.GetSubscribeUserCount(this.projectId.Value);
            //计算预期收益
            PreInterestRate  = CommUtils.CalcInvestInterest(model, 10000);
            EbaoMultiple     = int.Parse(Math.Ceiling(model.InterestRate.Value / decimal.Parse("2.5")).ToString());
            EbaoInterest     = CommUtils.GetEbaoMultipleInterest(model, 10000);
            preSubscribeList = CommUtils.GetPreSubscribeDetail(model, 10000);

            List <SubscribeTotalInfo> repaylist = new SubscribeBLL().GetRepaymentInfo(this.projectId.Value);

            if (repaylist != null && repaylist.Count > 0)
            {
                foreach (SubscribeTotalInfo item in repaylist)
                {
                    switch (item.status)
                    {
                    case 1:
                        repayedAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 2:
                        overdueAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 3:
                        duerepayAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;
                    }
                }
            }

            string jzsql     = "select isnull(AvgNetAssets,0) from VipMonthlyNetAssets with(nolock) where UserId=@UserId and ReportDate=@ReportDate";
            var    dyParamJZ = new Dapper.DynamicParameters();

            dyParamJZ.Add("@UserId", model.UserId.Value);
            dyParamJZ.Add("@ReportDate", DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01"));
            this.monthJZ = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal>(TdConfig.ApplicationName, TdConfig.DBReportWrite, jzsql, ref dyParamJZ);

            regulaSet     = new WebSettingBLL().GetWebSettingInfo("293A1C07-1D90-4D22-ADD4-39E6735DAC06");
            InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);


            //  截标时间为NULL时候取审核时间  +4 天
            if (model.TenderDate == null)
            {
                WebSettingInfo set = new WebSettingBLL().GetWebSettingInfo("3F902315-6986-44FF-9F00-9D420C07FCDA");
                if (model.AddDate >= Convert.ToDateTime(set.Param4Value))
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(2);
                }
                else
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(4);
                }
            }


            if (model.AuditDate == null)
            {
                model.TenderStartDate = model.AddDate;
            }
            else
            {
                model.TenderStartDate = model.AuditDate;
            }

            return(true);
        }