コード例 #1
0
        public async Task <GenericResponse <AddRatingModel> > AddEndorsements(AddRatingModel addRatingModel)
        {
            GenericResponse <AddRatingModel> savedUserResponse = new GenericResponse <AddRatingModel>();
            HttpResponseMessage response = null;
            var uri = new Uri(string.Format(ApiPath.PostRating(), string.Empty));

            try
            {
                var        json    = JsonConvert.SerializeObject(addRatingModel);
                var        content = new StringContent(json, Encoding.UTF8, "application/json");
                HttpClient _client = new HttpClient();
                response = await _client.PostAsync(uri, content);

                if (response.IsSuccessStatusCode)
                {
                    var respContent = await response.Content.ReadAsStringAsync();

                    savedUserResponse = JsonConvert.DeserializeObject <GenericResponse <AddRatingModel> >(respContent);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            return(savedUserResponse);
        }
コード例 #2
0
        public PeopleDetailsViewModel(EmployeeDetailsModel employeeModel, INavigation navigation)
        {
            Navigation           = navigation;
            apiManager           = new ApiManager(new RestServices());
            model                = new AddRatingModel();
            EndorseButtonClicked = new Command(EndorseButton_Clicked);
            ViewEndosersTapped   = new Command(ViewEndosers_Tapped);
            BackButtonClicked    = new Command(BackButton_Clicked);
            Name        = employeeModel.employee.getFullName;
            Designation = employeeModel.employee.jobTitle.Split('\r')[0];
            Phone       = employeeModel.employee.phone.Split('\r')[0];

            Email          = employeeModel.employee.email.Split('\r')[0];
            EmpId          = employeeModel.employee.id;
            officeLocation = employeeModel.employee.officeLocation;
            ImageUrl       = employeeModel.employee.photoBlobId;


            GetIndividualRatingCount(EmpId);
        }
コード例 #3
0
 public async Task <IActionResult> Rating([FromBody] AddRatingModel model)
 {
     return(await MakeActionCallAsync(async() => await _service.AddRatingAsync(model, GetPersonId(), GetDeviceId())));
 }
コード例 #4
0
 public Task <bool> RemoveEndorsemnets(AddRatingModel addRatingModel)
 {
     return(restService.RemoveEndorsemnets(addRatingModel));
 }
コード例 #5
0
 public Task <GenericResponse <AddRatingModel> > AddEndorsements(AddRatingModel addRatingModel)
 {
     return(restService.AddEndorsements(addRatingModel));
 }