private void GenerateBasedOnYear() { int year = 0; string s_year = mYearTextBox.Text; string test = MainClass.LeagueFolder+Path.DirectorySeparatorChar+ s_year; if( Directory.Exists(test) ) { year = Int32.Parse( s_year); Season s = new Season(year); string season = s.GenerateSeason(); string fileName = "tmpSeasonGen"; ShowResults(season,fileName); } else { MessageBox.Show(string.Format("Invalid year {0}",s_year)); mYearTextBox.Focus(); mYearTextBox.SelectAll(); } }
private void GenerateBasedOnConfig() { string configFile = GetConfigFile(); string configFileName = "tsbseasongen_temp.tmp"; MainClass.WriteFile(configFileName, configFile); Season s = new Season(configFileName); string season = s.GenerateSeason(); string fileName = "tmpSeasonGen"; ShowResults(season,fileName); }
static void GenSeason(int year) { //try{ //Console.Error.WriteLine("Year = {0}",year); Season s = new Season(year); string str = s.GenerateSeason(); if( System.IO.Path.DirectorySeparatorChar == '\\' ) { str = str.Replace("\r\n","\n"); str = str.Replace("\n", "\r\n"); } Console.WriteLine(str); //} /*catch(Exception e) { Console.Error.WriteLine(e.StackTrace+"\n"+e.Message); }*/ }
private void Go() { int year= 1990; //try //{ year = Int32.Parse(yearTextBox.Text); Season s = new Season(year); this.OutputTextBox.Text = s.GenerateSeason(); //} //catch (Exception e ) //{ // MessageBox.Show(e.Message); //} }
static void GenSeason(string configFile) { //try{ Season s = new Season(configFile); string str = s.GenerateSeason(); if( System.IO.Path.DirectorySeparatorChar == '\\' ) { str = str.Replace("\r\n","\n"); str = str.Replace("\n", "\r\n"); } Console.WriteLine(str); //}catch(Exception e){ // MainClass.AddError(e.StackTrace+"\n"+e.Message); //} }