public void Modificar(InvestigationGroupViewModel pInvestigationGroupViewModel) { investigation_groups oinvestigation_groups = oRepositorio.FindById(pInvestigationGroupViewModel.investigation_group_id); oinvestigation_groups.name = pInvestigationGroupViewModel.name; oinvestigation_groups.institution_id = pInvestigationGroupViewModel.institution_id; oinvestigation_groups.user_id_modified = pInvestigationGroupViewModel.user_id_modified; oinvestigation_groups.code = pInvestigationGroupViewModel.code; oinvestigation_groups.date_modified = DateTime.Now; oRepositorio.Update(oinvestigation_groups); oUnitOfWork.SaveChanges(); }
public ActionResult Editar([Bind(Include = "investigation_group_id,institution_id,name,code")] InvestigationGroupViewModel pInvestigationGroupViewModel) { // TODO: Add insert logic here if (pInvestigationGroupViewModel == null) { return(HttpNotFound()); } InvestigationGroupBL oInvestigationGroupBL = new InvestigationGroupBL(); pInvestigationGroupViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id; oInvestigationGroupBL.Modificar(pInvestigationGroupViewModel); return(RedirectToAction("Index")); }
public void Agregar(InvestigationGroupViewModel pInvestigationGroupViewModel) { investigation_groups oinvestigation_groups = new investigation_groups { investigation_group_id = 0, name = pInvestigationGroupViewModel.name, institution_id = pInvestigationGroupViewModel.institution_id, date_created = DateTime.Now, user_id_created = pInvestigationGroupViewModel.user_id_created, code = pInvestigationGroupViewModel.code }; oRepositorio.Add(oinvestigation_groups); oUnitOfWork.SaveChanges(); }
public ActionResult Editar(string id) { InvestigationGroupBL oBL = new InvestigationGroupBL(); int pIntID = 0; int.TryParse(id, out pIntID); InvestigationGroupViewModel pInvestigationGroupViewModel = oBL.Obtener(pIntID); SelectOptionItem oSelectOptionItem = new SelectOptionItem(); oSelectOptionItem.Text = pInvestigationGroupViewModel.institution; oSelectOptionItem.Value = pInvestigationGroupViewModel.institution_id.ToString(); var oLista = new List <SelectOptionItem>(); oLista.Add(oSelectOptionItem); List <SelectListItem> institutions = Helper.ConstruirDropDownList <SelectOptionItem>(oLista, "Value", "Text", "", true, "", ""); ViewBag.institutions = institutions; return(View(pInvestigationGroupViewModel)); }