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); }
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)); } }
public ActionResult guardar(MA_ESPECIALIDAD entity) { return(Json(repository.create(entity), JsonRequestBehavior.AllowGet)); }