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 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);
        }
        public ActionResult Editar(int Llave2_ID)
        {
            try { this.TVI_Llave2Proxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_Llave2Business((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJTVI_Llave2 = TVI_Llave2Proxy.GetByID(Llave2_ID);

            if (OBJTVI_Llave2 == null)
            {
                return(HttpNotFound());
            }

            return(View(OBJTVI_Llave2));
        }