예제 #1
0
        private void dgvCustomerlist_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                int             index       = e.RowIndex;
                DataGridViewRow selectedrow = dgvCustomerlist.Rows[index];

                String         IID       = selectedrow.Cells[0].Value.ToString();
                string         name      = selectedrow.Cells[1].Value.ToString();
                string         telephone = selectedrow.Cells[2].Value.ToString();
                string         address   = selectedrow.Cells[3].Value.ToString();
                string         credit    = selectedrow.Cells[4].Value.ToString();
                frmAddCustomer frmaddc   = new frmAddCustomer(IID, name, telephone, address, credit);
                frmaddc.ShowDialog();
            }
            catch (ArgumentOutOfRangeException)
            {
            }
            catch (IndexOutOfRangeException sex)
            {
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void cmbCustomerSelect_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Enter)
            {
                if (dgvCustomerlist.RowCount == 1)
                {
                    int             index       = 0;
                    DataGridViewRow selectedrow = dgvCustomerlist.Rows[index];

                    String         IID       = selectedrow.Cells[0].Value.ToString();
                    string         name      = selectedrow.Cells[1].Value.ToString();
                    string         telephone = selectedrow.Cells[2].Value.ToString();
                    string         address   = selectedrow.Cells[3].Value.ToString();
                    string         credit    = selectedrow.Cells[4].Value.ToString();
                    frmAddCustomer frmaddc   = new frmAddCustomer(IID, name, telephone, address, credit);
                    frmaddc.ShowDialog();
                }
            }
        }
예제 #3
0
        private void btnAddCustomer_Click(object sender, EventArgs e)
        {
            frmAddCustomer frmaddc = new frmAddCustomer();

            frmaddc.ShowDialog();
        }