Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form10 f = new Form10();

            this.Hide();
            f.ShowDialog();
            Close();
        }
Esempio n. 2
0
        private void button9_Click(object sender, EventArgs e)
        {
            Form10 f = new Form10();

            f.ShowDialog();
        }
Esempio n. 3
0
        private void контактыToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form10 f10 = new Form10();

            f10.ShowDialog();
        }
Esempio n. 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 hücreSaymaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form10 invert = new Form10();

            invert.ShowDialog();
        }