Пример #1
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex == 4)
         {
             dataGridView1.Rows.RemoveAt(e.RowIndex);
             cr c = new TMS.cr();
             c.no = Convert.ToInt32(dataGridView1[0, e.RowIndex].Value);
             bool sucess = c.delete();
             if (sucess)
             {
                 MessageBox.Show("DELETED SUCESSFULY", "DELETE");
             }
             else
             {
                 MessageBox.Show("DELETION UNSUCESSFULL", "DELETE");
             }
         }
     }
     catch (Exception x)
     {
         MessageBox.Show("Transaction Does Not Exist", "Error");
     }
 }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            cr c = new TMS.cr();

            c.no = Convert.ToInt32(textBox1.Text.ToString());
            bool sucess = c.delete();

            if (sucess)
            {
                MessageBox.Show("DELETED SUCESSFULY", "DELETE");
            }
            else
            {
                MessageBox.Show("DELETION UNSUCESSFULL", "DELETE");
            }
            clear();
        }