コード例 #1
0
        public async Task <string> GenerateBankLayoutPeriod(BankLayoutPaymentInformation bankLayoutPaymentInformation)
        {
            var fileName = bankLayoutPaymentInformation.BankName + bankLayoutPaymentInformation.PeriodDescription.Replace(" ", String.Empty) + ".txt";
            //obtener overdrafts
            var statusOverdraft = new List <OverdraftStatus>()
            {
                OverdraftStatus.Authorized,
                OverdraftStatus.None,
                OverdraftStatus.Stamped
            };

            var overdrafts = await GetOverdraftsAsync(bankLayoutPaymentInformation.InstanceID, bankLayoutPaymentInformation.IdentityWorkID,
                                                      bankLayoutPaymentInformation.PeriodDetailID, statusOverdraft, Int32.Parse(bankLayoutPaymentInformation.BankCode));

            if (overdrafts.Count <= 0)
            {
                throw new CotorraException(801, "801", "No hay colaboradores con el banco seleccionado." + Environment.NewLine + "Asegurate de asignar el banco y cuenta correspondiente desde Colaboradores.", null);
            }

            //genera objeto para generar layout
            (var bankLayoutManager, var additionalInformation) = await new BankPaymentLayoutManagerFactory().GetBankPaymentLayoutManager(bankLayoutPaymentInformation);

            //genera layout string
            var layoutString = bankLayoutManager.GenerateLayout(overdrafts, additionalInformation);

            //escribir en bloob
            var urlLayout = await new TXTWriterBlob().WriteAsync(bankLayoutPaymentInformation.InstanceID, fileName, layoutString);

            //regresar string uri
            return(urlLayout);
        }
コード例 #2
0
        public async Task <JsonResult> GenerateLayout(BankLayoutPaymentInformation layoutInformation)
        {
            var parameters = layoutInformation;

            parameters.IdentityWorkID = SessionModel.CompanyID;
            parameters.InstanceID     = SessionModel.InstanceID;
            parameters.TokeUser       = SessionModel.AuthorizationHeader;

            var urlLayout = await client.GenerateBankLayoutPeriod(parameters);

            return(Json(urlLayout));
        }
コード例 #3
0
        public async Task <(IBankPaymentLayoutManager, IBankAdditionalInformation)> GetBankPaymentLayoutManager(BankLayoutPaymentInformation layoutInformation)
        {
            var instanceMgr = new InstanceManager();
            var instance    = await instanceMgr.GetByIDAsync(layoutInformation.TokeUser, layoutInformation.InstanceID);

            switch (layoutInformation.BankCode)
            {
            case BANAMEX:
                layoutInformation.BankExtraParams.Banamex.CompanyName = instance.Name;
                return(new BanamexPaymentLayoutManager(), layoutInformation.BankExtraParams.Banamex);

            case BANORTE:
                layoutInformation.BankExtraParams.Banorte.CompanyName = instance.Name;
                return(new BanortePaymentLayoutManager(), layoutInformation.BankExtraParams.Banorte);

            case SANTANDER:
                return(new SantanderPaymentLayoutManager(), layoutInformation.BankExtraParams.Santander);

            case BBVA:
                return(new BBVAPaymentLayoutManager(), null);

            case SCOTIABANK:
                return(new ScotiabankPaymentLayoutManager(), layoutInformation.BankExtraParams.Scotiabank);

            case HSBC:
                return(new HSBCPaymentLayoutManager(), null);

            default:
                throw new ArgumentException("Banco no manejado para la dispersión");
            }
        }
コード例 #4
0
 public Task <string> GenerateBankLayoutPeriod(BankLayoutPaymentInformation bankLayoutPaymentInformation)
 {
     return(_client.GenerateBankLayoutPeriod(bankLayoutPaymentInformation));
 }
コード例 #5
0
        public async Task <string> GenerateBankLayoutPeriod(BankLayoutPaymentInformation bankLayoutPaymentInformation)
        {
            var urlLayout = await new BankPaymentLayoutManager().GenerateBankLayoutPeriod(bankLayoutPaymentInformation);

            return(urlLayout);
        }
コード例 #6
0
 public Task <string> GenerateBankLayoutPeriod(BankLayoutPaymentInformation bankLayoutPaymentInformation)
 {
     throw new NotSupportedException("Try local");
 }