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 bool creatNewVisitor()
        {
            string ipAddress = Request.Form["ipAddress"];
            string country   = Request.Form["country"];
            string city      = Request.Form["city"];
            string loc       = Request.Form["loc"];
            string hostname  = Request.Form["hostname"];
            string language  = Request.Form["language"];
            string nowDate   = KardoStaticMethods.getNowDateTimeUTC();

            return(runCreatNewVisitor(ipAddress, country, city, loc, hostname, language, nowDate));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 8
0
        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));
        }
        public bool updateEvent()
        {
            string fileName  = "NULL";
            string updatePic = Request.Form["updatePic"];

            if (updatePic == "true")
            {
                try
                {
                    for (int i = 0; i < Request.Files.Count; i++)
                    {
                        HttpPostedFileBase file = Request.Files[i];
                        //int fileSize = file.ContentLength;
                        string extension = Path.GetExtension(file.FileName);
                        fileName = KardoStaticMethods.createKardoUID() + extension;
                        //string mimeType = file.ContentType;
                        System.IO.Stream fileContent = file.InputStream;
                        file.SaveAs(Server.MapPath("~/Content/kardoPasso/img/uploads/") + fileName);
                    }
                }
                catch
                {
                    return(false);
                }
            }

            string hTeamIdS    = Request.Form["hTeamId"];
            string oTeamIdS    = Request.Form["oTeamId"];
            string stadiumIdS  = Request.Form["stadiumId"];
            string eventDate   = Request.Form["eventDate"];
            string description = Request.Form["description"];
            string priceS      = Request.Form["price"];
            string eventIdS    = Request.Form["eventId"];

            int   hTeamId, oTeamId, stadiumId, eventId;
            bool  isNumeric1 = int.TryParse(hTeamIdS, out hTeamId);
            bool  isNumeric2 = int.TryParse(oTeamIdS, out oTeamId);
            bool  isNumeric3 = int.TryParse(stadiumIdS, out stadiumId);
            bool  isNumeric5 = int.TryParse(eventIdS, out eventId);
            float price;
            bool  isNumeric4 = float.TryParse(priceS, out price);

            if (!isNumeric1 || !isNumeric2 || !isNumeric3 || !isNumeric4 || !isNumeric5)
            {
                return(false);
            }

            return(PagePanelModel.updateEvent(hTeamId, oTeamId, stadiumId, eventDate, description, price, fileName, eventId));;
        }
Esempio n. 10
0
        public string completeRegistry()
        {
            string userName           = Request.Form["userName"];
            string eMail              = Request.Form["eMail"];
            string password           = Request.Form["password"];
            string rName              = Request.Form["rName"];
            string sName              = Request.Form["sName"];
            string day                = Request.Form["day"];
            string month              = Request.Form["month"];
            string year               = Request.Form["year"];
            string nowDate            = KardoStaticMethods.getNowDateTimeUTC();
            string languagePreference = Request.Form["languagePreference"];

            return(runCompleteRegistry(userName, eMail, password, rName, sName, day, month, year, nowDate, languagePreference));
        }
        public bool updateStadium()
        {
            string fileName  = "NULL";
            string updatePic = Request.Form["updatePic"];

            if (updatePic == "true")
            {
                try
                {
                    for (int i = 0; i < Request.Files.Count; i++)
                    {
                        HttpPostedFileBase file      = Request.Files[i];
                        string             extension = Path.GetExtension(file.FileName);
                        fileName = KardoStaticMethods.createKardoUID() + extension;
                        System.IO.Stream fileContent = file.InputStream;
                        file.SaveAs(Server.MapPath("~/Content/kardoPasso/img/uploads/") + fileName);
                    }
                }
                catch
                {
                    return(false);
                }
            }

            string name           = Request.Form["name"];
            string sportTypeIdStr = Request.Form["sportTypeId"];
            string country        = Request.Form["country"];
            string state          = Request.Form["state"];
            string city           = Request.Form["city"];
            string location       = Request.Form["location"];
            string streetAdd      = Request.Form["streetAdd"];
            string stadiumIdS     = Request.Form["stadiumId"];

            int  sportTypeId, stadiumId;
            bool isNumeric1 = int.TryParse(sportTypeIdStr, out sportTypeId);
            bool isNumeric2 = int.TryParse(stadiumIdS, out stadiumId);

            if (!isNumeric1 || !isNumeric2)
            {
                return(false);
            }

            return(EditStadiumModel.updateStadium(name, fileName, location, streetAdd, state, city, country, sportTypeId, stadiumId));
        }
Esempio n. 12
0
        //changeAccount
        public string changeAccount()
        {
            string UUID = Request.Form["uuid"];

            if (UUID != null || UUID.Length > 0)
            {
                Dictionary <string, List <Object> > theUser = LoginModel.getUserFromUUID(UUID);
                if (theUser.Count == 0)
                {
                    return("errorUUID");
                }


                string userLoginKey = (string)theUser["username"][0];
                string remember_me  = "checked";

                string   session_checkbox = "unchecked";
                string[] status           = Request.Cookies["KardoUserInfos"]["status"].Split('_');
                for (int i = 0; i < status.Length; i++)
                {
                    if (status[i] == "active")
                    {
                        session_checkbox = "checked";
                        break;
                    }
                }

                string password  = userLoginKey + "_doNotControl";
                string ipAddress = Request.Form["ipAddress"];
                string country   = Request.Form["country"];
                string city      = Request.Form["city"];
                string loc       = Request.Form["loc"];
                string hostname  = Request.Form["hostname"];
                string nowDate   = KardoStaticMethods.getNowDateTimeUTC();
                runControlLogin(userLoginKey, remember_me, session_checkbox, password);//, ipAddress, country, city, loc, hostname, nowDate
                return("True");
            }
            return("errorUUID");
        }
        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);
        }
Esempio n. 14
0
        private string runCompleteRegistry(string userName, string eMail, string password, string rName, string sName, string day, string month, string year, string nowDate, string languagePreference)
        {
            string date = year + "-" + month + "-" + day;

            controlRegistryValues(userName, eMail, password, rName, sName, date, nowDate, languagePreference);
            if (userName == "invalid" || eMail == "invalid" || password == "invalid" || rName == "invalid" || sName == "invalid" || date == "invalid")
            {
                return("errorValues");
            }

            bool result = LoginModel.insertUser(
                userName.ToLower(),
                eMail.ToLower(),
                UseKardoEncryption.getEncryptedString(password, 65),
                KardoStaticMethods.FirstCharToUpper(rName),
                KardoStaticMethods.FirstCharToUpper(sName),
                date,
                languagePreference
                );

            if (!result)
            {
                return("False");
            }


            int userId = (int)LoginModel.getUserFromUsernameOrMail(userName)["userId"][0];

            string activationKey = UseKardoEncryption.getEncryptedString(userId, 50) + "-" + KardoStaticMethods.creatUniqString(36);//(min)50+1+36 char

            LoginModel.setAKeyForEMail(userId, activationKey);

            string verifyAccountLink = "/Login/verifyAccount?activationKey=" + activationKey;

            return("True");
        }