public ActionResult _DeleteSubFamily(Int32?SubFamilyId) { var model = new _DeleteSubFamilyViewModel(); model.Fill(CargarDatosContext(), SubFamilyId); return(View(model)); }
public ActionResult _DeleteSubFamily(_DeleteSubFamilyViewModel model) { SubFamily SubFamily = null; if (model.SubFamilyId.HasValue) { SubFamily = context.SubFamily.FirstOrDefault(x => x.SubFamilyId == model.SubFamilyId); SubFamily.State = ConstantHelpers.ESTADO.INACTIVO; } context.SaveChanges(); PostMessage(MessageType.Success); return(RedirectToAction("ListSubFamily")); }