예제 #1
0
파일: SeasonsTest.cs 프로젝트: rsalit/CSBC
 public void GetCurrentSeasonTest()
 {
     var rep = new SeasonRepository(context);
     var season = new Season();
     season = rep.GetCurrentSeason(1);
     Assert.IsTrue(season != null);
     Assert.IsTrue(season.SeasonID != 0);
 }
예제 #2
0
파일: SummaryTest.cs 프로젝트: rsalit/CSBC
        public void GetSummaryTest()
        {
            var context = new CSBCDbContext();
            var rep = new SummaryRepository(context);
            var repSeason = new SeasonRepository(context);
            var current = repSeason.GetCurrentSeason(1);

            rep.GetSummary(1, current.SeasonID);
            Assert.IsTrue(false);
        }
예제 #3
0
파일: DivisionTest.cs 프로젝트: rsalit/CSBC
 public void GetDivisionRecordsTest()
 {
     context = new CSBCDbContext();
     var house = new Division();
     var rep = new DivisionRepository(context);
     var seasonRep = new SeasonRepository(context);
     var season = seasonRep.GetCurrentSeason(1);
     var divisions = rep.GetDivisions(season.SeasonID);
     Assert.IsTrue(divisions.Any<Division>());
 }
예제 #4
0
파일: DivisionTest.cs 프로젝트: rsalit/CSBC
        public void GetPlayerDivisionTest()
        {
            context = new CSBCDbContext();
            var repPeople = new PlayerRepository(context);
            var player  = context.Players.FirstOrDefault();
            //var person = repPeople.GetById(2);
            var repSeason = new SeasonRepository(context);
            var season = repSeason.GetCurrentSeason(1);
            var repDivision = new DivisionRepository(context);

            var dt = repDivision.GetPlayerDivision(1, season.SeasonID, player.PeopleID);
            Assert.IsTrue(dt != 0);
        }
예제 #5
0
        protected void InitializeVariables(CSBCDbContext context)
        {
            if (Session["CompanyID"] == null)
                Session["CompanyID"] = 1;

            if (Session["SeasonID"] == null)
            {
                var seasonrep = new SeasonRepository(context);
                var season = seasonrep.GetCurrentSeason(GetSessionCompany());
                Session["SeasonID"] = season.SeasonID;
                //lblSeason.Text = season.Sea_Desc;

            }
            //test other variables
        }
예제 #6
0
파일: TeamTest.cs 프로젝트: rsalit/CSBC
        public void GetDivisionTeamsTest2()
        {
            var divisions = new List<Division>();
            using (var context = new CSBCDbContext())
            {
                var repSeason = new SeasonRepository(context);
                var currentSeason = repSeason.GetCurrentSeason(1);
                var repDivision = new DivisionRepository(context);
                divisions = repDivision.GetDivisions(currentSeason.SeasonID).ToList<Division>();
            }
            var division = divisions.FirstOrDefault();
            var rep = new TeamVM();
            var teams = rep.GetDivisionTeams(division.DivisionID);

            Assert.IsTrue(teams.Any());

            var team = teams.FirstOrDefault();
            Assert.IsTrue(team.DivisionID > 0);
        }
예제 #7
0
파일: login.aspx.cs 프로젝트: rsalit/CSBC
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var rep = new UserRepository(new CSBCDbContext());
            User user = rep.GetUser(txtUserName.Text, txtPassword.Text);
            if ((user == null) || (user.UserID == 0))
            {
                lblError.Text = "Invalid user / password";
                lblError.Visible = true;
            }
            else
            {
                Session["UserID"] = user.UserID;
                Session["UserName"] = user.Name;
                Session["UserType"] = user.UserType;
                Session["CompanyID"] = rep.GetById(user.UserID).CompanyID;
                Session["TestMode"] = checkTestMode.Checked;

                var seasonrep = new SeasonRepository(new CSBCDbContext());
                var season = seasonrep.GetCurrentSeason((int)Session["CompanyID"]);
                Session["SeasonID"] = season.SeasonID;
                Response.Redirect("welcome1.aspx");
            }
        }
