Пример #1
0
        private async void историяДействийСБДToolStripMenuItem_Click(object sender, EventArgs e)
        {
            button1.Visible   = false;
            comboBox1.Visible = false;
            comboBox2.Visible = false;
            label1.Visible    = false;
            listBox1.Items.Clear();
            try
            {
                using (HttpClient client = new HttpClient())
                {
                    using (HttpResponseMessage response = await client.GetAsync("http://*****:*****@"C:\Users\Adons_\Desktop\ceritif-cert-public.pem");
                            if (Serialization_Encryption_Certification.ValidateXmlDocumentWithCertificate(doc, pubCert))
                            {
                                label1.Text    = "fine";
                                label1.Visible = true;
                            }
                            else
                            {
                                label1.Text    = "В процессе передачи данные были повреждены";
                                label1.Visible = true;
                            }
                            actions_list = Serialization_Encryption_Certification.DeserializeAction(results);

                            foreach (Action p in actions_list)
                            {
                                listBox1.Items.Add(Convert.ToString(p.idAction) + "\t" + Convert.ToString(p.ActionId) + "\t" + Convert.ToString(p.ActionDescription) + "\t" + Convert.ToString(p.PersonId) + "\t" + Convert.ToString(p.Date));
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                listBox1.Items.Add(ex.Message);
            }
            finally
            {
            }
        }
Пример #2
0
        private async void списокТоваровToolStripMenuItem_Click(object sender, EventArgs e)
        {
            label1.Visible = false;
            listBox1.Items.Clear();
            try
            {
                using (HttpClient client = new HttpClient())
                {
                    using (HttpResponseMessage response = await client.GetAsync("http://*****:*****@"C:\Users\Adons_\Desktop\ceritif-cert-public.pem");
                            if (Serialization_Encryption_Certification.ValidateXmlDocumentWithCertificate(doc, pubCert))
                            {
                                label1.Text    = "fine";
                                label1.Visible = true;
                            }
                            else
                            {
                                label1.Text    = "В процессе передачи данные были повреждены";
                                label1.Visible = true;
                            }
                            products_list = Serialization_Encryption_Certification.Deserialize0(results);
                            int c = 0;
                            comboBox1.Items.Add("Любой");
                            comboBox2.Items.Add("Любой");
                            foreach (Product p in products_list)
                            {
                                listBox1.Items.Add(Convert.ToString(p.ProductId) + "\t" + Convert.ToString(p.ProductName) + "\t" + Convert.ToString(p.Addres) + "\t" + Convert.ToString(p.Weigth) + "\t" + Convert.ToString(p.Price));

                                button1.Visible   = true;
                                comboBox1.Visible = true;
                                comboBox2.Visible = true;

                                if (goods.IndexOf(p.ProductName) == -1)
                                {
                                    comboBox1.Items.Add(p.ProductName);
                                }
                                goods.Add(p.ProductName);
                                if (adres.IndexOf(p.Addres) == -1)
                                {
                                    comboBox2.Items.Add(p.Addres);
                                }
                                adres.Add(p.Addres);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                listBox1.Items.Add(ex.Message);
            }
            finally
            {
            }
        }