Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            type = "Add";
            Add_PurchaseBill a = new Add_PurchaseBill();

            a.ShowDialog();
            initialize();
            refreshdata();
        }
Exemple #2
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 4)
     {
         id    = Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value.ToString());
         Party = dataGridView1.CurrentRow.Cells[2].Value.ToString();
         Date  = dataGridView1.CurrentRow.Cells[0].Value.ToString();
         type  = "Edit";
         Add_PurchaseBill a = new Add_PurchaseBill();
         a.Text = "Edit";
         a.ShowDialog();
         initialize();
     }
     if (e.ColumnIndex == 5)
     {
         if (DialogResult.Yes == MessageBox.Show("Do You Want Delete ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
         {
             Purchase.DeleteBill(Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value.ToString()));
         }
         initialize();
     }
 }