Exemplo n.º 1
0
        public string DeleteUsersProfile(MProfileUser MProfile)
        {
            ProfileUserRequest  request  = new ProfileUserRequest();
            UserProfileResponse response = new UserProfileResponse();
            string returnMsg             = string.Empty;

            request.ProfileUser      = MProfile;
            request.ApplicationToken = ConfigurationManager.AppSettings["ApplicationToken"].ToString();

            string bodyrequest  = JsonConvert.SerializeObject(request);
            string statuscode   = string.Empty;
            string bodyresponse = new Helper().InvokeApi("security/api/Profile", "DeleteUsersProfile", bodyrequest, ref statuscode);

            if (statuscode.Equals("OK"))
            {
                response  = JsonConvert.DeserializeObject <UserProfileResponse>(bodyresponse);
                returnMsg = response.Code + "|" + response.Message;
            }
            else
            {
                returnMsg = "2" + "|" + "Error invoking User api";
            }

            return(returnMsg);
        }
Exemplo n.º 2
0
        public List <MProfileUser> GetUsersUnAssigned(MProfileUser MProfile)
        {
            List <MProfileUser>  UsersProfile = new List <MProfileUser>();
            ProfileUserRequest   request      = new ProfileUserRequest();
            UsersProfileResponse response     = new UsersProfileResponse();

            request.ProfileUser      = MProfile;
            request.ApplicationToken = ConfigurationManager.AppSettings["ApplicationToken"].ToString();

            string bodyrequest  = JsonConvert.SerializeObject(request);
            string statuscode   = string.Empty;
            string bodyresponse = new Helper().InvokeApi("security/api/Profile", "GetUsersUnAssigned", bodyrequest, ref statuscode);

            if (statuscode.Equals("OK"))
            {
                response = JsonConvert.DeserializeObject <UsersProfileResponse>(bodyresponse);

                if (response.Code.Equals("0"))
                {
                    UsersProfile = response.UsersProfile;
                }
            }

            return(UsersProfile);
        }