Esempio n. 1
0
        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                repoerts_form   rp_form = new repoerts_form();
                ParameterFields pars    = new ParameterFields();
                mony_store      er_rp   = new mony_store();

                ParameterField         start_field_par = new ParameterField();
                ParameterDiscreteValue start_dis       = new ParameterDiscreteValue();
                start_field_par.Name = "start_date";
                start_dis.Value      = s_m_start_date.Text;
                start_field_par.CurrentValues.Add(start_dis);
                pars.Add(start_field_par);



                ParameterField         end_field_par = new ParameterField();
                ParameterDiscreteValue end_dis       = new ParameterDiscreteValue();
                end_field_par.Name = "end_date";
                end_dis.Value      = s_m_end_date.Text;
                end_field_par.CurrentValues.Add(end_dis);
                pars.Add(end_field_par);

                rp_form.rep_crst.ReportSource = er_rp;

                rp_form.rep_crst.ParameterFieldInfo = pars;
                er_rp.Refresh();
                rp_form.ShowDialog();
            }
            catch (Exception dd) { MessageBox.Show(dd.Message); }
        }
Esempio n. 2
0
        private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                repoerts_form   rp_form   = new repoerts_form();
                ParameterFields pars      = new ParameterFields();
                item_analysis   i_anal_rp = new item_analysis();


                ParameterField         start_field_par = new ParameterField();
                ParameterDiscreteValue start_dis       = new ParameterDiscreteValue();
                start_field_par.Name = "start_date";
                start_dis.Value      = anal_start_date.Text;
                start_field_par.CurrentValues.Add(start_dis);
                pars.Add(start_field_par);


                ParameterField         it_id_field_par = new ParameterField();
                ParameterDiscreteValue it_id_dis       = new ParameterDiscreteValue();
                it_id_field_par.Name = "item_id";

                if (anal_sanf_cod_bx.Text.Trim() != "")
                {
                    it_id_dis.Value = anal_sanf_cod_bx.Text.Trim();
                }
                else
                {
                    it_id_dis.Value = 1;
                }

                it_id_field_par.CurrentValues.Add(it_id_dis);
                pars.Add(it_id_field_par);



                ParameterField         end_field_par = new ParameterField();
                ParameterDiscreteValue end_dis       = new ParameterDiscreteValue();
                end_field_par.Name = "end_date";
                end_dis.Value      = anal_end_date.Text;
                end_field_par.CurrentValues.Add(end_dis);
                pars.Add(end_field_par);

                rp_form.rep_crst.ReportSource = i_anal_rp;

                rp_form.rep_crst.ParameterFieldInfo = pars;
                i_anal_rp.Refresh();
                rp_form.ShowDialog();
            }
            catch (Exception dd) { MessageBox.Show(dd.Message); }
        }
