Ejemplo n.º 1
0
 public BaseForm(SqlConnection cn, string competitionTitle, String baseResourceFile = "ClimbingCompetition.ListHeaderStrings")
     : this(baseResourceFile)
 {
     this.cTitle = competitionTitle;
     if (cn == null || cn.ConnectionString == "")
     {
         cr = SpeedRules.DefaultAll;
         return;
     }
     con = new SqlConnection(cn.ConnectionString);
     try { con.Open(); }
     catch (Exception ex) { MessageBox.Show("Невозможно открыть соединение:\r\n" + ex.Message); }
     try
     {
         cr = SortingClass.GetCompRules(this.cn, false);
         bool leaveTrains = SettingsForm.GetLeaveTrains(this.cn);
         if (leaveTrains)
         {
             cr = cr | SpeedRules.InternationalRules;
         }
         else
         {
             cr = cr & (~SpeedRules.InternationalRules);
         }
     }
     catch (Exception ex)
     {
         cr = SpeedRules.DefaultAll;
         MessageBox.Show("Невозможно определить правила проведения соревнований:\r\n"
                         + ex.Message + "\r\nБудут использоваться российские правила");
     }
 }
Ejemplo n.º 2
0
 public static SpeedRules GetSpeedRules(SqlConnection cn, SqlTransaction tran = null)
 {
     return(SortingClass.GetCompRules(cn, tran));
 }