Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try{
                FRM_ORDERS frm = new FRM_ORDERS();



                if (this.raOR.Checked == true)
                {
                    frm.txtOrderID.Text     = this.dgvOrders.CurrentRow.Cells[0].Value.ToString();
                    frm.dtOrder.Value       = Convert.ToDateTime(this.dgvOrders.CurrentRow.Cells[1].Value.ToString());
                    frm.txtSalesMan.Text    = this.dgvOrders.CurrentRow.Cells[8].Value.ToString();
                    frm.txtDesOrder.Text    = this.dgvOrders.CurrentRow.Cells[9].Value.ToString();
                    frm.txtCustomerID.Text  = this.dgvOrders.CurrentRow.Cells[2].Value.ToString();
                    frm.txtFirstName.Text   = this.dgvOrders.CurrentRow.Cells[3].Value.ToString();
                    frm.txtAmounKash.Text   = this.dgvOrders.CurrentRow.Cells[6].Value.ToString();
                    frm.txtAmounDue.Text    = this.dgvOrders.CurrentRow.Cells[7].Value.ToString();
                    frm.txtDescount.Text    = this.dgvOrders.CurrentRow.Cells[4].Value.ToString();
                    frm.txtTotalAmount.Text = this.dgvOrders.CurrentRow.Cells[5].Value.ToString();

                    // frm.dataGridView1.DataSource=order.GetOrderDetailsForUpdate(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString()));

                    frm.CreateDataTable1();
                    frm.Dt1 = order.GetOrderDetailsForUpdate(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString()));
                    frm.Create();


                    frm.btnAdd.Text    = "BADAL";
                    frm.btnAdd.Enabled = true;
                    frm.btnNEW.Visible = false;
                    frm.Text           = "RASID BADALID";

                    frm.raOR.Checked  = true;
                    frm.raPOR.Visible = false;

                    frm.dataGridView1.Columns[5].Visible = false;
                    //frm.dataGridView1.Columns[6].Visible = false;
                    frm.lbTrID.Text = order.GET_Transaction_ID(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString())).Rows[0][0].ToString();
                }
                else
                {
                    frm.state              = "update";
                    frm.txtOrderID.Text    = this.dgvOrders.CurrentRow.Cells[0].Value.ToString();
                    frm.dtOrder.Value      = Convert.ToDateTime(this.dgvOrders.CurrentRow.Cells[1].Value.ToString());
                    frm.txtSalesMan.Text   = this.dgvOrders.CurrentRow.Cells[6].Value.ToString();
                    frm.txtDesOrder.Text   = this.dgvOrders.CurrentRow.Cells[7].Value.ToString();
                    frm.txtCustomerID.Text = this.dgvOrders.CurrentRow.Cells[2].Value.ToString();
                    frm.txtFirstName.Text  = this.dgvOrders.CurrentRow.Cells[3].Value.ToString();
                    frm.txtAmounKash.Text  = this.dgvOrders.CurrentRow.Cells[4].Value.ToString();
                    frm.txtAmounDue.Text   = this.dgvOrders.CurrentRow.Cells[5].Value.ToString();


                    // frm.dataGridView1.DataSource=order.GetOrderDetailsForUpdate(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString()));
                    // frm.CreateDataTable2();
                    frm.Dt2 = order.GetPurchaseOrderDetailsForUpdate(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString()));
                    frm.Create2();

                    frm.btnAdd.Text    = "BADAL";
                    frm.btnAdd.Enabled = true;
                    frm.btnNEW.Visible = false;
                    frm.Text           = "RASID BADALID";


                    frm.raPOR.Checked = true;
                    frm.raOR.Visible  = false;

                    // frm.dataGridView1.Columns[5].Visible = false;
                    // frm.dataGridView1.Columns[6].Visible = false;

                    frm.lbTrID.Text = order.GET_Transaction_ID2(Convert.ToInt32(this.dgvOrders.CurrentRow.Cells[0].Value.ToString())).Rows[0][0].ToString();                   // frm.chInv.Checked = Convert.ToBoolean(frm.dataGridView1.Rows[0].Cells[6].Value.ToString());
                }

                frm.state = "update";
                //frm.dataGridView1.Enabled = false;

                // frm.btnBrowse.Enabled = false;
                //frm.txtQty.Enabled = false;
                // frm.txtPrice.Enabled = false;
                frm.ShowDialog();

                //frm.CalculateTotalAmount1();
            }
            catch
            {
                return;
            }
        }