public ActionResult Editar(string id) { BadLanguageBL oBL = new BadLanguageBL(); int pIntID = 0; int.TryParse(id, out pIntID); BadLanguageViewModel pBadLanguageViewModel = oBL.Obtener(pIntID); return(View(pBadLanguageViewModel)); }
public void Modificar(BadLanguageViewModel pBadLanguageViewModel) { bad_languages obad_languages = oRepositorio.FindById(pBadLanguageViewModel.bad_language_id); obad_languages.name = pBadLanguageViewModel.name; obad_languages.user_id_modified = pBadLanguageViewModel.user_id_modified; obad_languages.date_modified = DateTime.Now; oRepositorio.Update(obad_languages); oUnitOfWork.SaveChanges(); }
public void Agregar(BadLanguageViewModel pBadLanguageViewModel) { bad_languages obad_languages = new bad_languages { bad_language_id = 0, name = pBadLanguageViewModel.name, date_created = DateTime.Now, user_id_created = pBadLanguageViewModel.user_id_created }; oRepositorio.Add(obad_languages); oUnitOfWork.SaveChanges(); }
public ActionResult Editar([Bind(Include = "bad_language_id,name")] BadLanguageViewModel pBadLanguageViewModel) { // TODO: Add insert logic here if (pBadLanguageViewModel == null) { return(HttpNotFound()); } BadLanguageBL oBadLanguageBL = new BadLanguageBL(); pBadLanguageViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id; oBadLanguageBL.Modificar(pBadLanguageViewModel); return(RedirectToAction("Index")); }