Ejemplo n.º 1
0
        public void DisplayTrasactionList()
        {
            //string fromDate = dtpFromDate.Value.ToString("MM/dd/yyyy");
            //string toDate = dtpToDate.Value.AddDays(1).ToString("MM/dd/yyyy");

            //if (!dateFilter)
            //{
            //    dtpFromDate.Value = DateTime.Now.Date.AddDays(-7);
            //    dtpToDate.Value = DateTime.Now.Date;
            //    fromDate = dtpFromDate.Value.ToString("MM/dd/yyyy");
            //    toDate = DateTime.Now.Date.AddDays(1).ToString("MM/dd/yyyy");
            //}

            try
            {
                List <BooksTransactionInMaster> list          = new List <BooksTransactionInMaster>();
                BooksTransactionInMasterHandler masterHandler = new BooksTransactionInMasterHandler();
                list = masterHandler.GetTransactionInMasterList();
                ListViewItem lvi = new ListViewItem();

                if (list.Count > 0)
                {
                    foreach (BooksTransactionInMaster obj in list)
                    {
                        lvi = new ListViewItem(obj.TransactionID);
                        lvi.SubItems.Add(Convert.ToString(obj.TransactionDate));
                        lvi.SubItems.Add(obj.Remarks);

                        listView1.Items.Add(lvi);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n" + ex.Message);
            }
        }
Ejemplo n.º 2
0
        public void DisplayTrasactionList()
        {
            //string fromDate = dtpFromDate.Value.ToString("MM/dd/yyyy");
            //string toDate = dtpToDate.Value.AddDays(1).ToString("MM/dd/yyyy");

            //if (!dateFilter)
            //{
            //    dtpFromDate.Value = DateTime.Now.Date.AddDays(-7);
            //    dtpToDate.Value = DateTime.Now.Date;
            //    fromDate = dtpFromDate.Value.ToString("MM/dd/yyyy");
            //    toDate = DateTime.Now.Date.AddDays(1).ToString("MM/dd/yyyy");
            //}

            try
            {
                List <BooksTransactionInMaster> list          = new List <BooksTransactionInMaster>();
                BooksTransactionInMasterHandler masterHandler = new BooksTransactionInMasterHandler();
                list = masterHandler.GetTransactionInMasterList();
                ListViewItem lvi = new ListViewItem();

                if (list.Count > 0)
                {
                    foreach (BooksTransactionInMaster obj in list)
                    {
                        lvi = new ListViewItem(obj.TransactionID);
                        lvi.SubItems.Add(Convert.ToString(obj.TransactionDate));
                        lvi.SubItems.Add(obj.Remarks);

                        listView1.Items.Add(lvi);
                    }
                }

                ////if (dateFilter)// filder by date
                ////{

                //str = "SELECT TransactionID, CustomerName, TotalAmount, SaleDate, Remarks FROM SaleMaster WHERE (SaleDate>=#" + fromDate + "# And SaleDate<=#" + toDate + "#) ORDER BY TransactionID";

                ////}
                ////else // Default
                ////{
                ////    str = "SELECT TransactionID, CustomerName, TotalAmount, SaleDate, Remarks FROM SaleMaster ORDER BY TransactionID";
                ////}

                //dt = DBService.GetDataTable(str);
                //rowCount = dt.Rows.Count;
                //if (rowCount > 0)
                //{



                //    for (int i = 0; i < rowCount; i++)
                //    {

                //        //share details
                //        //dgvSearch.RowCount += 1;
                //        dgvSearch.RowCount = i + 1;
                //        dgvSearch.Rows[i].Cells[0].Value = i + 1;
                //        dgvSearch.Rows[i].Cells[1].Value = Convert.ToString(dt.Rows[i]["TransactionID"]);
                //        dgvSearch.Rows[i].Cells[2].Value = Convert.ToString(dt.Rows[i]["CustomerName"]);
                //        dgvSearch.Rows[i].Cells[3].Value = Convert.ToDouble(dt.Rows[i]["TotalAmount"]);

                //        dgvSearch.Rows[i].Cells[4].Value = Convert.IsDBNull(dt.Rows[i]["SaleDate"]) ? DateTime.Now.Date : ((System.DateTime)(dt.Rows[i]["SaleDate"]));

                //        dgvSearch.Rows[i].Cells[5].Value = Convert.ToString(dt.Rows[i]["Remarks"]);

                //        totalSearchSale = totalSearchSale + Convert.ToDouble(dgvSearch.Rows[i].Cells[3].Value);
                //    }

                //}
                //else
                //{
                //    dgvSearch.RowCount = 0;
                //}
                //// lblTotalSearchSale.Text = Convert.ToString(totalSearchSale);
                //lblTotalSearchSale.Text = GlobalFunction.GetCurrencyFormat(totalSearchSale, false, true);
            }

            catch (Exception ex)
            {
                MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n" + ex.Message);
            }
        }