Esempio n. 3
0
        private void QueryBTN_Click(object sender, EventArgs e)
        {
            repoerts_form          RForm         = new repoerts_form();
            SalesCR                SalesRep      = new SalesCR();
            ParameterFields        SalesParam    = new ParameterFields();
            ParameterField         FromDate      = new ParameterField();
            ParameterDiscreteValue FromDatevalue = new ParameterDiscreteValue();
            ParameterField         ToDate        = new ParameterField();
            ParameterDiscreteValue ToDatevalue   = new ParameterDiscreteValue();
            ParameterField         CatId         = new ParameterField();
            ParameterDiscreteValue CatIdValue    = new ParameterDiscreteValue();
            ParameterField         RbF           = new ParameterField();
            ParameterDiscreteValue RbFvalue      = new ParameterDiscreteValue();
            ParameterField         AgentId       = new ParameterField();
            ParameterDiscreteValue AgentIdvalue  = new ParameterDiscreteValue();
            ParameterField         ItemId        = new ParameterField();
            ParameterDiscreteValue ItemIdvalue   = new ParameterDiscreteValue();
            ParameterField         OperType      = new ParameterField();
            ParameterDiscreteValue OperTypevalue = new ParameterDiscreteValue();

            ParameterField         op_type = new ParameterField();
            ParameterDiscreteValue op_dis  = new ParameterDiscreteValue();

            op_type.Name = "op_type";
            op_type.CurrentValues.Add(op_dis);
            op_dis.Value = OperTypeCB.Text;
            {
                FromDate.Name       = "fromDate";
                FromDatevalue.Value = FromDateTB.Text;
                ToDate.Name         = "ToDate";
                ToDatevalue.Value   = ToDateTB.Text;
                ItemId.Name         = "ItemId";
                RbF.Name            = "RbF";
                AgentId.Name        = "AgentId";
                CatId.Name          = "CatId";
                OperType.Name       = "OperType";
                OperTypevalue.Value = "'SEL'";
                if (OperTypeCB.SelectedIndex == 1)
                {
                    OperTypevalue.Value = "'REF'";
                }
                CatIdValue.Value   = 0;
                AgentIdvalue.Value = 0;
                if (CategoryCB.Text.Trim() != "")
                {
                    CatIdValue.Value = CategoryCB.SelectedValue;
                }
                if (AgentQCB.Text.Trim() != "")
                {
                    AgentIdvalue.Value = AgentQCB.SelectedValue;
                }

                ItemIdvalue.Value = 0;
                // RbFvalue.Value = 6;
                if (ItemIdTB.Text != "" && sel_rp_cod_rdbtn.Checked)
                {
                    ItemIdvalue.Value = ItemIdTB.Text;
                }
                else if (ItemCB.Text != "" && ItemRB.Checked)
                {
                    ItemIdvalue.Value = meth.select_sanf_data_by_name(ItemCB.Text.Trim()).Rows[0][0];
                }

                if (sel_rp_cod_rdbtn.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 0;
                }
                else if (sel_rp_cod_rdbtn.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 1;
                }



                if (ItemRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 0;
                }
                else if (ItemRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 1;
                }
                else if (CatRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 2;
                }
                else if (CatRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 3;
                }
                else if (AllRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 4;
                }
                else if (AllRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 5;
                }
                AgentId.CurrentValues.Add(AgentIdvalue);
                FromDate.CurrentValues.Add(FromDatevalue);
                ToDate.CurrentValues.Add(ToDatevalue);
                ItemId.CurrentValues.Add(ItemIdvalue);
                RbF.CurrentValues.Add(RbFvalue);
                CatId.CurrentValues.Add(CatIdValue);
                OperType.CurrentValues.Add(OperTypevalue);
                SalesParam.Add(ToDate);
                SalesParam.Add(OperType);
                SalesParam.Add(RbF);
                SalesParam.Add(AgentId);
                SalesParam.Add(FromDate);
                SalesParam.Add(ItemId);
                SalesParam.Add(CatId);
                SalesParam.Add(op_type);

                RForm.rep_crst.ReportSource       = SalesRep;
                RForm.rep_crst.ParameterFieldInfo = SalesParam;
                RForm.Show();
                RForm.Dock = DockStyle.Fill;
            }
        }
