public ActionResult edit(MA_CARRERA_PROFESIONALES model)
 {
     if (ModelState.IsValid)
     {
         if (repository.edit(model) > 0)
         {
             return(RedirectToAction("index"));
         }
         else
         {
             ModelState.AddModelError("", "Ocurrrio un erro internamente comuniquese con la area de Sistemas con J.Salinas");
             return(View(model));
         }
     }
     else
     {
         return(View(model));
     }
 }
Пример #2
0
        public List <MA_CARRERA_PROFESIONALES> listarCarrerasProfesionales()
        {
            List <MA_CARRERA_PROFESIONALES> lista = new List <MA_CARRERA_PROFESIONALES>();

            Database  db  = DatabaseFactory.CreateDatabase(ConfigurationManager.AppSettings["conecion"]);
            DbCommand cmd = db.GetStoredProcCommand("MA_SP_LISTAR_CARRERAS_PROFESIONALES_CBO");

            using (IDataReader lee = db.ExecuteReader(cmd))
            {
                while (lee.Read())
                {
                    MA_CARRERA_PROFESIONALES entity = new MA_CARRERA_PROFESIONALES();
                    entity.I_COD_CARRERA_PROFESIONAL = Convert.ToInt32(lee["I_COD_CARRERA_PROFESIONAL"]);
                    entity.V_DES_CARRERA_PROFESIONAL = lee["V_DES_CARRERA_PROFESIONAL"].ToString();
                    lista.Add(entity);
                }
            }

            return(lista);
        }
 public ActionResult guardar(MA_CARRERA_PROFESIONALES entity)
 {
     return(Json(repository.create(entity), JsonRequestBehavior.AllowGet));
 }