コード例 #1
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            await connection.OpenAsync();

            if (tabControl1.SelectedTab == tabPage1)
            {
                Remains remains = new Remains();
                remains.getAllProducts(connection, selectDbCategory, dataGridView1);
            }
            if (tabControl1.SelectedTab == tabPage2)
            {
                Postings postings = new Postings();
                postings.getAllDocuments(connection, selectDbPostings, dataGridView2);
            }
            if (tabControl1.SelectedTab == tabPage3)
            {
                Postings writeOff = new Postings();
                writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);
            }


            /*Remains remains = new Remains();
             * remains.getAllProducts(connection, selectDbCategory, dataGridView1);
             *
             * Postings postings = new Postings();
             * postings.getAllDocuments(connection, selectDbPostings, dataGridView2);
             *
             * Postings writeOff = new Postings();
             * writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);*/
        }
コード例 #2
0
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            selectDbWriteOff = "SELECT * FROM WriteOff WHERE invoice_number LIKE N'%" + textBox3.Text + "%'";

            Postings writeOff = new Postings();

            writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);
        }
コード例 #3
0
        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            selectDbPostings = "SELECT * FROM Postings WHERE invoice_number LIKE N'%" + textBox2.Text + "%'";

            Postings postings = new Postings();

            postings.getAllDocuments(connection, selectDbPostings, dataGridView2);
        }
コード例 #4
0
 private void tabControl1_Selected(object sender, TabControlEventArgs e)
 {
     if (tabControl1.SelectedTab == tabPage1)
     {
         Remains remains = new Remains();
         remains.getAllProducts(connection, selectDbCategory, dataGridView1);
     }
     if (tabControl1.SelectedTab == tabPage2)
     {
         Postings postings = new Postings();
         postings.getAllDocuments(connection, selectDbPostings, dataGridView2);
     }
     if (tabControl1.SelectedTab == tabPage3)
     {
         Postings writeOff = new Postings();
         writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);
     }
 }
コード例 #5
0
        private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
        {
            Postings writeOff = new Postings();

            if (comboBox3.Text == "За всё время")
            {
                selectDbPostings = "SELECT * FROM WriteOff";
            }

            if (comboBox3.Text == "За сегодня")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date = CONVERT(date, GETDATE())";
            }

            if (comboBox3.Text == "За последние 3 дня")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date >= DATEADD(day, -3, GETDATE())";
            }

            if (comboBox3.Text == "За последнюю неделю")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date >= DATEADD(day, -7, GETDATE())";
            }

            if (comboBox3.Text == "За последний месяц")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date >= DATEADD(day, -30, GETDATE())";
            }

            if (comboBox3.Text == "За последние 6 месяцев")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date >= DATEADD(day, -180, GETDATE())";
            }

            if (comboBox3.Text == "За последний год")
            {
                selectDbPostings = "SELECT * FROM WriteOff WHERE posting_date >= DATEADD(day, -365, GETDATE())";
            }

            writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);
        }
コード例 #6
0
        private void button4_Click(object sender, EventArgs e)
        {
            Postings writeOff = new Postings();

            writeOff.getAllDocuments(connection, selectDbWriteOff, dataGridView3);
        }
コード例 #7
0
        private void button2_Click(object sender, EventArgs e)
        {
            Postings postings = new Postings();

            postings.getAllDocuments(connection, selectDbPostings, dataGridView2);
        }