예제 #1
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);
        }
예제 #2
0
 private int GetDivision()
 {
     ClsDivisions oDivisions = new CSBC.Components.Season.ClsDivisions();
     var rep = new DivisionRepository(new CSBCDbContext());
     var rsData = rep.GetPlayerDivision(Master.CompanyId, Master.SeasonId, Master.PeopleId);
     try
     {
         if (rsData == 0)
         {
             Master.DivisionId = 0;
         }
         else
         {
             Master.DivisionId = rsData;
         }
         return Master.DivisionId;
     }
     catch (Exception ex)
     {
         lblError.Text = "GetDivision::" + ex.Message;
         return 0;
     }
 }