Ejemplo n.º 1
0
 public static List<PrebookedEvent> GetAll(string staffUsername, int stage, bool isAdHoc)
 {
     List<PrebookedEvent> output = new List<PrebookedEvent>();
     string sql = string.Format("SELECT * FROM REQ_PrebookedEvents WHERE StaffUsername='******' AND Stage={1} AND IsAdHoc='{2}'",
         staffUsername, stage, isAdHoc.ToString());
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             PrebookedEvent obj = new PrebookedEvent();
             obj.LoadFromReader(dr);
             output.Add(obj);
         }
     }
     return output;
 }
Ejemplo n.º 2
0
 internal static List<PrebookedEvent> getByEventID(int SelectedID)
 {
     List<PrebookedEvent> output = new List<PrebookedEvent>();
     string sql = string.Format("SELECT * FROM REQ_PrebookedEvents Where EventID={0}", SelectedID);
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             PrebookedEvent obj = new PrebookedEvent();
             obj.LoadFromReader(dr);
             output.Add(obj);
         }
     }
     return output;
 }
Ejemplo n.º 3
0
 internal static List<PrebookedEvent> getByUsername(string Username)
 {
     List<PrebookedEvent> output = new List<PrebookedEvent>();
     string sql = string.Format("SELECT * FROM REQ_PrebookedEvents Where UPPER(StaffUsername)='{0}'", Username.ToUpper());
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             PrebookedEvent obj = new PrebookedEvent();
             obj.LoadFromReader(dr);
             output.Add(obj);
         }
     }
     return output;
 }
Ejemplo n.º 4
0
 public static List<PrebookedEvent> GetAllListing(string staffUsername, int? SelectedYear)
 {
     List<PrebookedEvent> output = new List<PrebookedEvent>();
     string sql = string.Format("SELECT * FROM REQ_PrebookedEvents WHERE StaffUsername='******'",
         staffUsername);
     //if (SelectedYear.HasValue)
     //    sql += " AND YEAR(RequestDate)=" + SelectedYear.Value;
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             PrebookedEvent obj = new PrebookedEvent();
             obj.LoadFromReader(dr);
             output.Add(obj);
         }
     }
     return output;
 }