public JsonResult Modify(GroupSite model) { try { if (model.Id == 0) { model.CreateDate = DateTime.Now; model.ModifyDate = DateTime.Now; groupService.InsertGroupSite(model); } else { var update = groupService.GetGroupSite(model.Id); update.GroupName = model.GroupName; update.Flag = model.Flag; update.ModifyDate = DateTime.Now; groupService.UpdateGroupSite(update); } groupService.Save(); return(Json(new MessageResults { Status = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new MessageResults { Status = "Error" }, JsonRequestBehavior.AllowGet)); } }
public void UpdateGroupSite(GroupSite group) { unitOfWork.GroupSiteRepository.Update(group); }
public void DeleteGroupSite(GroupSite group) { unitOfWork.GroupSiteRepository.Delete(group); }
public void InsertGroupSite(GroupSite group) { unitOfWork.GroupSiteRepository.Insert(group); }