Esempio n. 4
0
        private void mor_acc_rep_lnk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                repoerts_form mor_rp_form = new repoerts_form();

                pay_ag_period p_mor_rp = new pay_ag_period();


                ParameterFields mor_params = new ParameterFields();
                //////////mor name/////////////
                ParameterField         mor_name_par = new ParameterField();
                ParameterDiscreteValue mor_nam_dis  = new ParameterDiscreteValue();
                mor_nam_dis.Value = 0;
                mor_name_par.Name = "mor_id";
                if (mor_name_cmbx.Text.Trim() != "")
                {
                    mor_nam_dis.Value = meth.select_mor_by_name_or_code(mor_name_cmbx.SelectedValue.ToString(), "NULL").Rows[0][0];
                }



                mor_name_par.CurrentValues.Add(mor_nam_dis);
                mor_params.Add(mor_name_par);
                /////////////////////////////////////////////////////choice////////
                ParameterField         choice_par = new ParameterField();
                ParameterDiscreteValue choice_dis = new ParameterDiscreteValue();

                choice_par.Name = "choice_par";
                if (query_choice_cmbx.SelectedIndex == 0)
                {
                    choice_dis.Value = 1;
                }
                else
                {
                    choice_dis.Value = 0;
                }


                choice_par.CurrentValues.Add(choice_dis);
                mor_params.Add(choice_par);

                //////////////////////////////////////////////////////////////////////////////////////////////////////start date
                ParameterField         mor_start_dat_par = new ParameterField();
                ParameterDiscreteValue mor_start_dat_dis = new ParameterDiscreteValue();

                mor_start_dat_par.Name  = "start_date";
                mor_start_dat_dis.Value = mor_acc_start_date.Text;

                mor_start_dat_par.CurrentValues.Add(mor_start_dat_dis);
                mor_params.Add(mor_start_dat_par);
                ///////////////////////////////////////////////////////////end date//////////////
                ParameterField         mor_end_dat_par = new ParameterField();
                ParameterDiscreteValue mor_end_dat_dis = new ParameterDiscreteValue();

                mor_end_dat_par.Name  = "end_date";
                mor_end_dat_dis.Value = mor_acc_end_date.Text;

                mor_end_dat_par.CurrentValues.Add(mor_end_dat_dis);
                mor_params.Add(mor_end_dat_par);
                ////////////////////////////////////////////////////////////////////////////////////////
                mor_rp_form.rep_crst.ParameterFieldInfo = mor_params;
                mor_rp_form.rep_crst.ReportSource       = p_mor_rp;

                mor_rp_form.ShowDialog();
            }
            catch (Exception ff)
            {
                MessageBox.Show(ff.Message + " طباعة تقرير حسابات مورد");
            }
        }
