class manages user groups
Esempio n. 1
0
        public IHttpActionResult deleteGroup(int id)
        {
            IHttpActionResult ret = null;
            Group group = new Group();

            if (id >= 0 && group.deleteGroup(id))
                ret = Ok(); // implement delete record from DB
            else
                ret = NotFound();
            return ret;
        }
Esempio n. 2
0
 public IHttpActionResult getGroups()
 {
     IHttpActionResult ret = null;
     Group userGroups = new Group(UserSessionData.userId);
     List<Group> groups = userGroups.getGroups();
     if (groups.Any() || groups.Count == 0)
     {
         ret = Ok(groups);
     }
     else
     {
         ret = NotFound();
     }
     return ret;
 }
Esempio n. 3
0
 public IHttpActionResult getGroupData(int groupId)
 {
     IHttpActionResult ret = null;
     Group userGroups = new Group(UserSessionData.userId);
     Group group = userGroups.getGroupData(groupId);
     if (group != null)
     {
         ret = Ok(group);
     }
     else
     {
         ret = NotFound();
     }
     return ret;
 }
Esempio n. 4
0
        public IHttpActionResult getGroups(string groupName)
        {
            IHttpActionResult ret = null;
            Group group = new Group(groupName);

            if (group.checkGrouName())
            {
                ret = Ok();
            }
            else
            {
                ret = NotFound();
            }
            return ret;
        }
Esempio n. 5
0
 public IHttpActionResult saveGroup(Group group)
 {
     IHttpActionResult ret = null;
     if (group.saveGroup())
         ret = Ok(group); //need to return newly generated id for this group
     else
         ret = NotFound();
     return ret;
 }