Exemplo n.º 1
0
        private void NewButton_Click(object sender, EventArgs e)
        {
            Customer     customer     = new Customer();
            CustomerForm customerForm = new CustomerForm(customer);

            if (customerForm.ShowDialog() == DialogResult.OK)
            {
                _bureau.AddCustomer(customer);
                _bureau.CalculateCostOrderAndPerformers();
                ListOfCustomers.Items.Add(customer.ToString());
            }
            else
            {
                MessageBox.Show("Changes was not saved");
            }
        }
Exemplo n.º 2
0
        public BureauForm(Bureau bureau)
        {
            InitializeComponent();
            _bureau              = bureau;
            EditButton.Enabled   = false;
            DeleteButton.Enabled = false;

            Services[] services = (Services[])Enum.GetValues(typeof(Services));
            foreach (Services service in services)
            {
                ServicesText.Items.Add(service.ToString());
            }
            if (_bureau != null && _bureau.BureauName != null && bureau.Service != null)
            {
                ServicesText.SelectedIndex = ServicesText.Items.IndexOf(bureau.Service.ToString());
                BureauNameText.Text        = bureau.BureauName;
                _bureau.CalculateCostOrderAndPerformers();
                if (bureau.Customers != null)
                {
                    bureau.Customers.ForEach(customer =>
                    {
                        ListOfCustomers.Items.Add(customer);
                    });
                }
            }
        }