예제 #8
0
파일: PlayerTest.cs 프로젝트: rsalit/CSBC
        public void GetSeasonPlayersTest()
        {
            var context = new CSBC.Core.Data.CSBCDbContext();
            var rep = new PlayerRepository(context);
            var repSeason = new SeasonRepository(context);
            var seasonId = repSeason.GetCurrentSeason(1).SeasonID;
            var players = rep.GetPlayers(seasonId);

            Assert.IsTrue(players.Count<SeasonPlayer>() > 0);
        }
예제 #9
0
        private void GetSeason()
        {
            try
            {
                using (var db = new CSBCDbContext())
                {
                    var rep = new SeasonRepository(db);
                    var currentSeason = rep.GetCurrentSeason(1);

                    Session["SeasonDesc"] = currentSeason.Description;
                    Session["SeasonID"] = currentSeason.SeasonID;

                }
            }
            catch (Exception ex)
            {
                //lblError.Text = "GetSeason:" + ex.Message;
            }
        }
예제 #10
0
 private void LoadSeason()
 {
     var rep = new SeasonRepository(new CSBCDbContext());
     var season = new Season();
     //CSBC.Components.Season.ClsSeasons oSeason = new CSBC.Components.Season.ClsSeasons();
     var master = new CSBCAdminMasterPage();
     try
     {
         season = rep.GetCurrentSeason(master.GetSessionCompany());
         //_with1.GetCurrentSeason(1);
         Session["SeasonDesc"] = season.Description;
         Session["CompanyID"] = season.CompanyID;
         Session["SeasonID"] = season.SeasonID;
     }
     catch (Exception ex)
     {
         //lblError.Text = "Invalid Username/Password"
     }
 }
예제 #11
0
        protected void InitializeVariables(CSBCDbContext context)
        {
            if (Session["CompanyID"] == null)
                Session["CompanyID"] = Convert.ToInt32(ConfigurationManager.AppSettings["CompanyId"]);

            if (Session["SeasonID"] == null)
            {
                var seasonrep = new SeasonRepository(context);
                var season = seasonrep.GetCurrentSeason(GetSessionCompany());
                Session["SeasonID"] = season.SeasonID;
                //lblSeason.Text = season.Sea_Desc;

            }
            //test other variables
        }
예제 #12
0
파일: People1.aspx.cs 프로젝트: rsalit/CSBC
        private void LoadPerson(int personId)
        {
            var context = new CSBCDbContext();
            var rep = new PersonRepository(context);
            var person = rep.GetById(personId);
            Master.HouseId = person.HouseID;
            var repSeason = new SeasonRepository(context);
            var seasonId = repSeason.GetCurrentSeason(Master.CompanyId).SeasonID;
            GetPlayerInfo(seasonId, personId);
            if (Master.HouseId > 0)
                ReadHouse();

            LoadPersonDetails(person, PlayerVM.LastSeason(personId));
            PlayerHistory1.LoadPlayerHistory(personId);
            LoadComments(personId);
        }
예제 #13
0
파일: People1.aspx.cs 프로젝트: rsalit/CSBC
 protected void grdMembers_SelectedRowsChange(object sender, EventArgs e)
 {
     //PeopleId = grdMembers.DisplayLayout.ActiveRow.Cells.FromKey("PeopleID").Value;
     if (Master.PeopleId > 0)
     {
         var rep = new SeasonRepository(new CSBCDbContext());
         var currentSeasonId = rep.GetCurrentSeason(Master.CompanyId).SeasonID;
         GetPlayerInfo(currentSeasonId, Master.PeopleId);
         LoadPersonDetails(Master.PeopleId);
         LoadComments(Master.PeopleId);
     }
 }