using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Data;
using System.Data.SqlClient;

using Sybase.DataWindow;
using TXSoft.Common;
using TXSoft.ExtPB;
using TXSoft.DataStore;


namespace A8ERP.CaiGou.Base
{
    public partial class W_CaiGou_Rkjl
    {
        public W_CaiGou_Rkjl()
        {

        }
        public override void OnLoad()
        {
            base.OnLoad();
            this.Title = "Èë¿â¼ÇÂ¼";
            DBHelp db = new DBHelp();
            db.Open();
            string cmfw = "";
            string cmz = "";
            DataTable dt = db.QueryRDataTable("select zb.cmfw,bt.* from da_sp_cmbt bt,da_sp_cmdm dm,da_sp_cmzb zb,da_sp_spda sp where zb.cmdm=dm.cmdm and dm.cmbt=bt.cmbt and sp.spkh='" + (Request["spkh"] + "' and sp.cmzbm=zb.cmzbm"));
            if (dt.Rows.Count > 0)
            {
                cmfw = dt.Rows[0][0].ToString();
                int cl = 0;
                for (int i = 2; i <= 36; i++)
                {

                   // if (dt.Rows[0][i].ToString() != null && dt.Rows[0][i].ToString() != "")
                    {
                        if (cl == 0)
                        {
                            cmz += dt.Rows[0][i].ToString();
                        }
                        else
                        {
                            cmz += "#" + dt.Rows[0][i].ToString();
                        }
                        cl++;
                    }
                }
            }
            db.Close();
            this.SetParm("cmfw", cmfw);
            this.SetParm("cmz", cmz);
            ReportService service = (ReportService)dw_list.Services.Add(ServiceName.Report);
        }
    }
}
