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