Пример #1
0
 public ActionResult ConvertContacteesToQuery(int cid)
 {
     Response.NoCache();
     var m = new ContacteesModel(cid);
     var gid = m.ConvertToQuery();
     return Redirect($"/Query/{gid}");
 }
Пример #2
0
        public ActionResult RemoveContactee(int cid, int pid)
        {
            var m = new ContacteesModel(cid);
            m.RemoveContactee(pid);
            return Content("ok");

        }
Пример #3
0
        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;

            ContactId = id;
            MinisteredTo = new ContacteesModel(id);
            Ministers = new ContactorsModel(id);
            MinisteredTo.CanViewComments = CanViewComments;
            Ministers.CanViewComments = CanViewComments;
        }
Пример #4
0
        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;
            }

            ContactId    = id;
            MinisteredTo = new ContacteesModel(id);
            Ministers    = new ContactorsModel(id);
            MinisteredTo.CanViewComments = CanViewComments;
            Ministers.CanViewComments    = CanViewComments;
        }
Пример #5
0
 public ActionResult AddTask(int cid, int pid)
 {
     var m = new ContacteesModel(cid);
     var tid = m.AddTask(pid);
     return Redirect("/Task/Detail/" + tid);
 }