public async Task <IActionResult> OnPost() { dataFilter = JsonConvert.SerializeObject(filter); Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Owner = User.Claims.Where(x => x.Type == "Owner").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); TipoParticipante = Participant; //var listaClientes = await _peopleService.GetLsitEmailClientConfirmant(Confirmant); //----------- Llenado de Country if (HttpContext.Session.GetString("CountryIdentifications") == null || HttpContext.Session.GetString("CountryIdentifications") == "" || HttpContext.Session.GetString("CountryIdentifications") == "null") { Identifications = await _globalService.ConsultasCountryTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); } else { Identifications = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); } //----------- Llenado de Country Debtor_Options = new List <SelectListItem>(); Email_options = new List <SelectListItem>(); Currency_options = new List <SelectListItem>(); listadosInicialesJson = JsonConvert.SerializeObject(Identifications); return(Page()); }
public async Task <IActionResult> OnGetAsync() { var token = HttpContext.Session.GetString("token"); if (token == null || token == "" || token == "null") { return(RedirectToPage("/logout")); } Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); TipoParticipante = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Debtor_Options = new List <SelectListItem>(); Email_options = new List <SelectListItem>(); Currency_options = new List <SelectListItem>(); Status_Options = new List <SelectListItem>(); ListStatus(); //----------- Llenado de Country if (HttpContext.Session.GetString("CountryIdentifications") == null || HttpContext.Session.GetString("CountryIdentifications") == "" || HttpContext.Session.GetString("CountryIdentifications") == "null") { Identifications = await _globalService.ConsultasCountryTF(new ParamCountry { Id = Int32.Parse(Country) }); HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); } else { Identifications = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); } //----------- Llenado de Country filter = new List <filterInvoice>(); financiedNull = new List <bool?>(); dataFilter = new List <string>(); for (var i = 0; i < Identifications.Currencies.Count; i++) { filter.Add(new filterInvoice() { Financied = null }); financiedNull.Add(null); dataFilter.Add(JsonConvert.SerializeObject(filter[i])); } dataJsonCurrencies = JsonConvert.SerializeObject(Identifications.Currencies); listadosInicialesJson = JsonConvert.SerializeObject(Identifications); return(Page()); }
private void loadcountry() { try { DataTable dt = (DataTable)((DataSet)continent.continent_retriveBAL()).Tables[0]; ListCountry.DataSource = dt; ListCountry.DataTextField = "country"; ListCountry.DataValueField = "id"; ListCountry.DataBind(); ListCountry.Items.Insert(0, new ListItem("Select Country", "0")); } catch (Exception ex) { ErrorReportBAL error = new ErrorReportBAL(); error.SendErrorReport("JoinUs.aspx", ex.ToString()); Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>"); } }
public async Task <IActionResult> OnGetAsync() { var token = HttpContext.Session.GetString("token"); if (token == null || token == "" || token == "null") { return(RedirectToPage("/logout")); } filter = new filterInvoice() { Financied = null }; dataFilter = JsonConvert.SerializeObject(filter); financiedNull = null; TipoParticipante = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Debtor_Options = new List <SelectListItem>(); Email_options = new List <SelectListItem>(); Currency_options = new List <SelectListItem>(); //----------- Llenado de Country if (HttpContext.Session.GetString("CountryIdentifications") == null || HttpContext.Session.GetString("CountryIdentifications") == "" || HttpContext.Session.GetString("CountryIdentifications") == "null") { Identifications = await _globalService.ConsultasCountryTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); } else { Identifications = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); } //----------- Llenado de Country listadosInicialesJson = JsonConvert.SerializeObject(Identifications); return(Page()); }
public async Task <JsonResult> OnPostSelectCity([FromBody] GlobalRegister Region) { ListCountry country = await _globalService.ConsultaCitiesTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]), Region = Region.State }); return(new JsonResult(country.Regions[0].Cities)); }
public async Task <IActionResult> OnGetAsync() { var token = HttpContext.Session.GetString("token"); if (token == null || token == "" || token == "null") { return(RedirectToPage("/logout")); } Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); //----------- Llenado de Country /* * if (HttpContext.Session.GetString("CountryIdentifications") == null || * HttpContext.Session.GetString("CountryIdentifications") == "" || * HttpContext.Session.GetString("CountryIdentifications") == "null") * { * Identifications = await _globalService.ConsultaRegiosAndCitiesTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); * HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); * } * else Identifications = JsonConvert.DeserializeObject<ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); */ //----------- Llenado de Country Identifications = await _globalService.ConsultaRegiosAndCitiesTF(new ParamCountry { Id = Int32.Parse(Country) }); City_Options = new List <SelectListItem>(); Status_Options = new List <SelectListItem>(); Status_Options.Add(new SelectListItem() { Value = "0", Text = "Activo" }); Status_Options.Add(new SelectListItem() { Value = "1", Text = "Bloqueado" }); Discriminator_options = new List <SelectListItem>(); Discriminator_options.Add(new SelectListItem() { Value = "LEGAL", Text = "Persona Legal" }); Discriminator_options.Add(new SelectListItem() { Value = "PERSON", Text = "Persona Natural" }); Participant_options = new List <SelectListItem>() { new SelectListItem() { Value = "DEBTOR", Text = "EMPRESAS" }, new SelectListItem() { Value = "SUPPLIER", Text = "PROVEEDORES" }, new SelectListItem() { Value = "CONFIRMANT", Text = "BANCOS" }, new SelectListItem() { Value = "FACTOR", Text = "INVERSIONISTAS" } }; //Para llenar El filtro de Estados State_Options = new List <SelectListItem>(); foreach (var state in Identifications.Regions) { State_Options.Add(new SelectListItem() { Value = state.id.ToString(), Text = state.Name }); } filter = new List <filterInvoice>(); financiedNull = new List <bool?>(); dataFilter = new List <string>(); for (var i = 0; i < Identifications.Currencies.Count; i++) { filter.Add(new filterInvoice() { Financied = null }); financiedNull.Add(null); dataFilter.Add(JsonConvert.SerializeObject(filter[i])); } //filter = new filterInvoice() { Financied = false }; dataJsonCurrencies = JsonConvert.SerializeObject(Identifications.Currencies); listadosInicialesJson = JsonConvert.SerializeObject(Identifications); return(Page()); }
public async Task <JsonResult> OnPostDetalleCliente([FromBody] Prospecto person) { DetallesClientes detallesClientes = new DetallesClientes(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); ListCountry Pais = new ListCountry(); filterInvoice PeopleId = new filterInvoice(); PeopleId.Id = person.Id; person = await _peopleService.RegisterById(new ParamProspecto { Filter = PeopleId, Country = int.Parse(Country) }); if (person.Error == null) { detallesClientes.Error = person.Error; var id = User.Claims.Where(x => x.Type == "Id").Select(x => x.Value).SingleOrDefault(); var l = await _aS.RefreshToken(id, CultureInfo.CurrentCulture.Name, Participant, token); if (l.Error == null) { HttpContext.Session.SetString("token", l.Token); } } if (person.Addresses != null) { Pais = await _globalService.ConsultaIdentificationsAndCitiesTF(new ParamCountry { Id = int.Parse(Country), Region = person.Addresses[0].Region }); } if (Pais.Identifications != null) { foreach (var iden in Pais.Identifications) { if (person.Documents != null) { if (iden.Id == person.Documents[0].Identification && iden.Prefix == false) { detallesClientes.Document.Abbreviation = iden.Abbreviation; detallesClientes.Document.Number = person.Documents[0].Number; } else if (iden.Id == person.Documents[0].Identification && iden.Prefix == true) { foreach (var prefx in iden.Prefixes) { if (prefx.Id == person.Documents[0].Prefix) { detallesClientes.Document.Abbreviation = prefx.Abbreviation; detallesClientes.Document.Number = person.Documents[0].Number; } } } } if (person.Contacts != null) { foreach (var contacto in person.Contacts) { if (contacto.Label == "LEGAL") { detallesClientes.Representante.DocumentNumber = contacto.DocumentNumber; detallesClientes.Representante.Name = contacto.Name; detallesClientes.Representante.PhoneNumber = contacto.PhoneNumber; detallesClientes.Representante.Email = contacto.Email; if (iden.Id == contacto.Identification && iden.Prefix == false) { detallesClientes.Representante.Label = iden.Abbreviation; } else if (iden.Id == contacto.Identification && iden.Prefix == true) { foreach (var prefx in iden.Prefixes) { if (prefx.Id == contacto.Prefix) { detallesClientes.Representante.Label = prefx.Abbreviation; } } } } else if (contacto.Label == "CONTACT") { detallesClientes.Contacto.DocumentNumber = contacto.DocumentNumber; detallesClientes.Contacto.Name = contacto.Name; detallesClientes.Contacto.PhoneNumber = contacto.PhoneNumber; detallesClientes.Contacto.Email = contacto.Email; if (iden.Id == contacto.Identification && iden.Prefix == false) { detallesClientes.Contacto.Label = iden.Abbreviation; } else if (iden.Id == contacto.Identification && iden.Prefix == true) { foreach (var prefx in iden.Prefixes) { if (prefx.Id == contacto.Prefix) { detallesClientes.Contacto.Label = prefx.Abbreviation; } } } } } } } } if (Pais.Regions != null) { foreach (var city in Pais.Regions[0].Cities) { if (person.Addresses[0].City == city.Id) { detallesClientes.Address.Region = Pais.Regions[0].Name; detallesClientes.Address.City = city.Name; continue; } } } detallesClientes.Company = person.Company; if (person.Phones != null) { detallesClientes.Phone = person.Phones[0].Number; } else { detallesClientes.Phone = null; } if (person.Addresses != null) { detallesClientes.Address.Line1 = person.Addresses[0].Line1; detallesClientes.Address.Line2 = person.Addresses[0].Line2; } if (detallesClientes.Contacto.DocumentNumber == null || detallesClientes.Contacto.DocumentNumber == "") { detallesClientes.Contacto = null; } if (person.Discriminator == "PERSON") { detallesClientes.Company = person.FirstName; /* * detallesClientes.Representante.Label = detallesClientes.Document.Abbreviation; * detallesClientes.Representante.DocumentNumber = detallesClientes.Document.Number; * detallesClientes.Representante.Name = person.FirstName; * detallesClientes.Representante.PhoneNumber = person.Phones[0].Number; */ if (person.Emails != null) { detallesClientes.Email = person.Emails[0].Address; } detallesClientes.Representante = null; detallesClientes.Contacto = null; } return(new JsonResult(detallesClientes)); }
public async Task <IActionResult> OnPost() { Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); //var listaClientes = await _peopleService.GetLsitEmailClientConfirmant(Confirmant); //----------- Llenado de Country if (HttpContext.Session.GetString("CountryIdentifications") == null || HttpContext.Session.GetString("CountryIdentifications") == "" || HttpContext.Session.GetString("CountryIdentifications") == "null") { Identifications = await _globalService.ConsultasCountryTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); } else { Identifications = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); } //----------- Llenado de Country listadosInicialesJson = JsonConvert.SerializeObject(Identifications); dataJsonCurrencies = JsonConvert.SerializeObject(Identifications.Currencies); City_Options = new List <SelectListItem>(); Discriminator_options = new List <SelectListItem>() { new SelectListItem() { Value = "LEGAL", Text = "Persona Legal" }, new SelectListItem() { Value = "PERSON", Text = "Persona Natural" } }; Participant_options = new List <SelectListItem>() { new SelectListItem() { Value = "DEBTOR", Text = "EMPRESAS" }, new SelectListItem() { Value = "SUPPLIER", Text = "PROVEEDORES" }, new SelectListItem() { Value = "CONFIRMANT", Text = "BANCOS" }, new SelectListItem() { Value = "FACTOR", Text = "INVERSIONISTAS" } }; //Para llenar El filtro de Estados State_Options = new List <SelectListItem>(); foreach (var state in Identifications.Regions) { State_Options.Add(new SelectListItem() { Value = state.id.ToString(), Text = state.Name }); if (state.Cities != null) { foreach (var city in state.Cities) { City_Options.Add(new SelectListItem() { Value = city.Id.ToString(), Text = city.Name }); } } } financiedNull = new List <bool?>(); for (var i = 0; i < filter.Count; i++) { dataFilter.Add(JsonConvert.SerializeObject(filter[i])); financiedNull.Add(filter[i].Financied); } return(Page()); }
public async Task <IActionResult> OnGetAsync() { var token = HttpContext.Session.GetString("token"); if (token == null || token == "" || token == "null") { return(RedirectToPage("/logout", "session expired", new { returnUrl = "~/index?error=sessionExpired" })); } filter = new filterInvoice() { Financied = false }; dataFilter = JsonConvert.SerializeObject(filter); financiedNull = null; Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); //----------- Llenado de Country if (HttpContext.Session.GetString("CountryIdentifications") == null || HttpContext.Session.GetString("CountryIdentifications") == "" || HttpContext.Session.GetString("CountryIdentifications") == "null") { Identifications = await _globalService.ConsultaRegiosAndCitiesTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); HttpContext.Session.SetString("CountryIdentifications", JsonConvert.SerializeObject(Identifications)); } else { Identifications = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryIdentifications")); } //----------- Llenado de Country City_Options = new List <SelectListItem>(); Status_Options = new List <SelectListItem>(); Status_Options.Add(new SelectListItem() { Value = "0", Text = "Activo" }); Status_Options.Add(new SelectListItem() { Value = "1", Text = "Bloqueado" }); Discriminator_options = new List <SelectListItem>(); Discriminator_options.Add(new SelectListItem() { Value = "LEGAL", Text = "Persona Legal" }); Discriminator_options.Add(new SelectListItem() { Value = "PERSON", Text = "Persona Natural" }); Participant_options = new List <SelectListItem>() { new SelectListItem() { Value = "DEBTOR", Text = "EMPRESAS" }, new SelectListItem() { Value = "SUPPLIER", Text = "PROVEEDORES" }, new SelectListItem() { Value = "FACTOR", Text = "INVERSIONISTAS" } }; //Para llenar El filtro de Estados State_Options = new List <SelectListItem>(); foreach (var state in Identifications.Regions) { State_Options.Add(new SelectListItem() { Value = state.id.ToString(), Text = state.Name }); } State_Options.Sort((a, b) => a.Text.CompareTo(b.Text)); listadosInicialesJson = JsonConvert.SerializeObject(Identifications); return(Page()); }
public async Task <JsonResult> OnPostDetalleAsync([FromBody] Prospecto person) { Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); DetallesClientes detallesClientes = new DetallesClientes(); ListCountry Pais = new ListCountry(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); var token = HttpContext.Session.GetString("token"); filterInvoice PeopleId = new filterInvoice(); PeopleId.Id = person.Id; person = await _peopleService.GetDetalleClientConfirmant(new ParamProspecto { Filter = PeopleId, Country = int.Parse(Country) }, token); if (person.Error == null) { detallesClientes.Error = person.Error; var id = User.Claims.Where(x => x.Type == "Id").Select(x => x.Value).SingleOrDefault(); var l = await _aS.RefreshToken(id, CultureInfo.CurrentCulture.Name, Participant, token, Confirmant); if (l.Error == null) { HttpContext.Session.SetString("token", l.Token); } } //----------- Llenado de Country if (person.Addresses != null && person.Addresses.Count > 0) { Pais = await _globalService.ConsultaIdentificationsAndCitiesTF(new ParamCountry { Id = int.Parse(Country), Region = person.Addresses[0].Region }); } else { Pais = await _globalService.ConsultasCountryTF(new ParamCountry { Id = int.Parse(Country) }); } //----------- Llenado de Country foreach (var iden in Pais.Identifications) { if (iden.Id == person.Documents[0].Identification && iden.Prefix == false) { detallesClientes.Document.Abbreviation = iden.Abbreviation; detallesClientes.Document.Number = person.Documents[0].Number; } if (person.Contacts != null) { foreach (var contacto in person.Contacts) { if (contacto.Label == "LEGAL") { detallesClientes.Representante.DocumentNumber = contacto.DocumentNumber; detallesClientes.Representante.Name = contacto.Name; detallesClientes.Representante.PhoneNumber = contacto.PhoneNumber; detallesClientes.Representante.Email = contacto.Email; if (iden.Id == contacto.Identification && iden.Prefix == false) { detallesClientes.Representante.Label = iden.Abbreviation; } else if (iden.Id == contacto.Identification && iden.Prefix == true) { foreach (var prefx in iden.Prefixes) { if (prefx.Id == contacto.Prefix) { detallesClientes.Representante.Label = prefx.Abbreviation; } } } } else if (contacto.Label == "CONTACT") { detallesClientes.Contacto.DocumentNumber = contacto.DocumentNumber; detallesClientes.Contacto.Name = contacto.Name; detallesClientes.Contacto.PhoneNumber = contacto.PhoneNumber; detallesClientes.Contacto.Email = contacto.Email; if (iden.Id == contacto.Identification && iden.Prefix == false) { detallesClientes.Contacto.Label = iden.Abbreviation; } else if (iden.Id == contacto.Identification && iden.Prefix == true) { foreach (var prefx in iden.Prefixes) { if (prefx.Id == contacto.Prefix) { detallesClientes.Contacto.Label = prefx.Abbreviation; } } } } } } } if (Pais.Regions != null && Pais.Regions.Count > 0) { if (Pais.Regions[0].Cities != null && Pais.Regions[0].Cities.Count > 0) { foreach (var city in Pais.Regions[0].Cities) { if (person.Addresses[0].City == city.Id) { detallesClientes.Address.Region = Pais.Regions[0].Name; detallesClientes.Address.City = city.Name; continue; } } } } detallesClientes.Company = person.Company; detallesClientes.Phone = person.Phones[0].Number; detallesClientes.Address.Line1 = person.Addresses[0].Line1; detallesClientes.Address.Line2 = person.Addresses[0].Line2; if (person.Quotas != null) { if (person.Quotas.Count > 0) { person.Quotas = person.Quotas.OrderBy(x => x.Currency != Pais.Currency.Id).ToList(); } foreach (var limite in person.Quotas) { if (limite.Entity.Id == Confirmant) { if (limite.Abbreviation == "CREDIT" || limite.Abbreviation == "FINANCING") { foreach (var coin in Pais.Currencies) { if (coin.Id == limite.Currency) { detallesClientes.LimiteCredito.Currency = coin.Symbol; //detallesClientes.LimiteCredito.Abbreviation = coin.Iso_4217; var limiteCredit = new LimiteCredito() { Iso_4217 = coin.Iso_4217, Currency = coin.Symbol, Abbreviation = limite.Abbreviation, Available = limite.Available, Usage = limite.Usage }; detallesClientes.LimiteCreditoList.Add(limiteCredit); } } detallesClientes.LimiteCredito.Abbreviation = limite.Abbreviation; detallesClientes.LimiteCredito.Available = limite.Available; detallesClientes.LimiteCredito.Usage = limite.Usage; } } } } else { detallesClientes.LimiteCredito = null; } if (person.Accounts != null) { int limite = person.Accounts.Count; foreach (var moneda in Pais.Currencies) { foreach (var cuenta in person.Accounts) { if (moneda.Id == cuenta.Currency && Confirmant == cuenta.Entity.Id && cuenta.Status == true) { var a = new CuentaBancaria(); foreach (var bank in Pais.Entities) { if (bank.Id == cuenta.Entity.Id) { a.Entity = bank.Person.Name; } } a.Simbol = moneda.Iso_4217; a.AccountNumber = cuenta.AccountNumber; a.AccountType = cuenta.AccountType; detallesClientes.AccountsList.Add(a); continue; } } } } else { detallesClientes.CuentaBancaria = null; } if (detallesClientes.Contacto.DocumentNumber == null || detallesClientes.Contacto.DocumentNumber == "") { detallesClientes.Contacto = null; } if (person.Discriminator == "PERSON") { detallesClientes.Company = person.FirstName; if (person.Emails != null) { detallesClientes.Email = person.Emails[0].Address; } detallesClientes.Representante = null; detallesClientes.Contacto = null; } return(new JsonResult(detallesClientes)); }