示例#1
0
        public bool getClgSearch(string courseName, string state)
        {
            MySqlParameter[] sqlParameters = new MySqlParameter[2];
            sqlParameters[0]       = new MySqlParameter("@p_course_name", MySqlDbType.VarChar);
            sqlParameters[0].Value = Convert.ToString(courseName);
            sqlParameters[1]       = new MySqlParameter("@p_state", MySqlDbType.VarChar);
            sqlParameters[1].Value = Convert.ToString(state);
            try
            {
                var resultSet = conn.executeSelectMultipleQuery(Constants.GETCLGSEARCH, sqlParameters);
                List <CollegeList> clgList = new List <CollegeList>();
                foreach (DataRow item in resultSet.Tables[0].Rows)
                {
                    CollegeList clgs = new CollegeList(item["clg_name"].ToString(), item["state"].ToString(), item["course_name"].ToString());
                    clgs.ClgName    = item["clg_name"].ToString();
                    clgs.State      = item["state"].ToString();
                    clgs.CourseName = item["course_name"].ToString();
                    clgList.Add(clgs);
                }
                ApplicationSession.Current.CollegeList = clgList;

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        // This is the base player
        public Player(String name, String mainPos, int[] ratings, int height, int weight, int age, CollegeList college, int yearsPro)
        {
            this.name          = name;
            speedRating        = ratings[0];
            accelerationRating = ratings[1];
            strengthRating     = ratings[2];
            jumpRating         = ratings[3];

            gameStats   = new List <StatsHolder>();
            seasonStats = new List <List <StatsHolder> >();
            careerStats = new List <List <List <StatsHolder> > >();

            this.age     = age;
            this.mainPos = mainPos;
            this.college = college;


            SetUpKicker(ratings.Skip(4).Take(3).ToArray());
            SetUpThrower(ratings.Skip(7).Take(7).ToArray());
            SetUpRouteRunner(ratings.Skip(14).Take(5).ToArray());
            SetUpBallCarrier(ratings.Skip(19).Take(5).ToArray());
            SetUpBlocker(ratings.Skip(24).Take(2).ToArray());
            SetDefenderRatings(ratings.Skip(26).Take(5).ToArray());
            SetUpPassRusher(ratings.Skip(31).Take(2).ToArray());
            SetUpCoverage(ratings.Skip(33).Take(3).ToArray());
        }
示例#3
0
        //public bool GetAllPricing()
        //{

        //    MySqlParameter[] sqlParameters = new MySqlParameter[1];
        //    sqlParameters[0] = new MySqlParameter();
        //    List<PricingPlan> pricing = new List<PricingPlan>();

        //    try
        //    {

        //        var resultSet = conn.executeSelectQuery(Constants.GETALLPRICING, sqlParameters);
        //        foreach (DataRow item in resultSet.Rows)
        //        {
        //            //PricingPlan p = new PricingPlan(item[0].ToString(), item[1].ToString(), item[2].ToString(), item[3].ToString(), item[4].ToString(), item[5].ToString());
        //            pricing.Add(new PricingPlan(item["plan_id"].ToString(), item["plan_name"].ToString(), item["plan_price"].ToString(), item["plan_desc"].ToString(), item["plan_duration"].ToString(), item["plan_jobs"].ToString()));
        //            //pricing.Add(new PricingPlan(item[0].ToString(), item[1].ToString(), item[2].ToString(), item[3].ToString(), item[4].ToString(), item[5].ToString()));
        //            //pricing.Add(p);
        //        }
        //        ApplicationSession.Current.Pricing = pricing;
        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public bool getAllClgSearch()
        {
            MySqlParameter[] sqlParameters = new MySqlParameter[1];
            sqlParameters[0] = new MySqlParameter();
            //List<MySqlParameter> parameters = new List<MySqlParameter>();

            Dictionary <int, string> courses = new Dictionary <int, string>();
            Dictionary <int, string> states  = new Dictionary <int, string>();

            try
            {
                var resultSet = conn.executeSelectMultipleQuery(Constants.GETALLCLGSEARCH, sqlParameters);
                foreach (DataRow item in resultSet.Tables[0].Rows)
                {
                    courses.Add(Convert.ToInt32(item["id"]), item["course_name"].ToString());
                    ApplicationSession.Current.Courses = courses;
                }
                foreach (DataRow item in resultSet.Tables[1].Rows)
                {
                    states.Add(Convert.ToInt32(item["id"]), item["state"].ToString());
                    ApplicationSession.Current.States = states;
                }
                List <CollegeList> clgList = new List <CollegeList>();
                foreach (DataRow item in resultSet.Tables[2].Rows)
                {
                    CollegeList clgs = new CollegeList(item["clg_name"].ToString(), item["state"].ToString(), item["course_name"].ToString());
                    clgs.ClgName    = item["clg_name"].ToString();
                    clgs.State      = item["state"].ToString();
                    clgs.CourseName = item["course_name"].ToString();
                    clgList.Add(clgs);
                }
                ApplicationSession.Current.CollegeList = clgList;

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }