public ActionResult ModificarTarjetaCredito(string idTarjetaCredito) { clsServicioCooperativa objServicioCooperativa = new clsServicioCooperativa(); List <SelectListItem> items = new List <SelectListItem>(); List <SelectListItem> items1 = new List <SelectListItem>(); try { if (Session["login"] == null) { string strServicio = Session["cooperativa"].ToString(); lstTarjetaCredito = (List <clsTarjetaCredito>)Session["tarjetaCreditosRegistrados"]; clsTarjetaCredito objTarjetaCredito = lstTarjetaCredito.Find(x => x.idTarjetaCredito == int.Parse(idTarjetaCredito)); lstCuenta = objServicioCooperativa.ConsultarCuentas(strServicio); foreach (clsCuenta objCuenta in lstCuenta) { items.Add(new SelectListItem { Text = objCuenta.numeroCuenta, Value = objCuenta.idCuenta.ToString() }); } items1.Add(new SelectListItem { Text = "Mastercard", Value = "Mastercard" }); items1.Add(new SelectListItem { Text = "Visa", Value = "Visa" }); ViewBag.lstCuentas = items; ViewBag.lstTipoTarjetas = items1; if (objTarjetaCredito != null) { return(View(objTarjetaCredito)); } else { return(RedirectToAction("Error", "Home")); } } else { return(RedirectToAction("Login", "Home")); } } catch (Exception) { return(RedirectToAction("Error", "Home")); } }
public ActionResult AgregarTarjetaCredito() { clsServicioCooperativa objServicioCooperativa = new clsServicioCooperativa(); clsTarjetaCredito objTarjetaCredito = new clsTarjetaCredito(); List <SelectListItem> items = new List <SelectListItem>(); List <SelectListItem> items1 = new List <SelectListItem>(); string strServicio = Session["cooperativa"].ToString(); try { if (Session["login"] != null) { lstCuenta = objServicioCooperativa.ConsultarCuentas(strServicio); foreach (clsCuenta objCuenta in lstCuenta) { items.Add(new SelectListItem { Text = objCuenta.numeroCuenta, Value = objCuenta.idCuenta.ToString() }); } items1.Add(new SelectListItem { Text = "Mastercard", Value = "Mastercard" }); items1.Add(new SelectListItem { Text = "Visa", Value = "Visa" }); ViewBag.lstCuentas = items; ViewBag.lstTipoTarjetas = items1; return(View(objTarjetaCredito)); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception) { return(RedirectToAction("Error", "Home")); } }
public ActionResult Cuentas(string strServicio) { Session["cooperativa"] = strServicio; clsServicioCooperativa objServicioCooperativa = new clsServicioCooperativa(); try { if (Session["login"] != null) { lstCuenta = objServicioCooperativa.ConsultarCuentas(strServicio); Session["cuentasRegistrados"] = lstCuenta; return(View("Cuentas", lstCuenta)); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception ex) { return(RedirectToAction("Error", "Home")); } }