Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString))
            {
                return;
            }

            if ((tbGzbdh.Text.Trim() == "") || tbGzbdh.Text == null)
            {
                return;
            }

            LYFunctionCs.frmReportView frv = new LYFunctionCs.frmReportView();

            ReportDocument Rpt = new ReportDocument();

            string pRptNmae = "";

            pRptNmae = LYFunctionCs.LYFunctionCsClass.cmdScalar("select cm.report_file from cc_cold_chain_c cc left join cc_cold_chain_z cz on cc.pkunid=cz.unid left join cc_item_master cm on cc.size_desc=cm.size_desc and cm.season=cz.season where pkunid='" + tbGzbdh.Text + "' and  cm.report_file is not null and rownum=1 ", CommFunction.ConnectString);
            if ((pRptNmae.Trim() == "") || (pRptNmae == null))
            {
                pRptNmae = "Rep_CC_ITEM_TRACK.rpt";
            }

            Rpt.Load(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + pRptNmae);

            TableLogOnInfo logOnInfo = new TableLogOnInfo();

            logOnInfo.ConnectionInfo.ServerName = CommFunction.cfServerName;
            logOnInfo.ConnectionInfo.UserID     = CommFunction.cfUserID;
            logOnInfo.ConnectionInfo.Password   = CommFunction.cfPassword;

            Rpt.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
            //Rpt.Refresh();

            frv.crystalReportViewer1.ReportSource = Rpt;


            CrystalDecisions.Shared.ParameterValues        mypaVal  = new CrystalDecisions.Shared.ParameterValues();
            CrystalDecisions.Shared.ParameterDiscreteValue mypaDVal = new CrystalDecisions.Shared.ParameterDiscreteValue();
            mypaDVal.Value = tbGzbdh.Text;

            mypaVal.Add(mypaDVal);
            Rpt.DataDefinition.ParameterFields["GZBDH"].ApplyCurrentValues(mypaVal);

            frv.ShowDialog();
        }
Esempio n. 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString)) return;

            if ((tbUnid.Text.Trim() == "") || tbUnid.Text == null) { return; }

            LYFunctionCs.frmReportView frv = new LYFunctionCs.frmReportView();

            ReportDocument Rpt = new ReportDocument();

            string pRptNmae = "";
            pRptNmae = LYFunctionCs.LYFunctionCsClass.cmdScalar("select cm.report_file from cc_cold_chain_c cc left join cc_cold_chain_z cz on cc.pkunid=cz.unid left join cc_item_master cm on cc.size_desc=cm.size_desc and cm.season=cz.season where pkunid='" + tbUnid.Text + "' and  cm.report_file is not null and rownum=1 ", CommFunction.ConnectString);
            if ((pRptNmae.Trim() == "") || (pRptNmae == null))
                pRptNmae = "Rep_CC_ITEM_TRACK.rpt";

            Rpt.Load(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + pRptNmae);

            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            logOnInfo.ConnectionInfo.ServerName = CommFunction.cfServerName;
            logOnInfo.ConnectionInfo.UserID = CommFunction.cfUserID;
            logOnInfo.ConnectionInfo.Password = CommFunction.cfPassword;

            Rpt.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
            //Rpt.Refresh();

            frv.crystalReportViewer1.ReportSource = Rpt;

            CrystalDecisions.Shared.ParameterValues mypaVal = new CrystalDecisions.Shared.ParameterValues();
            CrystalDecisions.Shared.ParameterDiscreteValue mypaDVal = new CrystalDecisions.Shared.ParameterDiscreteValue();
            mypaDVal.Value = tbUnid.Text;

            mypaVal.Add(mypaDVal);
            Rpt.DataDefinition.ParameterFields["GZBDH"].ApplyCurrentValues(mypaVal);

            frv.ShowDialog();

            LYFunctionCs.LYFunctionCsClass.cmd("update cc_cold_chain_z set ifprint='1' where UNID='"+tbUnid.Text+"'", CommFunction.ConnectString);
        }