private void InitializeListUser()
        {
            string userName = string.Empty;
            string idUser   = string.Empty;

            using (var userService = new ServiceManager.ServiceSystemCompaniesClient())
            {
                try
                {
                    var user = new ServiceManager.Users();
                    user.Method = "fillDropDown";
                    user        = userService.ManageUsers(user);

                    foreach (var listUsers in user.list)
                    {
                        idUser   = listUsers.Item2.ToString();
                        userName = listUsers.Item1;
                        if (userName != "admin")
                        {
                            IDToName users = new IDToName(userName, idUser);
                            comboxListUsers.Items.Add(users);
                        }
                    }
                }
                catch (FaultException ex)
                {
                    MessageUtils.LogUtils.WriteToLog(string.Format(" Error Get All User. Exception: {0} ", ex.Message));
                    MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Error Get All User. Exception: {0} ", ex.Message));
                }
                if (comboxListUsers.Items.Count > 0)
                {
                    comboxListUsers.SelectedIndex = 0;
                }
            }
        }
        private void comboxListUsers_SelectedIndexChanged(object sender, EventArgs e)
        {
            IDToName users = (IDToName)this.comboxListUsers.SelectedItem;

            if (users == null)
            {
                return;
            }
            string userID = users.ID;

            this.UserID = userID;
        }
        private void combListServices_SelectedIndexChanged(object sender, EventArgs e)
        {
            IDToName service = (IDToName)this.combListServices.SelectedItem;

            if (service == null)
            {
                return;
            }
            string serviceId = service.ID;

            this.ServiceId = serviceId;
        }
        private void combListCust_SelectedIndexChanged(object sender, EventArgs e)
        {
            IDToName company = (IDToName)this.combListCust.SelectedItem;

            if (company == null)
            {
                return;
            }
            string companyID = company.ID;

            this.CompanyId = companyID;
        }
        public void InitcombListCustomers()
        {
            if (IsForSpecificCustomer)
            {
                combListCust.Items.Clear();
                IDToName comp = new IDToName(this._companyName, this.CompanyId);
                combListCust.Items.Add(comp);
            }
            else
            {
                string idComp   = string.Empty;
                string Compname = string.Empty;
                using (var servicCompany = new ServiceManager.ServiceSystemCompaniesClient())
                {
                    try
                    {
                        var comp = new ServiceManager.Companies();
                        comp.Method = "GetAllCustomersToDropDown";
                        comp        = servicCompany.ManageCompanies(comp);

                        foreach (var listComp in comp.list)
                        {
                            Compname = listComp.Item1;
                            idComp   = listComp.Item2.ToString();
                            IDToName company = new IDToName(Compname, idComp);
                            combListCust.Items.Add(company);
                        }
                    }
                    catch (FaultException ex)
                    {
                        MessageUtils.LogUtils.WriteToLog(String.Format(" Error Get All Customers To DropDown: {0}", ex.Message));
                        MessageUtils.LogUtils.SystemEventLogsError(String.Format(" Error Get All Customers To DropDown: {0}", ex.Message));
                    }
                }
            }
            if (combListCust.Items.Count > 0)
            {
                combListCust.SelectedIndex = 0;
            }
        }
 public void InitcombListServices()
 {
     if (IsForSpecificCustomer)
     {
         combListServices.Items.Clear();
         IDToName service = new IDToName(this._serviceName, this.ServiceId);
         combListServices.Items.Add(service);
     }
     else
     {
         using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
         {
             try
             {
                 var service = new ServiceManager.Service();
                 service.Method = "GetAllServiceToDropDown";
                 service        = serviceService.MangeServices(service);
                 foreach (var listService in service.list)
                 {
                     string   serviceName   = listService.Item2;
                     string   idService     = Convert.ToString(listService.Item1);
                     IDToName serviceToDrop = new IDToName(serviceName, idService);
                     combListServices.Items.Add(serviceToDrop);
                 }
             }
             catch (FaultException ex)
             {
                 MessageUtils.LogUtils.WriteToLog(String.Format(" Error Get All Service To DropDown: {0}", ex.Message));
                 MessageUtils.LogUtils.SystemEventLogsError(String.Format(" Error Get All Service To DropDown: {0}", ex.Message));
             }
         }
     }
     if (combListServices.Items.Count > 0)
     {
         combListServices.SelectedIndex = 0;
     }
 }