コード例 #1
0
ファイル: grd_rp1.cs プロジェクト: tareksmart/geaorg
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            grd_rp rpt = new grd_rp();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void gard_stor_rp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                repoerts_form rp_form = new repoerts_form();
                rp_form.WindowState = FormWindowState.Normal;
                grd_rp          sanf_rem_rp     = new grd_rp();
                ParameterFields sanf_rem_params = new ParameterFields();

                ParameterField rem_choic_par = new ParameterField();
                ParameterField rem_value_par = new ParameterField();
                ParameterField sanf_name_par = new ParameterField();


                ParameterDiscreteValue rem_choic_dis = new ParameterDiscreteValue();
                ParameterDiscreteValue rem_value_dis = new ParameterDiscreteValue();
                ParameterDiscreteValue sanf_name_dis = new ParameterDiscreteValue();
                rem_choic_dis.Value = 0;
                rem_value_dis.Value = 0;
                sanf_name_dis.Value = 0;

                rem_choic_par.Name = "remain_choic_par";
                rem_value_par.Name = "sanf_search_value";
                sanf_name_par.Name = "sanf_name_par";



                Int64 sanf_code = 0;
                if (gard_sanf_code_rdbtn.Checked && grd_sanf_cod_bx.Text.Trim() != "")//كود الصنف
                {
                    rem_choic_dis.Value = 0;
                    sanf_code           = Int64.Parse(grd_sanf_cod_bx.Text.Trim());
                    if (meth.select_sanf_data_by_barcode_orcode(sanf_code.ToString()).Rows.Count > 0)
                    {
                        rem_value_dis.Value = meth.select_sanf_data_by_barcode_orcode(sanf_code.ToString()).Rows[0][0].ToString();
                    }
                    else
                    {
                        MessageBox.Show("لايوجد صنف بهذا الكود");
                    }

                    grd_sanf_cod_bx.Clear();
                }
                if (gard_sanf_name_rdbtn.Checked)//اسم الصنف
                {
                    if (grd_sanf_nam_bx.Text.Trim() != "")
                    {
                        rem_choic_dis.Value = 1;
                        sanf_name_dis.Value = grd_sanf_nam_bx.Text.Trim();
                    }
                    else
                    {
                        MessageBox.Show("من فضلك ادخل اسم الصنف");
                    }
                }
                if (gard_tasn_rdbtn.Checked)//كود القسم
                {
                    if (grd_tasn_bx.Text.Trim() != "")
                    {
                        rem_choic_dis.Value = 2;
                        rem_value_dis.Value = meth.select_tasn_data_bynam_orcode("NULL", grd_tasn_bx.Text.Trim()).Rows[0][0].ToString();
                    }

                    else
                    {
                        MessageBox.Show("من فضلك ادخل التصنيف");
                    }
                }
                if (gard_all_rdbtn.Checked)//الكل
                {
                    rem_choic_dis.Value = 3;
                    rem_value_dis.Value = 0;
                }
                if (company_chbtn.Checked)//الشركه
                {
                    rem_choic_dis.Value = 4;
                    rem_value_dis.Value = company_cmbx.SelectedValue.ToString()
                    ;
                }

                rem_choic_par.CurrentValues.Add(rem_choic_dis);
                rem_value_par.CurrentValues.Add(rem_value_dis);
                sanf_name_par.CurrentValues.Add(sanf_name_dis);

                sanf_rem_params.Add(rem_choic_par);
                sanf_rem_params.Add(rem_value_par);
                sanf_rem_params.Add(sanf_name_par);


                rp_form.rep_crst.ParameterFieldInfo = sanf_rem_params;
                rp_form.rep_crst.ReportSource       = sanf_rem_rp;

                sanf_rem_rp.Refresh();
                rp_form.ShowDialog();
            }
            catch (Exception ff)
            {
                MessageBox.Show(ff.Message);
            }
        }