Beispiel #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 <TransactionOutMaster> list          = new List <TransactionOutMaster>();
                TransactionOutMaster        masterHandler = new TransactionOutMaster();

                list = masterHandler.GetTransactionOutMasterList();
                ListViewItem lvi = new ListViewItem();

                if ((list != null))
                {
                    if (list.Count > 0)
                    {
                        foreach (TransactionOutMaster 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);
            }
        }