Example #1
0
        private void طباعةالتقفيلةكاملةToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Program.def_P = "";
            DataTable tbl = new DataTable();

            tbl = db.Ce_runquery("select branch_id,t_month,t_year from Customers where branch_id='" + br_find1.SelectedValue + "' and t_month='" + mon_find.Text + "' and t_year='" + year_find.Text + "' ");
            PrintDialog  pd  = new PrintDialog();
            DialogResult pdr = pd.ShowDialog();

            if (pdr == System.Windows.Forms.DialogResult.OK)
            {
                Program.def_P = pd.PrinterSettings.PrinterName;

                if (br_find1.SelectedIndex != -1)
                {
                    if (tbl.Rows.Count == 1)
                    {
                        LocalReport.CusView n = new LocalReport.CusView((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        n.Show();
                        LocalReport.kedksmmas v = new LocalReport.kedksmmas((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        v.Show();
                        LocalReport.viewr k = new LocalReport.viewr((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        k.ShowDialog();
                        LocalReport.DarM c = new LocalReport.DarM((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        c.Show();
                        LocalReport.morcus m = new LocalReport.morcus((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        m.ShowDialog();
                        LocalReport.cusmor y = new LocalReport.cusmor((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        y.ShowDialog();
                        LocalReport.brviewer b = new LocalReport.brviewer((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                        b.ShowDialog();
                        prentmor();
                        prentsader();
                    }
                    else
                    {
                        MessageBox.Show("لم يتم تسجيل البيانات");
                    }
                }
                else
                {
                    MessageBox.Show("اختار الفرع من فضلك");
                }

                Program.def_P = "";
            }
            if (pdr == System.Windows.Forms.DialogResult.Cancel)
            {
                MessageBox.Show("تم إلغاء الطباعة");
                return;
            }
        }
Example #2
0
        private void توجيهمنمرتدلعملاءToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Program.def_P = "";
            DataTable tbl = new DataTable();

            tbl = db.Ce_runquery("select branch_id,t_month,t_year from Customers where branch_id='" + br_find1.SelectedValue + "' and t_month='" + mon_find.Text + "' and t_year='" + year_find.Text + "' ");
            if (tbl.Rows.Count == 1)
            {
                if (br_find1.SelectedIndex != -1)
                {
                    LocalReport.morcus c = new LocalReport.morcus((int)br_find1.SelectedValue, Convert.ToInt32(mon_find.Text), Convert.ToInt32(year_find.Text));
                    c.ShowDialog();
                }
                else
                {
                    MessageBox.Show("اختار الفرع من فضلك");
                }
            }
            else
            {
                MessageBox.Show("لم يتم تسجيل البيانات");
            }
        }