Example #1
0
        private void AddCustomer(object sender)
        {
            sel_cus = new CustomerModel();
            CustomerWindow cw = new CustomerWindow(sel_cus);

            if (cw.ShowDialog() == true)
            {
                db.AddCustomer(sel_cus);
                db.Save();
                d1.Customers = db.GetAllCustomers();
            }
        }
Example #2
0
        private void EditCustomer(object sender)
        {
            if (sel_cus != null)
            {
                CustomerWindow cw = new CustomerWindow(sel_cus);

                if (cw.ShowDialog() == true)
                {
                    db.UpdateCustomer(sel_cus);
                    db.Save();
                    d1.Mainprojects = db.GetAllProjects();
                }
            }
            else
            {
                MessageBox.Show("Пожалуйста, выберите заказчика!");
            }
        }