static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ProtocolForm form = new ProtocolForm(); Application.Run(form); }
public Import() { this.InitializeComponent(); this.con = new Connection(); this.name = ""; this.form2 = new ProtocolForm(); this.licensePath = ""; this.c = new Certificate(); }
public EnteringCodes(string protocolName, string savePath, string OU, string licensePath, ProtocolForm form) { this.InitializeComponent(); this.posts = new System.Collections.Generic.List <string>(); this.savePath = savePath; this.protocol = protocolName; this.OU = OU; this.f = form; this.licensePath = licensePath; this.errorsList.Visible = false; }
public Import(string fileName, string licensePath, ProtocolForm pf, XmlDocument header) { this.InitializeComponent(); this.con = new Connection(); this.name = fileName; this.form2 = pf; this.licensePath = licensePath; this.c = new Certificate(); string[] filenameTab = this.name.Split(new char[] { '\\' }); string filename = filenameTab[filenameTab.Length - 1]; string post = "flag=import&filename=" + HttpUtility.UrlEncode(filename); string[] item = filename.Split(new char[] { '-' }); post = post + "&akcja=" + HttpUtility.UrlEncode(item[0].Replace('_', '/')); post = post + "&jsn=" + item[1]; this.obwod = item[2]; this.inst = item[3]; string[] okr = item[4].Replace(".xml", "").Split(new char[] { ' ' }); this.okreg = okr[0]; XmlNode headerRoot = header.SelectSingleNode("/akcja_wyborcza/jns"); foreach (XmlNode xObwod in headerRoot) { if (xObwod.Attributes["nr"].InnerText == this.obwod) { foreach (XmlNode xInst in xObwod) { if (xInst.Attributes["kod"].InnerText == this.inst) { this.instId = xInst.Attributes["id"].InnerText; foreach (XmlNode xOkreg in xInst) { if (xOkreg.Attributes["nr"].InnerText == this.okreg) { this.okregId = xOkreg.Attributes["id"].InnerText; } } } } } } }
public Commit(string filepath, ProtocolForm pf) { this.InitializeComponent(); this.filepath = filepath; this.form2 = pf; this.LoginNext.Click -= new System.EventHandler(this.LoginNext_Click); this.LoginNext.Click += new System.EventHandler(this.LoginNext2_Click); this.loggin = false; string[] filepathpart = filepath.Split(new char[] { '\\' }); this.label1.Text = filepathpart[filepathpart.Length - 1].Replace(".pem", ""); this.form2.goodcertificate = false; this.codeBarLabel.Visible = false; }
public Eksport(string savePath, bool send, ProtocolForm p, string licensePath) { this.p = p; this.InitializeComponent(); this.licensePath = licensePath; this.con = new Connection(); this.c = new Certificate(); this.savePath = savePath; if (send) { this.Text = "Wysyłanie protokołu na serwer"; this.log.Click -= new System.EventHandler(this.log_Click); this.log.Click += new System.EventHandler(this.send_Click); } else { this.Text = "Eksport"; this.log.Click += new System.EventHandler(this.log_Click); this.log.Click -= new System.EventHandler(this.send_Click); } this.pass = ""; this.path = (this.path = System.IO.Path.GetTempPath() + "KBW"); }
public Commit(string filepath, ProtocolForm pf, string xml) { this.InitializeComponent(); this.filepath = filepath; this.form2 = pf; this.LoginNext.Click -= new System.EventHandler(this.LoginNext_Click); this.LoginNext.Click += new System.EventHandler(this.LoginNext2_Click); this.loggin = false; string[] filepathpart = filepath.Split(new char[] { '\\' }); this.label1.Text = filepathpart[filepathpart.Length - 1].Replace(".pem", ""); this.form2.goodcertificate = false; string docXml = ""; XmlDocument save = new XmlDocument(); save.LoadXml(xml); XmlNode header = save.SelectSingleNode("/save/header"); if (header != null) { docXml += header.OuterXml; } XmlNode step = save.SelectSingleNode("/save/step"); if (step != null) { docXml += step.OuterXml; } XmlNode form = save.SelectSingleNode("/save/form"); if (form != null) { docXml += form.OuterXml; } XmlNode komisja_sklad = save.SelectSingleNode("/save/komisja_sklad"); if (komisja_sklad != null) { docXml += komisja_sklad.OuterXml; } XmlNode hardWarningCode = save.SelectSingleNode("/save/hardWarningCode"); if (hardWarningCode != null) { docXml += hardWarningCode.OuterXml; } XmlNode softError = save.SelectSingleNode("/save/softError"); if (softError != null) { docXml += softError.OuterXml; } XmlNode hardError = save.SelectSingleNode("/save/hardError"); if (hardError != null) { docXml += hardError.OuterXml; } XmlNode hardWarning = save.SelectSingleNode("/save/hardWarning"); if (hardWarning != null) { docXml += hardWarning.OuterXml; } ClassMd5 i = new ClassMd5(); string controlSum = i.CreateMD5Hash(docXml); codeBar code = new codeBar(); code.generateCode(controlSum); this.codeBarLabel.Text = "Podpisywanie protokołu o kodzie kreskowym: " + '\n'.ToString() + code.getTextReadable(); this.codeBarLabel.Visible = true; }