Example #1
0
        public ServiceResult <CustomerViewModel> Create(CreateCustomerInputModel request)
        {
            IRestRequest CreateCustomer = new RestRequest("api/CustomerManagement", method: Method.POST);

            CreateCustomer.AddJsonBody(request);
            IRestResponse <ServiceResult <CustomerViewModel> > Result = RestProvider.GetInstance().Post <ServiceResult <CustomerViewModel> >(CreateCustomer);

            if (Result != null)
            {
                return(Result.Data);
            }

            throw new Exception();
        }
        public ServiceResult <string> FirstStepLogin(UserAuthenticationBindingModel model)
        {
            IRestRequest LoginRequest = new RestRequest("api/Authentication", method: Method.POST);

            LoginRequest.AddJsonBody(model);
            IRestResponse <ServiceResult <string> > Result = RestProvider.GetInstance().Post <ServiceResult <string> >(LoginRequest);

            if (Result != null)
            {
                RestProvider.Renew().AddDefaultHeader("Authorization", Result.Data.Data);
                return(Result.Data);
            }

            throw new Exception();
        }
Example #3
0
        public ServiceResult <IEnumerable <CustomerViewModel> > Search(CustomerSearchInputModel request)
        {
            IRestRequest SearchCustomers = new RestRequest("api/CustomerManagement", method: Method.GET);

            IRestResponse <ServiceResult <IEnumerable <CustomerViewModel> > > Result = RestProvider.GetInstance().Get <ServiceResult <IEnumerable <CustomerViewModel> > >(SearchCustomers);

            if (Result != null)
            {
                return(Result.Data);
            }

            return(null);
        }
        public ServiceResult <IEnumerable <OrganizationMembershipViewModel> > GetUserMemberships()
        {
            IRestRequest LoginRequest = new RestRequest("api/Authentication", method: Method.GET);

            IRestResponse <ServiceResult <IEnumerable <OrganizationMembershipViewModel> > > Result = RestProvider.GetInstance().Get <ServiceResult <IEnumerable <OrganizationMembershipViewModel> > >(LoginRequest);

            if (Result != null)
            {
                return(Result.Data);
            }

            return(null);
        }