private void btnChoose_Customer_Click(object sender, EventArgs e)
        {
            ClearBoxes();
            frm_Search frm = new frm_Search("Customer");

            frm.ShowDialog();
            if (frm.dgvSearch.Rows.Count == 0)
            {
                return;
            }
            else
            {
                txtCust_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                txtCust_Name.Text = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
            }
        }
Exemplo n.º 2
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            //string x = "madeproduct";
            try
            {
                ClearBoxes();

                frm_Search frm = new frm_Search("MadeProduct");
                frm.ShowDialog();
                if (rdbLarge.Checked)
                {
                    txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                    txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                    txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                    txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                    txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                    txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                    txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                    txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                    txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    txtqty.Focus();
                }
                else
                {
                    txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                    txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                    txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                    txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                    txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                    txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                    txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                    txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();

                    txtqty.Focus();
                }
                txtqty.Focus();
                _total = 0;
                //Calculate_Balance(txtProduct_Id.Text);
                txtDisc.Text = cls_Controls.CalculateTax(Convert.ToDecimal(txtPrice.Text)).ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "No Item Selected");
            }
        }
        private void btnChoose_Service_Click(object sender, EventArgs e)
        {
            ClearBoxes();
            frm_Search frm = new frm_Search("Service");

            frm.ShowDialog();
            if (frm.dgvSearch.Rows.Count == 0)
            {
                return;
            }
            else
            {
                txtItem_Id.Text      = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                txtService_Name.Text = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                txtQty.Focus();
            }
        }
Exemplo n.º 4
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            try
            {
                ClearBoxes();
                frm_Search frm = new frm_Search("Product");
                frm.ShowDialog();
                if ((bool)(frm.dgvSearch.CurrentRow.Cells[10].Value) == false)
                {
                    if (rdbLarge.Checked)
                    {
                        txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                        txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                        txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                        txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                        txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                        txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                        txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    }
                    else
                    {
                        txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                        txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                        txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                        txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                        txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                        txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                        txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                        txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    }
                    // ------- Tax = 0
                    txtDisc.Text = "0";
                }
                else
                {
                    if (rdbLarge.Checked)
                    {
                        txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                        txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                        txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                        txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                        txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                        txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                        txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    }
                    else
                    {
                        txtProduct_Id.Text   = frm.dgvSearch.CurrentRow.Cells[0].Value.ToString();
                        txtBarcode.Text      = frm.dgvSearch.CurrentRow.Cells[1].Value.ToString();
                        txtProduct_Name.Text = frm.dgvSearch.CurrentRow.Cells[2].Value.ToString();
                        txtAvQty.Text        = frm.dgvSearch.CurrentRow.Cells[3].Value.ToString();
                        txtPrice.Text        = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                        txtLqty.Text         = frm.dgvSearch.CurrentRow.Cells[5].Value.ToString();
                        txtSqty.Text         = frm.dgvSearch.CurrentRow.Cells[7].Value.ToString();
                        txtLqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[6].Value.ToString();
                        txtSqtyPrice.Text    = frm.dgvSearch.CurrentRow.Cells[8].Value.ToString();
                    }

                    CalculateTax(txtPrice.Text);
                }
                // any case do the following :-
                txtqty.Text = "1";
                txtqty.Focus();
                // compute inventory & order balance
                CalculateAmount();
                //استدعاء دالة لاظهار قيم مربعات النصوص اسفل الفاتورة
                Calculate_BalanceQtyInInvoice(txtProduct_Id.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "No Item Selected");
            }
        }