示例#1
0
 public void CreateSDTP(sdtpModel sdtp)
 {
     using (IDbConnection connection = new MySqlConnection(GlobalConfig.CnnString(db)))
     {
         var p = new DynamicParameters();
         p.Add("@InSeasonID", sdtp.SeasonID);
         p.Add("@InDivisionID", sdtp.DivisionID);
         p.Add("@InSeasonDivisionsID", sdtp.SeasonDivisionsID);
         p.Add("@InDivisionTeamsID", sdtp.DivisionTeamsID);
         p.Add("@InTeamID", sdtp.TeamID);
         p.Add("@InRosterID", sdtp.RosterID);
         p.Add("@InPersonID", sdtp.PersonID);
         connection.Execute("spSeasonDivisionTeamPlayers", p, commandType: CommandType.StoredProcedure);
     }
 }
示例#2
0
        public sdtpModel GetSdtpModel(int sdtpID)
        {
            List <sdtpModel> output;
            sdtpModel        sdtp = new sdtpModel();

            using (IDbConnection connection = new MySqlConnection(GlobalConfig.CnnString(db)))
            {
                var p = new DynamicParameters();
                p.Add("@InSdtpID", sdtpID);

                output = connection.Query <sdtpModel>("spGetSdtpModel", p, commandType: CommandType.StoredProcedure).ToList();
            }

            foreach (sdtpModel model in output)
            {
                sdtp = model;
            }
            return(sdtp);
        }
        private void dateComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            thisGame = (GameModel)dateComboBox.SelectedValue;
            thisGame.HomeTeamModel = (TeamModel)allTeams.FirstOrDefault(x => x.TeamID == thisGame.HomeTeam);
            thisGame.AwayTeamModel = (TeamModel)allTeams.FirstOrDefault(x => x.TeamID == thisGame.AwayTeam);

            if (thisGame.HomeTeamModel.TeamID != 0)
            {
                //TODO work out whats missing here if anything
            }
            //DateTime date = thisGame.GameDate;
            sdtp = GlobalConfig.Connection.GetSdtpModel(sdtpID);
            DivisionTeamsModel dtmAway = GlobalConfig.Connection.GetDivisionTeamModel(sdtp.SeasonDivisionsID, thisGame.AwayTeamModel.TeamID);
            DivisionTeamsModel dtmHome = GlobalConfig.Connection.GetDivisionTeamModel(sdtp.SeasonDivisionsID, thisGame.HomeTeamModel.TeamID);

            thisGame.HomeTeamPlayers = GlobalConfig.Connection.GetTeamMembers(dtmHome);
            thisGame.AwayTeamPlayers = GlobalConfig.Connection.GetTeamMembers(dtmAway);
            t1Available = thisGame.HomeTeamPlayers;
            t2Available = thisGame.AwayTeamPlayers;
            WireupTeamComboBoxes(thisGame);
        }
示例#4
0
 public void CreateSDTP(sdtpModel sdtp)
 {
     throw new NotImplementedException();
 }