Exemplo n.º 1
0
        private void mnu17_Click(object sender, RoutedEventArgs e)
        {
            int             y, m, d;
            PersianCalendar pr = new PersianCalendar();

            d = pr.GetDayOfMonth(DateTime.Now);
            m = pr.GetMonth(DateTime.Now);
            y = pr.GetYear(DateTime.Now);
            String date;

            date = y.ToString() + "/" + m.ToString().PadLeft(2, '0');

            Financial_Cost_ALL f1 = new Financial_Cost_ALL();

            f1.Txt_search = "SELECT * FROM Sherkat_hazineh WHERE (datesodor Like '" + date + "%')";
            f1.id_group   = id_idshobe;
            f1.Title      = "مالی";
            f1.Show();
        }
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            string search_amin = "";

            if (comboBox1.SelectedIndex != -1)
            {
                search_amin = search_amin + " (bank LIKE '%" + comboBox1.Text + "%') AND ";
            }

            if (textBox1.Text != "")
            {
                search_amin = search_amin + " (vajhe LIKE '%" + textBox1.Text + "%') AND ";
            }

            if (textBox2.Text != "")
            {
                search_amin = search_amin + " (serialcheck LIKE '%" + textBox2.Text + "%') AND ";
            }

            if (textBox3.Text != "")
            {
                search_amin = search_amin + " (babat LIKE '%" + textBox3.Text + "%') AND ";
            }

            if (comboBox2.SelectedIndex != -1)
            {
                search_amin = search_amin + " (mozo LIKE '%" + comboBox2.Text + "%') AND ";
            }

            if (textBox5.Text != "")
            {
                search_amin = search_amin + " (money1 LIKE '%" + textBox5.Text + "%') AND ";
            }

            if (textBox6.Text != "")
            {
                search_amin = search_amin + " (reciver_men LIKE '%" + textBox6.Text + "%') AND ";
            }

            if (persianDatePicker1.Text != "" && persianDatePicker1.Text != "")
            {
                search_amin = search_amin + " (datesodor >= '" + u_set.control_date_end(persianDatePicker1.Text) + "') AND (datesodor <= '" + u_set.control_date_end(persianDatePicker2.Text) + "') AND ";
            }

            if (persianDatePicker3.Text != "" && persianDatePicker4.Text != "")
            {
                search_amin = search_amin + " (datesarresid >= '" + u_set.control_date_end(persianDatePicker3.Text) + "') AND (datesarresid <= '" + u_set.control_date_end(persianDatePicker4.Text) + "') AND ";
            }

            if (textBox4.Text != "")
            {
                search_amin = search_amin + " (prompt LIKE '%" + textBox4.Text + "%') AND ";
            }

            if (search_amin.Length == 0)
            {
                Financial_Cost_ALL f1 = new Financial_Cost_ALL();
                f1.Txt_search = "SELECT * FROM Sherkat_hazineh";
                f1.id_group   = idshobe;
                f1.Title      = "هزینه";
                f1.Show();
            }
            else
            {
                search_amin = search_amin + " (idshobe = '" + idshobe + "')";
                Financial_Cost_ALL f1 = new Financial_Cost_ALL();
                f1.Txt_search = "SELECT * FROM Sherkat_hazineh WHERE " + search_amin;
                f1.id_group   = idshobe;
                f1.Title      = "هزینه";
                f1.Show();
            }
        }