}//end str select bween dates public void LoadInListView(ListView lv) { Attendance a = new Attendance(); DataTable dt = new DataTable(); String month = DateTime.Now.ToString("MMMM"); String year = DateTime.Now.ToString("yyyy"); int firstday = 1; int lastday = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); DateTime from_ = Convert.ToDateTime(month + " " + firstday.ToString() + ", " + year.ToString()); DateTime to_ = Convert.ToDateTime(month + " " + lastday.ToString() + ", " + year.ToString()); dt = a.SELECT_BETWEEN_DATES(from_, to_); if (dt != null) { int ctr = 1; foreach (DataRow r in dt.Rows) { ListViewItem li = new ListViewItem(); li.Text = ctr.ToString(); li.SubItems.Add(r["fullname"].ToString()); li.SubItems.Add(r["position_"].ToString()); li.SubItems.Add(Convert.ToDateTime(r["date_"].ToString()).ToString("MMMM dd, yyyy")); li.SubItems.Add(Convert.ToDateTime(r["attendance"].ToString()).ToString("HH:mm:ss")); li.Tag = r["empid"].ToString(); // li.SubItems.Add(Convert.ToDateTime(r["date_updated"].ToString()).ToLongDateString()); lv.Items.Add(li); ctr++; } } }
public void LoadInListView(ListView lv) { Attendance a = new Attendance(); DataTable dt = new DataTable(); String month = DateTime.Now.ToString("MMMM"); String year = DateTime.Now.ToString("yyyy"); int firstday = 1; int lastday= DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); DateTime from_ = Convert.ToDateTime(month + " " + firstday.ToString() + ", " + year.ToString()); DateTime to_= Convert.ToDateTime(month + " " + lastday.ToString() + ", " + year.ToString()); dt = a.SELECT_BETWEEN_DATES(from_,to_); if (dt != null) { int ctr = 1; foreach (DataRow r in dt.Rows) { ListViewItem li = new ListViewItem(); li.Text = ctr.ToString(); li.SubItems.Add(r["fullname"].ToString()); li.SubItems.Add(r["position_"].ToString()); li.SubItems.Add(Convert.ToDateTime(r["date_"].ToString()).ToString("MMMM dd, yyyy")); li.SubItems.Add(Convert.ToDateTime(r["attendance"].ToString()).ToString("HH:mm:ss")); li.Tag = r["empid"].ToString(); // li.SubItems.Add(Convert.ToDateTime(r["date_updated"].ToString()).ToLongDateString()); lv.Items.Add(li); ctr++; } } }
public void LoadAtt_BW_DATES_InListView(ListView lv) { Attendance a = new Attendance(); DataTable dt = new DataTable(); dt = a.SELECT_BETWEEN_DATES(dtpFrom.Value, dtpTo.Value); if (dt != null) { lv.Items.Clear(); int ctr = 1; foreach (DataRow r in dt.Rows) { ListViewItem li = new ListViewItem(); li.Text = ctr.ToString(); li.SubItems.Add(r["fullname"].ToString()); li.SubItems.Add(r["position_"].ToString()); li.SubItems.Add(Convert.ToDateTime(r["date_"].ToString()).ToString("MMMM dd, yyyy")); li.SubItems.Add(Convert.ToDateTime(r["attendance"].ToString()).ToString("hh:mm:ss tt")); li.Tag = r["empid"].ToString(); // li.SubItems.Add(Convert.ToDateTime(r["date_updated"].ToString()).ToLongDateString()); lv.Items.Add(li); ctr++; } } }