Exemplo n.º 1
0
        /// <summary>
        /// Adds new employee
        /// </summary>
        public string CreateNewEmployee(Employee newEmployee)
        {
            string responseMessage = string.Empty;

            try
            {
                var employeeDetails = WebAPI.CreateEmployeeData(newEmployee);

                string res   = employeeDetails.Result.Content.ReadAsStringAsync().Result;
                Type[] types = new Type[] { typeof(APISuccessResponseObject), typeof(APIErrorResponseObject), typeof(APIErrorResponseObjectMultipleErrorMessages) };
                responseMessage = DeserializeResponseObjectHelper(res, types, "Create", newEmployee);
            }
            catch (Exception)
            {
                throw;
            }
            return(responseMessage);
        }