Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddCustomer frmAddCustomer = new AddCustomer();


            frmAddCustomer.CallFromUserControll = this;
            frmAddCustomer.ShowDialog();
        }
Пример #2
0
        private void dgvProductList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddCustomer     frmAddCustomer = new AddCustomer();
            DataGridViewRow currentRow     = dgvProductList.Rows[e.RowIndex];

            int id = ObjectHelper.GetValueFromAnonymousType <int>(currentRow.DataBoundItem, "Id");

            frmAddCustomer.loadDataForEditCustomer(id);

            frmAddCustomer.CallFromUserControll = this;
            frmAddCustomer.ShowDialog();
        }
 private void btnCreateKH_Click(object sender, EventArgs e)
 {
     AddCustomer frmAddCustomer = new AddCustomer();
     if(frmAddCustomer.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         CustomerService customerService = new CustomerService();
         customers = new BindingList<Customer>(customerService.GetCustomers());
         if (customers != null)
         {
             cbxCustomer.DataSource = customers;
             cbxCustomer.DisplayMember = "CustomerName";
             cbxCustomer.ValueMember = "Id";
             cbxCustomer.SelectedIndex = customers.Count - 1;
         }
     }
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddCustomer frmAddCustomer = new AddCustomer();
            

            frmAddCustomer.CallFromUserControll = this;
            frmAddCustomer.ShowDialog();
        }
        private void dgvProductList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddCustomer frmAddCustomer = new AddCustomer();
            DataGridViewRow currentRow = dgvProductList.Rows[e.RowIndex];

            int id = ObjectHelper.GetValueFromAnonymousType<int>(currentRow.DataBoundItem, "Id");
            frmAddCustomer.loadDataForEditCustomer(id);

            frmAddCustomer.CallFromUserControll = this;
            frmAddCustomer.ShowDialog();
        }
Пример #6
0
 private void tsbAddCustomer_Click(object sender, EventArgs e)
 {
     AddCustomer frmAddCustomer = new AddCustomer();
     pnlMain.Controls.Clear();
     frmAddCustomer.ShowDialog();
 }