Exemplo n.º 1
0
 public async Task<bool> RemoveUserFromGroup(UpdateUserGroup request)
 {
     try
     {
         HttpResponseMessage httpResp = apiCom.executePostAPI("User/RemoveUserFromGroup", JsonConvert.SerializeObject(request));
         if (httpResp.IsSuccessStatusCode)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     catch
     {
         return false;
     }
 }
Exemplo n.º 2
0
        public DomainModelResponse RemoveUserFromGroup(UpdateUserGroup request)
        {
            UserProfile up = _repUser.Get(filter: f => f.EmailId == request.emailId).FirstOrDefault();
            if (up == null)
            {
                _securityResponse.addResponse("RemoveUserFromGroup", MessageCodes.ErrDoesnotExist, "User : "******"RemoveUserFromGroup", MessageCodes.ErrDoesnotExist, "Course : " + request.courseCode);
                throw _securityResponse;
            }

            CourseUserRole cur = _repCourseUserRole.Get(filter: f => f.UserId == up.UserId && f.CourseId == course.CourseId).FirstOrDefault();
            if (cur == null)
            {
                _securityResponse.addResponse("RemoveUserFromGroup", MessageCodes.ErrDoesnotExist, "CourseUserRole for User : "******"RemoveUserFromGroup", MessageCodes.InfoSavedSuccessfully, "CourseUserRole for user : " + request.emailId);
            return _securityResponse;
        }
Exemplo n.º 3
0
        public ActionResult JoinGroup(string groupCode, string courseCode)
        {
            UpdateUserGroup uug = new UpdateUserGroup()
            {
                courseCode = courseCode,
                GroupCode = groupCode,
                emailId = MvcApplication.userEmail
            };
            bool result = _userCom.AddUserToGroup(uug).Result;
            if (result)
                return RedirectToAction("GroupDetail", "Group", routeValues: new { groupCode = groupCode });
                
            else
            {
                ModelState.AddModelError("", "Oops! Something wrong happened! Please try again.");
                return RedirectToAction("GroupSummary", "Group", routeValues: new { courseCode = courseCode });
            }

        }