/// <summary>
        ///
        /// </summary>
        /// <returns>Return a list of object with the Client Contract Information Basically return all the Carrier Contracts, and for each carrier contract a list of supported Service levels</returns>
        public List <ShipCaddieApp.Models.ClientInformationModel> GetClientContractInformation()
        {
            //GET integration/v1/GetClientContractInformation
            var type = "";

            try
            {
                List <ShipCaddieApp.Models.ClientInformationModel> lst_CIM = new List <ShipCaddieApp.Models.ClientInformationModel>();
                RestClient  client  = new RestClient(Settings.BASE_URL);
                RestRequest request = new RestRequest("integration/v1/GetClientContractInformation", Method.GET);
                request.RequestFormat = DataFormat.Json;
                request.JsonSerializer.ContentType = "application/json";
                request.AddHeader("Authorization", string.Format("Bearer {0}", rest_tokenModel.AccessToken));
                var response = client.Execute <List <ShipCaddieApp.Models.ClientInformationModel> >(request);
                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    foreach (var item in response.Data)
                    {
                        ShipCaddieApp.Models.ClientInformationModel CIM = new ShipCaddieApp.Models.ClientInformationModel();
                        CIM.AffillateName           = item.AffillateName;
                        CIM.CarrierClientContractId = item.CarrierClientContractId;
                        CIM.CarrierName             = item.CarrierName;
                        CIM.NickName      = item.NickName;
                        CIM.ServiceLevels = item.ServiceLevels;
                        lst_CIM.Add(CIM);
                    }
                    return(lst_CIM);
                }
                else
                {
                    lbl_LabelMessage.Text = "Message";
                    ErrorLabel.Text       = response.Content;
                    ErrorLabel.ForeColor  = Color.Red;
                    return(null);
                }
            }
            catch (Exception ex)
            {
                lbl_LabelMessage.Text = "Message";
                var message = JsonConvert.DeserializeObject <Models.Message>(type);
                ErrorLabel.Text      = message.developerMessage;
                ErrorLabel.ForeColor = Color.Red;
                return(null);
            }
        }
        public void callClientContractInformation()
        {
            try
            {
                int selectedId = Convert.ToInt16(((SelectedTypeModel)ddlSwitchAPI.SelectedItem).Value);
                if (selectedId == 1) //1 JSON
                {
                    //Empty the Service Level dropdown
                    List <ShipCaddieApp.Models.ServiceLevelModel> _lstservice = new List <ServiceLevelModel>();
                    ShipCaddieApp.Models.ServiceLevelModel        _service    = new ServiceLevelModel();
                    _service.CarrierServiceLevelName = "--Select--";
                    _service.CarrierServiceLevelId   = 0;
                    _lstservice.Add(_service);
                    ddlServiceLabel.DataSource    = _lstservice;
                    ddlServiceLabel.DisplayMember = "CarrierServiceLevelName";
                    ddlServiceLabel.ValueMember   = "CarrierServiceLevelId";
                    //

                    ddlCarrierName.DisplayMember = "CarrierName";
                    List <ShipCaddieApp.Models.ClientInformationModel> clientContract = new List <ShipCaddieApp.Models.ClientInformationModel>();
                    ShipCaddieApp.Models.ClientInformationModel        contract       = new ShipCaddieApp.Models.ClientInformationModel();
                    contract.CarrierClientContractId = 0;
                    contract.CarrierName             = "--Select--";
                    clientContract.Add(contract);
                    clientContract.AddRange(GetClientContractInformation());// to get a list of carriers
                    if (clientContract != null)
                    {
                        ddlCarrierName.DataSource    = clientContract;
                        ddlCarrierName.DisplayMember = "CarrierName";
                        ddlCarrierName.ValueMember   = "CarrierClientContractId";
                    }
                }
                else
                {
                    //Empty the Service Level dropdown
                    List <ShipCaddieAppXml.Servicelevel> _lstservice = new List <Servicelevel>();
                    ShipCaddieAppXml.Servicelevel        _service    = new Servicelevel();
                    _service.carrierServiceLevelName = "--Select--";
                    _service.carrierServiceLevelId   = 0;
                    _lstservice.Add(_service);
                    ddlServiceLabel.DataSource    = _lstservice;
                    ddlServiceLabel.DisplayMember = "carrierServiceLevelName";
                    ddlServiceLabel.ValueMember   = "carrierServiceLevelId";
                    //

                    ddlCarrierName.DisplayMember = "CarrierName";
                    List <ShipCaddieAppXml.ClientInformationModel> clientContract = new List <ShipCaddieAppXml.ClientInformationModel>();
                    ShipCaddieAppXml.ClientInformationModel        contract       = new ShipCaddieAppXml.ClientInformationModel();
                    contract.carrierClientContractId = 0;
                    contract.carrierName             = "--Select--";
                    clientContract.Add(contract);
                    clientContract.AddRange(XMLGetClientContractInformation());// to get a list of carriers
                    if (clientContract != null)
                    {
                        ddlCarrierName.DataSource    = clientContract;
                        ddlCarrierName.DisplayMember = "carrierName";
                        ddlCarrierName.ValueMember   = "carrierClientContractId";
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }