Example #1
0
 private void buttonX3_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dataGridView1.SelectedRows.Count == 1)
         {
             dataGridView1.CurrentRow.Cells["cal_qty"].Value = (Convert.ToDecimal(dataGridView1.CurrentRow.Cells["cal_qty"].Value) - 1);
             decimal cost      = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["cal_cost"].Value);
             decimal quantitys = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["cal_qty"].Value);
             decimal total     = quantitys * cost;
             dataGridView1.CurrentRow.Cells["cal_total"].Value = total;
             calculate_total();
             // tax_calcu();
             DataTable dt = blord.getallfromorder_id(Convert.ToInt32(dataGridView1.CurrentRow.Cells["cal_order_id"].Value));
             if (dt.Rows.Count > 0)
             {
                 minus_click = true;
             }
         }
         else
         {
             MessageBox.Show("Please select row first or select only one row");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }