public RegionList()
 {
     this.InitializeComponent();
     this.path = System.IO.Path.GetTempPath() + "KBW";
     this.con = new Connection();
     this.jns = "";
     this.wait = new WaitPanel("Wait2", base.Width, base.Height);
     base.Controls.Add(this.wait.getPanel());
     base.Controls[this.wait.getName()].BringToFront();
     this.start = null;
     this.licensepath = "";
 }
Exemple #2
0
 public Commit(string filepath, Start start)
 {
     this.InitializeComponent();
     this.filepath = filepath;
     this.form = start;
     this.loggin = false;
     string[] filepathpart = filepath.Split(new char[]
     {
         '\\'
     });
     this.label1.Text = filepathpart[filepathpart.Length - 1].Replace(".pem", "");
     this.form.logged = false;
     this.codeBarLabel.Visible = false;
 }
 public RegionList(Start start, string licensepath, string jns)
 {
     this.con = new Connection();
     this.path = System.IO.Path.GetTempPath() + "KBW";
     this.InitializeComponent();
     this.licensepath = licensepath;
     this.jns = jns;
     this.start = start;
     this.Text = this.Text + " (" + Kalkulator1.instalClass.Version.getVersion().ToString() + ")";
     this.wait = new WaitPanel("Wait99", base.Width, base.Height);
     base.Controls.Add(this.wait.getPanel());
     base.Controls[this.wait.getName()].BringToFront();
     this.exit = false;
     this.getRegions(true);
     if (this.exit)
     {
         base.Close();
     }
 }
 public ProtocolsList()
 {
     this.InitializeComponent();
     this.path = System.IO.Path.GetTempPath() + "KBW";
     this.con = new Connection();
     this.header = new XmlDocument();
     this.electoralEampaignSave = "";
     this.jns = "";
     this.role = "";
     this.circuit = "";
     this.wait = new WaitPanel("Wait2", base.Width, base.Height);
     base.Controls.Add(this.wait.getPanel());
     base.Controls[this.wait.getName()].BringToFront();
     this.start = null;
     this.licensepath = "";
     this.electionData = new System.DateTime(2014, 8, 27, 7, 0, 0);
     this.send = false;
     this.powiat = false;
     this.erros = false;
 }
 public ProtocolsList(string filepath, Start start, string licensepath, string version)
 {
     this.InitializeComponent();
     this.start = start;
     start.wait.setWaitPanel("Trwa wczytywanie protokołów", "Proszę czekać");
     start.wait.setVisible(true);
     this.version = version;
     this.licensepath = licensepath;
     this.erros = false;
     this.Text = this.Text + " (" + Kalkulator1.instalClass.Version.getVersion().ToString() + ")";
     this.path = System.IO.Path.GetTempPath() + "KBW";
     this.electionData = new System.DateTime(1, 1, 1, 0, 0, 0);
     DataTable dt = new DataTable();
     this.con = new Connection();
     this.header = new XmlDocument();
     System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(filepath);
     string subjectCert = cert.Subject;
     string[] tab = subjectCert.Split(new string[]
     {
         ", "
     }, System.StringSplitOptions.None);
     for (int i = 0; i < tab.Length; i++)
     {
         if (System.Text.RegularExpressions.Regex.IsMatch(tab[i], "^OU="))
         {
             string[] tmp = tab[i].Replace("OU=", "").Split(new char[]
             {
                 '-'
             });
             this.electoralEampaignURL = tmp[0];
             this.electoralEampaignSave = tmp[0].Replace('/', '_');
             this.electoralEampaignSave = this.electoralEampaignSave.Replace(" ", "");
             this.jns = tmp[1];
             this.role = tmp[2];
             if (this.role == "P" || this.role == "Z")
             {
                 this.circuit = tmp[3];
             }
             if (this.role == "O" || this.role == "A")
             {
                 this.panWyszukiwanie.Visible = true;
                 this.txtWyszukaj.Focus();
             }
             break;
         }
     }
     this.powiat = false;
     this.wait = new WaitPanel("Wait2", base.Width, base.Height);
     base.Controls.Add(this.wait.getPanel());
     base.Controls[this.wait.getName()].BringToFront();
     this.protocolsTable.CellClick += new DataGridViewCellEventHandler(this.getProtocol_CellClick);
     if (!System.IO.Directory.Exists(this.path + "\\electoralEampaign"))
     {
         try
         {
             System.IO.Directory.CreateDirectory(this.path + "\\electoralEampaign");
         }
         catch (System.ArgumentNullException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
         catch (System.ArgumentException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
         catch (System.UnauthorizedAccessException)
         {
             MessageBox.Show("Nie masz uprawnień do tworzenia katalogów. Otwórz aplikacje jako adnimistrator.", "Uwaga");
         }
         catch (System.IO.PathTooLongException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
         catch (System.IO.DirectoryNotFoundException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
         catch (System.NotSupportedException)
         {
             MessageBox.Show("Nieprawidłowy format ścieżki. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
         catch (System.IO.IOException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"electoralEampaign\"", "Error");
         }
     }
     if (!System.IO.Directory.Exists(this.path + "\\ProtocolsDef"))
     {
         try
         {
             System.IO.Directory.CreateDirectory(this.path + "\\ProtocolsDef");
         }
         catch (System.ArgumentNullException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
         catch (System.ArgumentException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
         catch (System.UnauthorizedAccessException)
         {
             MessageBox.Show("Nie masz uprawnień do tworzenia katalogów. Otwórz aplikacje jako adnimistrator.", "Uwaga");
         }
         catch (System.IO.PathTooLongException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
         catch (System.IO.DirectoryNotFoundException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
         catch (System.NotSupportedException)
         {
             MessageBox.Show("Nieprawidłowy format ścieżki. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
         catch (System.IO.IOException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"ProtocolsDef\"", "Error");
         }
     }
     if (!System.IO.Directory.Exists(this.path + "\\saves"))
     {
         try
         {
             System.IO.Directory.CreateDirectory(this.path + "\\saves");
         }
         catch (System.ArgumentNullException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"saves\"", "Error");
         }
         catch (System.ArgumentException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"saves\"", "Error");
         }
         catch (System.UnauthorizedAccessException)
         {
             MessageBox.Show("Nie masz uprawnień do tworzenia katalogów. Otwórz aplikacje jako administrator.", "Uwaga");
         }
         catch (System.IO.PathTooLongException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"saves\"", "Error");
         }
         catch (System.IO.DirectoryNotFoundException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"saves\"", "Error");
         }
         catch (System.NotSupportedException)
         {
             MessageBox.Show("Nieprawidłowy format ścieżki. Nie można utworzyć katalogu \"saves\"", "Error");
         }
         catch (System.IO.IOException)
         {
             MessageBox.Show("Nieprawidłowa ścieżka. Nie można utworzyć katalogu \"saves\"", "Error");
         }
     }
     this.getKLK(true);
     this.getProtocols(true);
     start.wait.setVisible(false);
 }