public ActionResult Create(aloTipoInput input) { if (!ModelState.IsValid) return PartialView("Create", input); var entity = UnitOfWork.AloTipoRepository.GetById(input.Id); entity.nombre = input.nombre; entity.restricFDStempAlta = input.restricFDStempAlta; entity.clase = input.clase; entity.croquis = input.croquis; entity.idSede_idSede = input.idSede; entity.restricFDStempAlta = input.restricFDStempAlta; UnitOfWork.AloTipoRepository.Update(entity); UnitOfWork.Save(); return Json(MapToGridModel(entity)); // returning grid model, used in grid.api.renderRow }
public ActionResult Edit(aloTipoInput input) { if (!ModelState.IsValid) return PartialView("Create", input); var entity = UnitOfWork.AloTipoRepository.GetById(input.Id); entity.nombre = input.nombre; entity.clase = input.clase; entity.croquis = input.croquis; entity.idSede_idSede = input.idSede; entity.restricFDStempAlta = input.restricFDStempAlta; UnitOfWork.AloTipoRepository.Update(entity); UnitOfWork.Save(); // returning the key to call grid.api.update return Json(new { entity.Id }); }
public ActionResult Edit(int id) { var entity = UnitOfWork.AloTipoRepository.GetById(id); var input = new aloTipoInput { Id = entity.Id, nombre = entity.nombre, clase = entity.clase, croquis = entity.croquis, idSede = entity.idSede_idSede, restricFDStempAlta = entity.restricFDStempAlta, }; return PartialView("Create", input); }