private void btn_update_Click(object sender, EventArgs e)
 {
     if (gridView1.RowCount != 0)
     {
         frm_changeqty frm          = new frm_changeqty();
         int           selectrow    = gridView1.FocusedRowHandle;
         decimal       qty          = decimal.Parse(gridView1.GetRowCellValue(selectrow, "qty").ToString());
         decimal       price        = decimal.Parse(gridView1.GetRowCellValue(selectrow, "price").ToString());
         string        product_name = gridView1.GetRowCellValue(selectrow, "product_name").ToString();
         int           code_product = int.Parse(gridView1.GetRowCellValue(selectrow, "product_code").ToString());
         frm.cmb_unit.Text        = gridView1.GetRowCellValue(selectrow, "unit_name").ToString();
         frm.id                   = int.Parse(gridView1.GetRowCellValue(selectrow, "id").ToString());
         frm.txt_qty.Text         = qty.ToString();
         frm.txt_productname.Text = product_name.ToString();
         frm.txt_price.Text       = price.ToString();
         frm.product_code         = code_product;
         frm.bindingunits(code_product);
         frm.form_name     = "transfer";
         frm.qty           = qty;
         frm.available_qty = decimal.Parse(gridView1.GetRowCellValue(selectrow, "available_qty").ToString());
         if (addnew == true)
         {
             frm.addnew = true;
         }
         else
         {
             frm.addnew = false;
         }
         frm.ShowDialog();
     }
 }
Example #2
0
 private void btn_update_Click(object sender, EventArgs e)
 {
     if (gridView1.RowCount != 0)
     {
         frm_changeqty frm          = new frm_changeqty();
         int           selectrow    = gridView1.FocusedRowHandle;
         decimal       qty          = decimal.Parse(gridView1.GetRowCellValue(selectrow, "qty").ToString());
         decimal       price        = decimal.Parse(gridView1.GetRowCellValue(selectrow, "price").ToString());
         string        product_name = gridView1.GetRowCellValue(selectrow, "product_name").ToString();
         int           code         = int.Parse(gridView1.GetRowCellValue(selectrow, "product_code").ToString());
         frm.cmb_unit.Text        = gridView1.GetRowCellValue(selectrow, "unit_name").ToString();
         frm.id                   = int.Parse(gridView1.GetRowCellValue(selectrow, "id").ToString());
         frm.txt_qty.Text         = qty.ToString();
         frm.txt_productname.Text = product_name.ToString();
         frm.txt_price.Text       = price.ToString();
         frm.product_code         = code;
         frm.bindingunits(code);
         frm.form_name = "adjust";
         frm.ShowDialog();
     }
 }