public static string getFilteredEvents(string city, string team, string startDate, string endDate) { if (team == "0") { team = "NULL"; } string queryStr = "EXEC procViewEvents " + team + ", "; queryStr += (startDate == "Click to Select") ? "NULL, " : "'" + startDate + "', "; queryStr += (endDate == "Click to Select") ? "NULL, " : "'" + endDate + "', "; queryStr += (city == "0") ? "NULL" : "'" + city + "'"; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, List <Object> > dic = KardoGeneralModel.getDicFromSDR(sdr); con.Close(); if (dic.Count != 0) { for (int curIn = 0; curIn < dic["eventId"].Count; curIn++) { dic["eventId"][curIn] = UseKardoEncryption.getEncryptedString(dic["eventId"][curIn].ToString(), 100); } } return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getUserTickets(int userId) { string queryStr = "EXEC procGetUserTickets " + userId; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, List <Object> > dic = KardoGeneralModel.getDicFromSDR(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getSectionFromId(int sectionId) { string queryStr = "SELECT ss.*, ssc.categoryName, ssc.priceRatio FROM stadiumSections ss INNER JOIN sSectionCategories ssc ON ss.categoryId = ssc.categoryId WHERE ss.sectionId=" + sectionId; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, Object> dic = KardoGeneralModel.getDicFromSDROneRow(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getStadiumFromId(int stadiumId) { string queryStr = "SELECT s.*, ts.sportTypeId FROM stadiums s INNER JOIN theStadiumIsSuitableFor ts ON ts.stadiumId = s.stadiumId WHERE s.stadiumId=" + stadiumId; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, Object> dic = KardoGeneralModel.getDicFromSDROneRow(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getUserFromId(int userId) { string queryStr = "SELECT * FROM users WHERE userId=" + userId; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, Object> dic = KardoGeneralModel.getDicFromSDROneRow(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getEventsDateGroups() { string queryStr = "SELECT * FROM viewEventsDateGroups"; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, List <Object> > dic = KardoGeneralModel.getDicFromSDR(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
public static string getSectionInfo(int eventId, int ssId) { string queryStr = "EXEC procEventTicketInfoOneSec " + eventId + ", " + ssId; SqlCommand sc = new SqlCommand(queryStr, con); SqlDataReader sdr; con.Open(); sdr = sc.ExecuteReader(); Dictionary <string, Object> dic = KardoGeneralModel.getDicFromSDROneRow(sdr); con.Close(); return(KardoStaticMethods.getJSONFromDic(dic)); }
private string runGetOtherAccounts(string[] userIds) { string loginedAccount = ""; if (Session["KardoUserId"] != null) { loginedAccount = UseKardoEncryption.getDecipherString(Session["KardoUserId"].ToString()); } for (int i = 0; i < userIds.Length; i++) { userIds[i] = UseKardoEncryption.getDecipherString(userIds[i]); if (loginedAccount != "" && loginedAccount == userIds[i]) { userIds[i] = "-1"; } } string str = ""; for (int i = 0; i < userIds.Length; i++) { if (str == "") { str += userIds[i]; } else { str += "," + userIds[i]; } } Dictionary <string, List <Object> > users = LoginModel.getUsersFromUserIds(str); string json = KardoStaticMethods.getJSONFromDic(users); return(json); }