Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            QLDSND_ID = -1;
            DCTTTK edit = new DCTTTK();

            edit.Show();
        }
Exemplo n.º 2
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.CurrentCell.ColumnIndex == 4)
     {
         DCTTTK edit = new DCTTTK();
         QLDSND_ID = Int32.Parse(dataGridView1.Rows[e.RowIndex].Cells["ID"].Value.ToString());
         edit.Show();
     }
     else if (dataGridView1.CurrentCell.ColumnIndex == 5)
     {
         DialogResult confirm = MessageBox.Show("Are you f*****g sure ?", "Warning", MessageBoxButtons.YesNo);
         if (confirm == DialogResult.Yes)
         {
             int ID = Int32.Parse(dataGridView1.Rows[e.RowIndex].Cells["ID"].Value.ToString());
             SV.tbl_DangNhap.Remove((from s in SV.tbl_DangNhap
                                     where s.ID == ID
                                     select s).FirstOrDefault());
             SV.SaveChanges();
             MessageBox.Show("Deleted successfully!");
             Main.ReloadND();
         }
     }
 }