Beispiel #1
0
        private void evmanage_Click_1(object sender, EventArgs e)
        {
            Form11 form = new Form11();

            form.Show();
        }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 0)
     {
         Form2 form2 = new Form2();
         this.Hide();
         form2.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 1)
     {
         Form3 form3 = new Form3();
         this.Hide();
         form3.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 2)
     {
         Form4 form4 = new Form4();
         this.Hide();
         form4.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 3)
     {
         Form5 form5 = new Form5();
         this.Hide();
         form5.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 4)
     {
         Form6 form6 = new Form6();
         this.Hide();
         form6.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 5)
     {
         Form7 form7 = new Form7();
         this.Hide();
         form7.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 6)
     {
         Form8 form8 = new Form8();
         this.Hide();
         form8.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 7)
     {
         Form9 form9 = new Form9();
         this.Hide();
         form9.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 8)
     {
         Form10 form10 = new Form10();
         this.Hide();
         form10.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 9)
     {
         Form11 form11 = new Form11();
         this.Hide();
         form11.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 0)
     {
         Form12 form12 = new Form12();
         this.Hide();
         form12.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 1)
     {
         Form13 form13 = new Form13();
         this.Hide();
         form13.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 2)
     {
         Form14 form14 = new Form14();
         this.Hide();
         form14.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 3)
     {
         Form15 form15 = new Form15();
         this.Hide();
         form15.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 4)
     {
         Form16 form16 = new Form16();
         this.Hide();
         form16.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 5)
     {
         Form17 form17 = new Form17();
         this.Hide();
         form17.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 6)
     {
         Form18 form18 = new Form18();
         this.Hide();
         form18.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 7)
     {
         Form19 form19 = new Form19();
         this.Hide();
         form19.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 8)
     {
         Form20 form20 = new Form20();
         this.Hide();
         form20.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 9)
     {
         Form21 form21 = new Form21();
         this.Hide();
         form21.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 10)
     {
         Form22 form22 = new Form22();
         this.Hide();
         form22.Show();
     }
 }
Beispiel #3
0
        private void button8_Click(object sender, EventArgs e)
        {
            Form11 form11 = new Form11();

            form11.Show();
        }
Beispiel #4
0
        private void Form8_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                button1.PerformClick();
            }

            if (e.KeyCode == Keys.Oemplus || e.KeyCode == Keys.Add)
            {
                if (tabel == 1)
                {
                    string html2 = string.Empty;
                    int    zi    = DateTime.Today.Day;
                    int    an    = DateTime.Today.Year;
                    int    luna  = DateTime.Today.Month;
                    string url2  = @"https://*****:*****@"https://localhost:8080/createproduct";
                     * // https://localhost:8080/createbill?zi=3&luna=14&an=2444
                     *
                     * HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url2);
                     * request.AutomaticDecompression = DecompressionMethods.GZip;
                     * using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                     * using (Stream stream = response.GetResponseStream())
                     * using (StreamReader reader = new StreamReader(stream))
                     * {
                     *  html2 = reader.ReadToEnd();
                     * }
                     *
                     *
                     * if (html2 == "Executat")
                     * {
                     *  populateDGV2();
                     * }
                     * else if (html2 == "Baza de date offline")
                     * {
                     *  MessageBox.Show("Baza de date offline", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     * }
                     */
                }

                else if (tabel == 3)
                {
                }
            }

            if (e.KeyCode == Keys.Delete)
            {
                if (tabel == 1)
                {
                    if (dataGridView1.SelectedRows.Count == 0)
                    {
                    }
                    else
                    {
                        int counterr = 0;
                        foreach (DataGridViewRow row in dataGridView1.SelectedRows)
                        {
                            int indexx = int.Parse(row.Index.ToString());

                            int id;
                            id = int.Parse(dataGridView1.Rows[indexx].Cells["ID"].Value.ToString());

                            string html23 = string.Empty;
                            string url23  = @"https://*****:*****@"https://localhost:8080/deletegridproduct?id=" + id + "&tip=" + ctip;

                            // https://localhost:8080/deletegridu?id=14
                            Console.WriteLine(url23);
                            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url23);
                            request.AutomaticDecompression = DecompressionMethods.GZip;
                            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                                using (Stream stream = response.GetResponseStream())
                                    using (StreamReader reader = new StreamReader(stream))
                                    {
                                        html23 = reader.ReadToEnd();
                                    }


                            if (html23 == "Executat")
                            {
                                counterr = 1;
                            }
                        }
                        if (counterr == 0)
                        {
                            MessageBox.Show("Baza de date offline", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            populateDGV2();
                        }
                    }
                }

                else if (tabel == 3)
                {
                }
            }

            if (e.Control & e.KeyCode.ToString() == "S")
            {
                if (tabel != 0)
                {
                    using (Form7 form7 = new Form7())
                    {
                        if (form7.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            if (form7.SelectedText == "CSV")
                            {
                                if (tabel == 1)
                                {
                                    SaveToCSV(dataGridView1);
                                }
                                else
                                if (tabel == 2)
                                {
                                    SaveToCSV(dataGridView2);
                                }
                                else
                                if (tabel == 3)
                                {
                                    SaveToCSV(dataGridView3);
                                }
                                else
                                if (tabel == 4)
                                {
                                    SaveToCSV(dataGridView4);
                                }
                            }
                            else if (form7.SelectedText == "PDF")
                            {
                                if (tabel == 1)
                                {
                                    SavePDF(dataGridView1, "Facturi");
                                }
                                else
                                if (tabel == 2)
                                {
                                    SavePDF(dataGridView2, "Produse");
                                }
                                else
                                if (tabel == 3)
                                {
                                    SavePDF(dataGridView3, "Calculatoare");
                                }
                                else
                                if (tabel == 4)
                                {
                                    SavePDF(dataGridView4, "Telefoane");
                                }
                            }
                        }
                    }
                }

                /* if (tabel == 1) {
                 *  SavePDF(dataGridView1);
                 *
                 * } if (tabel == 2)
                 * {
                 *  SaveToCSV(dataGridView2);
                 * }*/
            }

            if (e.KeyCode == Keys.G)
            {
                if (tabel == 2)
                {
                    if (dataGridView2.SelectedRows.Count == 0)
                    {
                    }
                    else
                    {
                        int counterr = 0;
                        foreach (DataGridViewRow row in dataGridView2.SelectedRows)
                        {
                            int indexx = int.Parse(row.Index.ToString());

                            int id;
                            id = int.Parse(dataGridView2.Rows[indexx].Cells["ID"].Value.ToString());
                            string html23 = string.Empty;
                            string url23  = @"https://localhost:8080/generatesale?produs=" + id;

                            // https://localhost:8080/deletegridu?id=14
                            Console.WriteLine(url23);
                            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url23);
                            request.AutomaticDecompression = DecompressionMethods.GZip;
                            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                                using (Stream stream = response.GetResponseStream())
                                    using (StreamReader reader = new StreamReader(stream))
                                    {
                                        html23 = reader.ReadToEnd();
                                    }


                            if (html23 == "Executat")
                            {
                                counterr = 1;
                            }
                        }
                        if (counterr == 0)
                        {
                            MessageBox.Show("Baza de date offline", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            populateDGV2();
                        }
                    }
                }
            }

            if (e.KeyCode == Keys.R)
            {
                using (Form11 f8 = new Form11())
                {
                    f8.ShowDialog(this);
                }
            }
        }
        private void openform11()
        {
            Form11 f11 = new Form11();

            Application.Run(f11);
        }
Beispiel #6
0
        private void продавецToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form11 f11 = new Form11();

            f11.ShowDialog();
        }