} //end LoadMembersInListView public void Load_Searched_MembersInListView(ListView lv, String input) { Member e = new Member(); DataTable dt = new DataTable(); dt = e.SELECT_BY_NAME(input); lv.Items.Clear(); if (dt != null) { int ctr = 1; foreach (DataRow r in dt.Rows) { ListViewItem li = new ListViewItem(); li.Text = ctr.ToString(); li.SubItems.Add(r["memid"].ToString()); li.SubItems.Add(r["fullname"].ToString()); li.SubItems.Add(r["address"].ToString()); li.SubItems.Add(r["contactno"].ToString()); Member_Standing ms = new Member_Standing(); ms.memid = r["memid"].ToString(); li.SubItems.Add(ms.STANDING); li.BackColor = (ms.STANDING == "MIGS") ? Color.GreenYellow : Color.Red; lv.Items.Add(li); ctr++; } } } //end LoadMembersInListView
public Member_Standing SELECT_BY_ID() { MySqlCommand cmd = new MySqlCommand(); db.SET_COMMAND_PARAMS(cmd, "MEMBER_STANDING_SELECT_BYID"); cmd.Parameters.AddWithValue("_memid", memid); MySqlDataAdapter da = new MySqlDataAdapter(cmd); DataTable dt = new DataTable(); try { da.Fill(dt); if (dt.Rows.Count > 0) { DataRow r = dt.Rows[0]; Member_Standing ms = new Member_Standing(); //declare 4 criteria (to become MIGS) ms.PAYMENT_TENK_WITHIN_SIX_MONTHS = Convert.ToBoolean(r["PAYMENT_TENK_WITHIN_SIX_MONTHS"].ToString()); ms.PAYMENT_FIFTYK_WITHIN_FIVE_YEARS = Convert.ToBoolean(r["PAYMENT_FIFTYK_WITHIN_FIVE_YEARS"].ToString()); ms.PATRONAGE_OF_MMG_SERVICES = Convert.ToBoolean(r["PATRONAGE_OF_MMG_SERVICES"].ToString()); ms.ATTENDANCE = Convert.ToBoolean(r["ATTENDANCE"].ToString()); return(ms); } else { return(null); } } catch (Exception e) { Logger.WriteErrorLog(e.Message); return(null); } }
public Member_Standing SELECT_BY_ID() { MySqlCommand cmd = new MySqlCommand(); db.SET_COMMAND_PARAMS(cmd, "MEMBER_STANDING_SELECT_BYID"); cmd.Parameters.AddWithValue("_memid", memid); MySqlDataAdapter da = new MySqlDataAdapter(cmd); DataTable dt = new DataTable(); try { da.Fill(dt); if (dt.Rows.Count > 0) { DataRow r = dt.Rows[0]; Member_Standing ms = new Member_Standing(); //declare 4 criteria (to become MIGS) ms.PAYMENT_TENK_WITHIN_SIX_MONTHS = Convert.ToBoolean(r["PAYMENT_TENK_WITHIN_SIX_MONTHS"].ToString()); ms.PAYMENT_FIFTYK_WITHIN_FIVE_YEARS =Convert.ToBoolean(r["PAYMENT_FIFTYK_WITHIN_FIVE_YEARS"].ToString()); ms.PATRONAGE_OF_MMG_SERVICES = Convert.ToBoolean(r["PATRONAGE_OF_MMG_SERVICES"].ToString()); ms.ATTENDANCE = Convert.ToBoolean(r["ATTENDANCE"].ToString()); return ms; } else { return null; } } catch (Exception e) { Logger.WriteErrorLog(e.Message); return null; } }
public void Load_Searched_MembersInListView(ListView lv, String input) { Member e = new Member(); DataTable dt = new DataTable(); dt = e.SELECT_BY_NAME(input); lv.Items.Clear(); if (dt != null) { int ctr = 1; foreach (DataRow r in dt.Rows) { ListViewItem li = new ListViewItem(); li.Text = ctr.ToString(); li.SubItems.Add(r["memid"].ToString()); li.SubItems.Add(r["fullname"].ToString()); li.SubItems.Add(r["address"].ToString()); li.SubItems.Add(r["contactno"].ToString()); Member_Standing ms = new Member_Standing(); ms.memid = r["memid"].ToString(); li.SubItems.Add(ms.STANDING); li.BackColor = (ms.STANDING == "MIGS") ? Color.GreenYellow : Color.Red; lv.Items.Add(li); ctr++; } } }