private void BoxesChanged(object sender, EventArgs e)
        {
            comboBox1.SelectedIndexChanged -= BoxesChanged;
            comboBox2.SelectedIndexChanged -= BoxesChanged;

            ComboBox box = (ComboBox)sender;

            currentEmployesFactpry = employeesFactoryInfos[box.SelectedIndex];
            comboBox1.SelectedItem = currentEmployesFactpry.UserID;
            comboBox2.SelectedItem = currentEmployesFactpry.FactoryID;

            comboBox1.SelectedIndexChanged += BoxesChanged;
            comboBox2.SelectedIndexChanged += BoxesChanged;
        }
        public List <EmployeesFactoryInfo> GetEmployeesFactories()
        {
            List <byte> bytes = new List <byte>();

            bytes.Add((byte)Operations.GetEmployeesFactories);
            SendToClient(bytes.ToArray());
            List <byte> answer = ReceiveForClient().ToList();
            Int32       employeesFactoriesCount = BitConverter.ToInt32(answer.ToArray(), 0);

            answer.RemoveRange(0, sizeof(Int32));

            List <EmployeesFactoryInfo> employeesFactories = new List <EmployeesFactoryInfo>();

            for (int i = 0; i < employeesFactoriesCount; i++)
            {
                employeesFactories.Add(EmployeesFactoryInfo.deserialise(answer));
            }

            return(employeesFactories);
        }