Esempio n. 5
0
        private void earn_lnklbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                try
                {
                    partener_cmbx.DisplayMember = "paretener_name";
                    partener_cmbx.ValueMember   = "partener_id";
                    string     datelastday;
                    total_earn ec = new total_earn();
                    /// datelastday = (Int32.Parse(DateTime.Now.Day.ToString()) - 1).ToString();
                    //datelastday = datelastday + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
                    if (earn_all_part_rdbtn.Checked)
                    {
                        ec.EarnCalcOper(earn_start_date.Text, earn_end_date.Text, "");
                    }
                    else
                    {
                        ec.EarnCalcOper(earn_start_date.Text, earn_end_date.Text, partener_cmbx.SelectedValue.ToString());
                    }
                }
                catch (Exception ff)
                {
                    MessageBox.Show(ff.Message);
                }

                repoerts_form    rp_form = new repoerts_form();
                ParameterFields  pars    = new ParameterFields();
                earn_rp          er_rp   = new earn_rp();
                earn_partener_rp e_part  = new earn_partener_rp();

                ParameterField         start_field_par = new ParameterField();
                ParameterDiscreteValue start_dis       = new ParameterDiscreteValue();
                start_field_par.Name = "start_date";
                start_dis.Value      = earn_start_date.Text;
                start_field_par.CurrentValues.Add(start_dis);
                pars.Add(start_field_par);



                ParameterField         end_field_par = new ParameterField();
                ParameterDiscreteValue end_dis       = new ParameterDiscreteValue();
                end_field_par.Name = "end_date";
                end_dis.Value      = earn_end_date.Text;
                end_field_par.CurrentValues.Add(end_dis);
                pars.Add(end_field_par);


                if (earn_all_part_rdbtn.Checked)
                {
                    rp_form.rep_crst.ReportSource = er_rp;

                    rp_form.rep_crst.ParameterFieldInfo = pars;
                    er_rp.Refresh();
                    rp_form.ShowDialog();
                }
                else
                {
                    ParameterField         part_id_par = new ParameterField();
                    ParameterDiscreteValue part_id_dis = new ParameterDiscreteValue();
                    part_id_par.Name  = "partener_name";
                    part_id_dis.Value = partener_cmbx.Text;
                    part_id_par.CurrentValues.Add(part_id_dis);
                    pars.Add(part_id_par);
                    rp_form.rep_crst.ReportSource = e_part;

                    rp_form.rep_crst.ParameterFieldInfo = pars;
                    e_part.Refresh();
                    rp_form.ShowDialog();
                }
            }
            catch (Exception ss)
            {
                MessageBox.Show(ss.Message);
            }
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
        private void bar_prnt_btn_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand delete_cmd = connect_sal.CreateCommand();
                delete_cmd.CommandText = "delete from barcode_table";
                connect_sal.Open();
                delete_cmd.ExecuteNonQuery();
                connect_sal.Close();


                SqlCommand insert_bar_cmd = connect_sal.CreateCommand();
                if (bar_grid.Rows.Count > 0)
                {
                    string bar = "";
                    for (int i = 0; i < bar_grid.Rows.Count; i++)
                    {
                        for (int count = 0; count < Convert.ToInt32(bar_grid.Rows[i].Cells[2].Value.ToString()); count++)
                        {
                            bar = "*0000" + bar_grid.Rows[i].Cells[0].Value.ToString() + "*";


                            insert_bar_cmd.CommandText = "insert into barcode_table(sanf_code_b, sanf_code, price, sanf_name, qat_pric" +
                                                         ")values('" + bar + "','" +
                                                         bar_grid.Rows[i].Cells[0].Value.ToString() + "','" +

                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][3].ToString() + "','" +
                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][1].ToString() + "','" +
                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][4].ToString() +

                                                         "')";
                            connect_sal.Open();
                            insert_bar_cmd.ExecuteNonQuery();
                            connect_sal.Close();
                        }
                    }
                    if (a4_compl_rdbnt.Checked)
                    {
                        repoerts_form report_frm = new repoerts_form();
                        bar_rp        br         = new bar_rp();
                        PageMargins   margins;

                        // Get the PageMargins structure and set the
                        // margins for the report.

                        margins = br.PrintOptions.PageMargins;
                        margins.bottomMargin = 0;
                        margins.leftMargin   = 0;
                        margins.rightMargin  = 0;
                        margins.topMargin    = 0
                        ;
                        // Apply the page margins.
                        br.PrintOptions.ApplyPageMargins(margins);

                        // Select the printer.
                        br.PrintOptions.PrinterName = p_name.Trim();// "HP LaserJet Professional P1102";

                        /* PrinterSettings p_s=new PrinterSettings();
                         * //p_s.PrinterName = "HP LaserJet Professional P1102";
                         * p_s.PrinterName = "HP LaserJet Professional P1102";
                         * PaperSize s=new PaperSize();
                         *
                         *
                         * PageSettings ps=new PageSettings();
                         *
                         * float ds=0;
                         * //  ps.PaperSize.RawKind = ps.PaperSize.PaperName;
                         * ds= ps.HardMarginY-1;
                         * // MessageBox.Show(ds.ToString());
                         * ps.Margins.Top = 0;
                         * ps.Margins.Bottom = 0;
                         *
                         * ps.Margins.Right = 0;
                         * ps.Margins.Left = 0;*/


                        //  report_frm.rep_crst.ReportSource = br;
                        br.Refresh();

                        //////////////
                        // br.PrintToPrinter(p_s,ps,false);
                        ////////////////////////
                        if (copy_n_bx.Text.Trim() != "")
                        {
                            br.PrintToPrinter(Int32.Parse(copy_n_bx.Text.Trim()), true, 1, 1);
                            bar_grid.Rows.Clear();
                        }
                        else
                        {
                            MessageBox.Show("من فضلك ادخل عدد النسخ");
                        }
                    }
                    else if (a4_splited_rdbtn.Checked)
                    {
                        repoerts_form report_frm = new repoerts_form();
                        barcode       br         = new barcode();
                        PageMargins   margins;

                        // Get the PageMargins structure and set the
                        // margins for the report.

                        /*  margins = br.PrintOptions.PageMargins;
                         * margins.bottomMargin = 0;
                         * margins.leftMargin = 0;
                         * margins.rightMargin = 0;
                         * margins.topMargin = 1300;
                         * // Apply the page margins.
                         * // br.PrintOptions.ApplyPageMargins(margins);
                         *
                         * // Select the printer.
                         * br.PrintOptions.PrinterName = p_name.Trim();// "HP LaserJet Professional P1102";
                         *
                         * br.Refresh();
                         *
                         * //////////////
                         * // br.PrintToPrinter(p_s,ps,false);
                         * ////////////////////////
                         * if (copy_n_bx.Text.Trim() != "")
                         * {
                         *    br.PrintToPrinter(Int32.Parse(copy_n_bx.Text.Trim()), true, 1, 1);
                         *    bar_grid.Rows.Clear();
                         * }
                         * else
                         *    MessageBox.Show("من فضلك ادخل عدد النسخ");*/
                        br.Refresh();
                        br.ExportToDisk(ExportFormatType.PortableDocFormat, "2.pdf");

                        string path = "2.pdf"; //<- your path here.
                        if (path.EndsWith(".pdf"))
                        {
                            if (File.Exists(path))
                            {
                                ProcessStartInfo info = new ProcessStartInfo();
                                info.Verb = "open";

                                info.FileName       = path;
                                info.CreateNoWindow = true;
                                info.WindowStyle    = ProcessWindowStyle.Hidden;
                                Process p = new Process();
                                p.StartInfo = info;
                                p.Start();

                                /*  p.WaitForInputIdle();
                                 * System.Threading.Thread.Sleep(6000);
                                 * if (false == p.CloseMainWindow())
                                 *    p.Kill();*/
                            }
                        }
                    }
                }
            }
            catch (Exception dd)
            {
                MessageBox.Show(dd.Message);
                connect_sal.Close();
            }
        }
