public ActionResult Editar(string id) { EducationLevelBL oBL = new EducationLevelBL(); int pIntID = 0; int.TryParse(id, out pIntID); EducationLevelViewModel pEducationLevelViewModel = oBL.Obtener(pIntID); return(View(pEducationLevelViewModel)); }
public void Modificar(EducationLevelViewModel pEducationLevelViewModel) { education_levels oeducation_levels = oRepositorio.FindById(pEducationLevelViewModel.education_level_id); oeducation_levels.name = pEducationLevelViewModel.name; oeducation_levels.user_id_modified = pEducationLevelViewModel.user_id_modified; oeducation_levels.date_modified = DateTime.Now; oRepositorio.Update(oeducation_levels); oUnitOfWork.SaveChanges(); }
public void Agregar(EducationLevelViewModel pEducationLevelViewModel) { education_levels oeducation_levels = new education_levels { education_level_id = 0, name = pEducationLevelViewModel.name, date_created = DateTime.Now, user_id_created = pEducationLevelViewModel.user_id_created }; oRepositorio.Add(oeducation_levels); oUnitOfWork.SaveChanges(); }
public ActionResult Editar([Bind(Include = "education_level_id,name")] EducationLevelViewModel pEducationLevelViewModel) { // TODO: Add insert logic here if (pEducationLevelViewModel == null) { return(HttpNotFound()); } EducationLevelBL oEducationLevelBL = new EducationLevelBL(); pEducationLevelViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id; oEducationLevelBL.Modificar(pEducationLevelViewModel); return(RedirectToAction("Index")); }
public ActionResult Crear([Bind(Include = "education_level_id,name")] EducationLevelViewModel pEducationLevelViewModel) { // TODO: Add insert logic here if (pEducationLevelViewModel == null) { return(HttpNotFound()); } pEducationLevelViewModel.education_level_id = 0; pEducationLevelViewModel.user_id_created = AuthorizeUserAttribute.UsuarioLogeado().user_id; EducationLevelBL oBL = new EducationLevelBL(); oBL.Agregar(pEducationLevelViewModel); return(RedirectToAction("Index")); }