Ejemplo n.º 1
0
        public JsonResult SaveCustomerDetails(CustomerAppointmentDetailsModel customerAppointmentDetailsModel)
        {
            //string apiUrl = "api/CustomerDetails/SaveCustomerDetails";
            //string apiUrl = (TempData.Peek("ConfigData") as IDictionary<string, string>)?.FirstOrDefault(x => x.Key == Constants.SaveCustomerDetails).Value;
            string apiUrl = ConfigReader.ReadDatafromConfig(Constants.SaveCustomerDetails);

            customerAppointmentDetailsModel.CreatedBy = UserSecurity.Name;
            customerAppointmentDetailsModel.UpdatedBy = UserSecurity.Name;
            customerAppointmentDetailsModel.CustomerDetails.CreatedBy = UserSecurity.Name;
            //customerAppointmentDetailsModel.startDate = Convert.ToDateTime(!string.IsNullOrEmpty(customerAppointmentDetailsModel.startDateString)? customerAppointmentDetailsModel.startDateString: customerAppointmentDetailsModel.startDate.ToString());
            //customerAppointmentDetailsModel.endDate = Convert.ToDateTime(!string.IsNullOrEmpty(customerAppointmentDetailsModel.endDateString) ? customerAppointmentDetailsModel.endDateString : customerAppointmentDetailsModel.endDate.ToString());
            CustomerResponse model = null;

            try
            {
                var result = Common.CommonApiClient.CallWebApiServiceAsync(apiUrl, Request.HttpMethod, customerAppointmentDetailsModel);
                if (!String.IsNullOrEmpty(result.Result))
                {
                    model = JsonConvert.DeserializeObject <CustomerResponse>(result.Result);
                }
            }
            catch (Exception ex)
            {
                LogProvider.ErrorFormat("Controller:{0} Error: {1}", "CustomerDetailsController.SaveCustomerDetails", ex.ToString());
            }
            return(JsonResult(model, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult UpdateAppointmentDetails(CustomerAppointmentDetailsModel customerAppointmentDetailsModel)
        {
            //string apiUrl = (TempData.Peek("ConfigData") as IDictionary<string, string>)?.FirstOrDefault(x => x.Key == Constants.UpdateAppointmentStatus).Value;
            //string apiUrl = "api/AppointmentDetails/UpdateAppointmentStatus";
            string apiUrl = ConfigReader.ReadDatafromConfig(Constants.UpdateAppointmentStatus);

            customerAppointmentDetailsModel.CreatedBy = UserSecurity.Name;
            customerAppointmentDetailsModel.UpdatedBy = UserSecurity.Name;
            customerAppointmentDetailsModel.CustomerDetails.CreatedBy = UserSecurity.Name;
            try
            {
                var result = CommonApiClient.CallWebApiServiceAsync(apiUrl, Request.HttpMethod, customerAppointmentDetailsModel);
            }
            catch (Exception ex)
            {
                LogProvider.ErrorFormat("Controller:{0} Error: {1}", "Appointment.UpdateAppointmentDetails", ex.ToString());
            }

            return(JsonResult(customerAppointmentDetailsModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public JsonResult getAppointmentByCustomerCMCData(string firstName, string lastName, string last4SSN)
        {
            CustomerAppointmentDetailsModel model = null;
            // string apiUrl = "api/AppointmentDetails/GetAppointmentByCustomerCMCData/" + firstName + "/" + lastName + "/" + last4SSN;
            //string apiUrl = (TempData.Peek("ConfigData") as IDictionary<string, string>)?.FirstOrDefault(x => x.Key == Constants.GetAppointmentByCustomerCMCData).Value + firstName + "/" + lastName + "/" + last4SSN;
            string apiUrl = ConfigReader.ReadDatafromConfig(Constants.GetAppointmentByCustomerCMCData) + firstName + "/" + lastName + "/" + last4SSN;;

            try
            {
                var result = Common.CommonApiClient.CallWebApiServiceAsync(apiUrl, Request.HttpMethod);
                if (!String.IsNullOrEmpty(result.Result))
                {
                    model = JsonConvert.DeserializeObject <CustomerAppointmentDetailsModel>(result.Result);
                }
            }
            catch (Exception ex)
            {
                LogProvider.ErrorFormat("Controller:{0} Error: {1}", "OfficeDetailsController.GetOfficeDetailsByEntity", ex.ToString());
            }
            return(JsonResult(model, JsonRequestBehavior.AllowGet));
        }