Esempio n. 8
0
        private void show_bef_prnt_btn_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand delete_cmd = connect_sal.CreateCommand();
                delete_cmd.CommandText = "delete from barcode_table";
                connect_sal.Open();
                delete_cmd.ExecuteNonQuery();
                connect_sal.Close();


                SqlCommand insert_bar_cmd = connect_sal.CreateCommand();
                if (bar_grid.Rows.Count > 0)
                {
                    string bar = "";

                    for (int i = 0; i < bar_grid.Rows.Count; i++)
                    {
                        for (int count = 0; count < Convert.ToInt32(bar_grid.Rows[i].Cells[2].Value.ToString()); count++)
                        {
                            bar = "*" + bar_grid.Rows[i].Cells[0].Value.ToString() + "*";


                            insert_bar_cmd.CommandText = "insert into barcode_table(sanf_code_b, sanf_code, price, sanf_name, qat_pric" +
                                                         ")values('" + bar + "','" +
                                                         bar_grid.Rows[i].Cells[0].Value.ToString() + "','" +

                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][3].ToString() + "','" +
                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][1].ToString() + "','" +
                                                         meth.select_sanf_data_by_barcode_orcode(bar_grid.Rows[i].Cells[0].Value.ToString().Trim()).Rows[0][4].ToString() +

                                                         "')";
                            connect_sal.Open();
                            insert_bar_cmd.ExecuteNonQuery();
                            connect_sal.Close();
                        }
                    }
                    if (a4_compl_rdbnt.Checked)
                    {
                        repoerts_form report_frm = new repoerts_form();
                        bar_rp        br         = new bar_rp();



                        report_frm.rep_crst.ReportSource = br;

                        br.Refresh();
                        report_frm.rep_crst.ExportReport();
                        report_frm.ShowDialog();
                    }
                    else if (a4_splited_rdbtn.Checked)
                    {
                        repoerts_form report_frm = new repoerts_form();
                        barcode       br2        = new barcode();



                        report_frm.rep_crst.ReportSource = br2;
                        //CrystalDecisions.Shared.ExportOptions op = new ExportOptions();
                        // op.ExportFormatOptions = CrystalDecisions.Shared.ExportOptions.CreateHTMLFormatOptions();
                        // op.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.HTML40;

                        br2.Refresh();
                        //  br2.Export(op); //.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.HTML40, "1");


                        report_frm.ShowDialog();
                    }
                }
            }
            catch (Exception dd)
            {
                MessageBox.Show(dd.Message);
                connect_sal.Close();
            }
        }
