Ejemplo n.º 1
0
        public List <MA_ESPECIALIDAD> litarEspecialidad()
        {
            List <MA_ESPECIALIDAD> lista = new List <MA_ESPECIALIDAD>();
            Database  db  = DatabaseFactory.CreateDatabase(ConfigurationManager.AppSettings["conecion"]);
            DbCommand cmd = db.GetStoredProcCommand("MA_SP_LISTAR_ESPECIALIDAD_CBO");

            using (IDataReader lee = db.ExecuteReader(cmd))
            {
                while (lee.Read())
                {
                    MA_ESPECIALIDAD entity = new MA_ESPECIALIDAD();
                    entity.I_COD_ESPECIALIDAD = Convert.ToInt32(lee["I_COD_ESPECIALIDAD"]);
                    entity.V_DES_ESPECIALIDAD = lee["V_DES_ESPECIALIDAD"].ToString();
                    lista.Add(entity);
                }
            }
            return(lista);
        }
Ejemplo n.º 2
0
 public ActionResult edit(MA_ESPECIALIDAD model)
 {
     if (ModelState.IsValid)
     {
         if (repository.edit(model) > 0)
         {
             //is action buil an url but reditorroute redirection a route create an global asax
             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));
     }
 }
Ejemplo n.º 3
0
 public ActionResult guardar(MA_ESPECIALIDAD entity)
 {
     return(Json(repository.create(entity), JsonRequestBehavior.AllowGet));
 }