public ActionResult RemoveContactor(int cid, int pid) { var m = new ContactorsModel(cid); m.RemoveContactor(pid); return Content("ok"); }
public ActionResult Contactors(int cid) { var m = new ContactorsModel(cid); return View(m); }
private void LoadContact(int id) { var u = DbUtil.Db.CurrentUser; var roles = u.UserRoles.Select(uu => uu.Role.RoleName.ToLower()).ToArray(); var ManagePrivateContacts = HttpContext.Current.User.IsInRole("ManagePrivateContacts"); var q = from c in DbUtil.Db.Contacts where (c.LimitToRole ?? "") == "" || roles.Contains(c.LimitToRole) || ManagePrivateContacts where c.ContactId == id select c; contact = q.SingleOrDefault(); if (contact == null) return; MinisteredTo = new ContacteesModel(id); Ministers = new ContactorsModel(id); MinisteredTo.CanViewComments = CanViewComments; Ministers.CanViewComments = CanViewComments; }