private void frmTransactions_Load(object sender, EventArgs e)
        {
            //Dispay all the transactions
            DataTable dt = tdal.DisplayAllTransactions();

            dgvTransactions.DataSource = dt;

            DataTable dt1 = tdal.DisplayTransactions("invoice_no", "0", "999999999");

            cmbInvFrom.DataSource  = dt1;
            cmbInvFrom.ValueMember = "invoice_no";

            DataTable dt2 = tdal.DisplayTransactions("invoice_no", "0", "999999999");

            cmbInvTo.DataSource  = dt2;
            cmbInvTo.ValueMember = "invoice_no";

            DataSet ds1 = dcDAL.GetDealerCustomerForTransaction();

            cmbCusFrom.DataSource  = ds1.Tables[0];
            cmbCusFrom.ValueMember = "name";

            DataSet ds2 = dcDAL.GetDealerCustomerForTransaction();

            cmbCusTo.DataSource  = ds2.Tables[0];
            cmbCusTo.ValueMember = "name";
        }
Ejemplo n.º 2
0
        private void frmPurchaseAndSales_Load(object sender, EventArgs e)
        {
            this.KeyUp += new System.Windows.Forms.KeyEventHandler(KeyEvent);

            //Get the transactionType value from frmUserDashboard
            string type = frmUserDashboard.transactionType;

            //Set the value on lblTop
            lblTop.Text = type;

            //Specify Columns for our TransactionDataTable
            transactionDT.Columns.Add("Code");
            transactionDT.Columns.Add("Product Name");
            transactionDT.Columns.Add("Rate");
            transactionDT.Columns.Add("Quantity");
            transactionDT.Columns.Add("Discount");
            transactionDT.Columns.Add("Total");

            //Get the keyword fro the text box
            //string keyword = txtSearch.Text;

            //if (keyword == "")
            //{
            //    //Clear all the textboxes
            //    txtName.Text = "";
            //    txtEmail.Text = "";
            //    txtContact.Text = "";
            //    txtAddress.Text = "";
            //    return;
            //}

            //Write the code to get the details and set the value on text boxes
            //DeaCustBLL dc = dcDAL.GetDealerCustomerForTransaction();

            txtInvoiceNo.Text = tDAL.GetNextInvoiceNo(type).ToString();

            DataSet ds = dcDAL.GetDealerCustomerForTransaction();

            //Now transfer or set the value from DeCustBLL to textboxes
            cmbCustomer.DataSource    = ds.Tables[0];
            cmbCustomer.ValueMember   = "name";
            cmbCustomer.DisplayMember = "name";
            this.ActiveControl        = txtSearchProduct;

            //Get Item list
            DataTable items = pDAL.Search("");

            cmbItemName.DataSource    = items;
            cmbItemName.ValueMember   = "name";
            cmbItemName.DisplayMember = "description";


            //foreach (DataGridViewRow row in dgvAddedProducts.Rows)
            //{
            //    transactionDT.Rows.Add(row.Cells[0].Value, row.Cells[1].Value, row.Cells[2].Value, row.Cells[3].Value, row.Cells[4].Value, row.Cells[5].Value);
            //    //foreach (DataGridViewCell cell in row.Cells)
            //    //{
            //    //    transactionDT.Rows[transactionDT.Rows.Count - 1][cell.ColumnIndex] = cell.Value.ToString();
            //    //}

            //}
        }