Beispiel #1
0
 private void dataGridView1_CelltClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         string id = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         if (e.ColumnIndex == 9)
         {
             DialogResult dr = MessageBox.Show("คุณต้องการลบข้อมูลนี้หรือไม่ ?", "ลบข้อมุล", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
             if (dr == DialogResult.Yes)
             {
                 this.deleteData(id);
             }
         }
         if (e.ColumnIndex == 8)
         {
             CusAdd da = new CusAdd(this);
             da.ID = id;
             da.Show();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            CusAdd acf = new CusAdd(this);

            acf.Show();
        }