public ActionResult Crear(ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Llave1 Registro) { try { this.TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); } if (String.IsNullOrEmpty(Registro.LL1_Descripcion)) { ModelState.AddModelError("LL1_Descripcion", "Campo Requerido"); } if (ModelState.IsValid) { try { Registro.BS_Activo = true; OBJTVI_Llave1 = new ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Llave1(); OBJTVI_Llave1 = TVI_Llave1Proxy.Crear(Registro); if (OBJTVI_Llave1.Llave1_ID == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ViewBag.Error = "OK"; } catch (Exception ex) { ViewBag.Error = ex.Message; } } return(View(Registro)); }
public ActionResult Editar(int Llave1_ID) { try { this.TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); } OBJTVI_Llave1 = TVI_Llave1Proxy.GetByID(Llave1_ID); if (OBJTVI_Llave1 == null) { return(HttpNotFound()); } return(View(OBJTVI_Llave1)); }
public ActionResult Editar(ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Direcciones Registro) { try { this.TVI_DireccionesProxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); } if (ModelState.IsValid) { try { TVI_DireccionesProxy.Editar(Registro); ViewBag.Error = "OK"; } catch (Exception ex) { ViewBag.Error = ex.Message; } } ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"]; int cantLlaves = CompanyInfo.CantLlaves; ViewBag.DescLlave1 = CompanyInfo.LabelLlave1; ViewBag.DescLlave2 = CompanyInfo.LabelLlave2; ViewBag.DescLlave3 = CompanyInfo.LabelLlave3; ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave2Business TVI_Llave2Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave2Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave3Business TVI_Llave3Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave3Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); switch (cantLlaves) { case 1: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(Registro.Llave1_ID).LL1_Descripcion; return(View("Editar1", Registro)); case 2: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(Registro.Llave1_ID).LL1_Descripcion; ViewBag.Llave2_ID = TVI_Llave2Proxy.GetByID(Registro.Llave2_ID).LL2_Descripcion; return(View("Editar2", Registro)); case 3: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(Registro.Llave1_ID).LL1_Descripcion; ViewBag.Llave2_ID = TVI_Llave2Proxy.GetByID(Registro.Llave2_ID).LL2_Descripcion; ViewBag.Llave3_ID = TVI_Llave3Proxy.GetByID(Registro.Llave3_ID).LL3_Descripcion; return(View("Editar3", Registro)); } return(View(Registro)); }
public ActionResult RefreshDataSearchList(FormCollection Form) { int Estatus = Convert.ToInt32(Form["FindEstatus"]); try { this.TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); } ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); List <ADESCOMBUSINESS.Areas.Configuracion.Models.VwTVI_Llave1> Lista = new List <ADESCOMBUSINESS.Areas.Configuracion.Models.VwTVI_Llave1>(); Lista = TVI_Llave1Proxy.GetByFilters(Estatus); ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"]; ViewBag.Llave1_Descripcion = CompanyInfo.DescLlave1; ViewBag.Llave1_Etiqueta = CompanyInfo.LabelLlave1; return(View("RefreshData", Lista)); }
public ActionResult Editar(int Direccion_ID) { try { this.TVI_DireccionesProxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); } OBJTVI_Direcciones = TVI_DireccionesProxy.GetByID(Direccion_ID); if (OBJTVI_Direcciones == null) { return(HttpNotFound()); } ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"]; int cantLlaves = CompanyInfo.CantLlaves; ViewBag.DescLlave1 = CompanyInfo.LabelLlave1; ViewBag.DescLlave2 = CompanyInfo.LabelLlave2; ViewBag.DescLlave3 = CompanyInfo.LabelLlave3; ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business TVI_Llave1Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave1Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave2Business TVI_Llave2Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave2Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave3Business TVI_Llave3Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave3Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); switch (cantLlaves) { case 1: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(OBJTVI_Direcciones.Llave1_ID).LL1_Descripcion; return(View("Editar1", OBJTVI_Direcciones)); case 2: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(OBJTVI_Direcciones.Llave1_ID).LL1_Descripcion; ViewBag.Llave2_ID = TVI_Llave2Proxy.GetByID(OBJTVI_Direcciones.Llave2_ID).LL2_Descripcion; return(View("Editar2", OBJTVI_Direcciones)); case 3: ViewBag.Llave1_ID = TVI_Llave1Proxy.GetByID(OBJTVI_Direcciones.Llave1_ID).LL1_Descripcion; ViewBag.Llave2_ID = TVI_Llave2Proxy.GetByID(OBJTVI_Direcciones.Llave2_ID).LL2_Descripcion; ViewBag.Llave3_ID = TVI_Llave3Proxy.GetByID(OBJTVI_Direcciones.Llave3_ID).LL3_Descripcion; return(View("Editar3", OBJTVI_Direcciones)); } return(null); }