Esempio n. 9
0
        private void sels_of_part_lnklbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                repoerts_form     rp_form    = new repoerts_form();
                ParameterFields   pars       = new ParameterFields();
                sels_partener_rep sel_par_rp = new sels_partener_rep();

                ParameterField         part_id_par = new ParameterField();
                ParameterDiscreteValue part_id_dis = new ParameterDiscreteValue();
                part_id_par.Name = "parte_id";
                if (parte_cmbx.Text != "")
                {
                    part_id_dis.Value = parte_cmbx.SelectedValue.ToString();
                }
                else
                {
                    part_id_dis.Value = 0;
                }
                part_id_par.CurrentValues.Add(part_id_dis);
                pars.Add(part_id_par);

                ParameterField         tas_id_par = new ParameterField();
                ParameterDiscreteValue tas_id_dis = new ParameterDiscreteValue();
                tas_id_par.Name = "tasneef_id";
                if (tasneef_cmbx.SelectedIndex >= 0)
                {
                    tas_id_dis.Value = tasneef_cmbx.SelectedValue.ToString();
                }
                else
                {
                    tas_id_dis.Value = 0;
                }
                tas_id_par.CurrentValues.Add(tas_id_dis);
                pars.Add(tas_id_par);


                ParameterField         type_s_par = new ParameterField();
                ParameterDiscreteValue type_s_dis = new ParameterDiscreteValue();
                type_s_par.Name = "type_of_serach";
                if (sels_part_about_cmbx.SelectedIndex == 0)
                {
                    type_s_dis.Value = 0;
                }
                else if (sels_part_about_cmbx.SelectedIndex == 1)
                {
                    type_s_dis.Value = 1;
                }
                else
                {
                    type_s_dis.Value = 2;
                }
                type_s_par.CurrentValues.Add(type_s_dis);
                pars.Add(type_s_par);

                ParameterField         start_field_par = new ParameterField();
                ParameterDiscreteValue start_dis       = new ParameterDiscreteValue();
                start_field_par.Name = "start_date";
                start_dis.Value      = sels_parte_start_date.Text;
                start_field_par.CurrentValues.Add(start_dis);
                pars.Add(start_field_par);



                ParameterField         end_field_par = new ParameterField();
                ParameterDiscreteValue end_dis       = new ParameterDiscreteValue();
                end_field_par.Name = "end_date";
                end_dis.Value      = sels_part_end_date.Text;
                end_field_par.CurrentValues.Add(end_dis);
                pars.Add(end_field_par);

                ParameterField         comp_field_par = new ParameterField();
                ParameterDiscreteValue comp_dis       = new ParameterDiscreteValue();
                comp_field_par.Name = "compant_par";
                if (company_cmbx.Text.Trim() != "")
                {
                    comp_dis.Value = company_cmbx.SelectedValue.ToString();
                }
                else
                {
                    comp_dis.Value = "0";
                }
                comp_field_par.CurrentValues.Add(comp_dis);
                pars.Add(comp_field_par);
                rp_form.rep_crst.ReportSource = sel_par_rp;

                rp_form.rep_crst.ParameterFieldInfo = pars;
                sel_par_rp.Refresh();
                rp_form.ShowDialog();
            }
            catch (Exception dd) { MessageBox.Show(dd.Message); }
        }