示例#1
0
        private void mnu2_Click(object sender, RoutedEventArgs e)
        {
            //لیست مشتریان
            AllCustomers    f1 = new AllCustomers();
            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().Substring(2, 2) + m.ToString().PadLeft(2, '0');

            f1.label1.Content = "SELECT * FROM infomen WHERE (idmen Like '" + date + "%')";
            f1.id_group       = id_idshobe;
            f1.Show();
        }
示例#2
0
        private void btn_Clc()
        {
            string search_amin = "";

            if (sel_noe == "1")
            {
                if (textBox1.Text != "" && textBox17.Text != "")
                {
                    search_amin = search_amin + " (idshobe >= '" + textBox1.Text + "') AND (idshobe <= '" + textBox17.Text + "') AND ";
                }

                if (textBox2.Text != "" && textBox19.Text != "")
                {
                    search_amin = search_amin + " (idmen >= '" + textBox2.Text + "') AND (idmen <= '" + textBox19.Text + "') AND ";
                }

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

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

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

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

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

                if (textBox7.Text != "")
                {
                    search_amin = search_amin + " (id LIKE '" + textBox7.Text + "') AND ";
                }

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

                if (textBox9.Text != "")
                {
                    search_amin = search_amin + " (idp LIKE '" + textBox9.Text + "') AND ";
                }

                if (textBox10.Text != "")
                {
                    search_amin = search_amin + " (brithdate LIKE '" + textBox10.Text + "') AND ";
                }

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

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

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

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

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

                if (search_amin.Length == 0)
                {
                    AllCustomers f1 = new AllCustomers();
                    f1.label1.Content = "SELECT * FROM infomen";
                    f1.Show();
                }
                else
                {
                    search_amin = search_amin.Substring(1, search_amin.Length - 5);
                    AllCustomers f1 = new AllCustomers();
                    f1.label1.Content = "SELECT * FROM infomen WHERE " + search_amin;
                    f1.Show();
                }
            }

            if (sel_noe == "2")
            {
                if (textBox1.Text != "" && textBox17.Text != "")
                {
                    search_amin = search_amin + " (S1_idshobe >= '" + textBox1.Text + "') AND (S1_idshobe <= '" + textBox17.Text + "') AND ";
                }

                if (textBox2.Text != "" && textBox19.Text != "")
                {
                    search_amin = search_amin + " (S1_idmen >= '" + textBox2.Text + "') AND (S1_idmen <= '" + textBox19.Text + "') AND ";
                }

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

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

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

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

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

                if (textBox7.Text != "")
                {
                    search_amin = search_amin + " (id LIKE '" + textBox7.Text + "') AND ";
                }

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

                if (textBox9.Text != "")
                {
                    search_amin = search_amin + " (idp LIKE '" + textBox9.Text + "') AND ";
                }

                if (textBox10.Text != "")
                {
                    search_amin = search_amin + " (brithdate LIKE '" + textBox10.Text + "') AND ";
                }

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

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

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

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

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

                if (search_amin.Length == 0)
                {
                    Report_Contract_All f1 = new Report_Contract_All();
                    f1.search_string = "";
                    f1.Show();
                }
                else
                {
                    search_amin = search_amin.Substring(1, search_amin.Length - 5);
                    Report_Contract_All f1 = new Report_Contract_All();
                    f1.search_string = search_amin;
                    f1.Show();
                }

                u_set.u_amal_register("0", this.Title, "", "0", "جستجو");
            }

            this.Hide();
        }