Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }