Ejemplo n.º 1
0
        public static List<BookedEvent> GetAll(string staffUsername, int? stage)
        {
            List<BookedEvent> output = new List<BookedEvent>();
            using (SqlConnection conn = UtilityDb.GetConnectionESS())
            {
                string sql = string.Format("SELECT * FROM REQ_BookedEvents WHERE UPPER(StaffUsername)='{0}'",
                     staffUsername.ToUpper());

                if (stage.HasValue)
                    sql += " AND stage=" + stage.Value;

                SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
                while (dr.Read())
                {
                    BookedEvent obj = new BookedEvent();
                    obj.LoadFromReader(dr);
                    output.Add(obj);
                }
            }
            return output;
        }
Ejemplo n.º 2
0
        internal static List<BookedEvent> getByUsername(string Username)
        {
            List<BookedEvent> output = new List<BookedEvent>();
            using (SqlConnection conn = UtilityDb.GetConnectionESS())
            {
                string sql = string.Format("SELECT * FROM REQ_BookedEvents WHERE UPPER(StaffUsername)='{0}'",
                     Username.ToUpper());

                SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
                while (dr.Read())
                {
                    BookedEvent obj = new BookedEvent();
                    obj.LoadFromReader(dr);
                    output.Add(obj);
                }
            }
            return output;
        }
Ejemplo n.º 3
0
 internal static List<BookedEvent> GetAll()
 {
     List<BookedEvent> output = new List<BookedEvent>();
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         string sql = string.Format("SELECT * FROM REQ_BookedEvents");
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             BookedEvent obj = new BookedEvent();
             obj.LoadFromReader(dr);
             output.Add(obj);
         }
     }
     return output;
 }
Ejemplo n.º 4
0
 internal static List<BookedEvent> getByEventID(int SelectedID)
 {
     List<BookedEvent> output = new List<BookedEvent>();
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         string sql = string.Format("SELECT * FROM REQ_BookedEvents WHERE EventID={0}", SelectedID);
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             BookedEvent be = new BookedEvent();
             be.LoadFromReader(dr);
             output.Add(be);
         }
     }
     return output;
 }
Ejemplo n.º 5
0
 public static BookedEvent GetByEventDateId(string staffUsername, int eventDateId)
 {
     using (SqlConnection conn = UtilityDb.GetConnectionESS())
     {
         string sql = "SELECT * FROM REQ_BookedEvents WHERE UPPER(StaffUsername)='" + staffUsername.ToUpper() + "' AND EventDateId=" + eventDateId.ToString();
         SqlDataReader dr = UtilityDb.GetDataReader(sql, conn);
         while (dr.Read())
         {
             BookedEvent output = new BookedEvent();
             output.LoadFromReader(dr);
             return output;
         }
     }
     return null;
 }