Esempio n. 1
0
        /// <summary>
        /// COM03報表
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable COM03_1(ArrayList ParameterList,
                                 string ReportOutputFormat,
                                 ref ReportList.ExcelOtherType EOT
                                 )
        {
            COMModel.QueryQtySum bco = new COMModel.QueryQtySum(ConntionDB);
            DataTable Dt = new DataTable();
            switch (ParameterList[8].ToString())
            {
                case "1":
                    Dt = bco.QueryByChanNo(ParameterList);
                    break;
                case "2":
                    Dt = bco.QueryByZO(ParameterList);
                    break;
                case "3":
                    Dt = bco.QueryByAreaCode(ParameterList);
                    break;
            }

            if (Dt.Rows.Count == 0)
            {
                throw new Exception("查無資料");
            }
            else
            {
                DataRow[] dr = Dt.Select("ROW_NO='合計'");
                Dt.Rows.Remove(dr[0]);
                //DataTable dt = new DataView(Dt, "ROW_NO not in ('合計')", string.Empty, DataViewRowState.CurrentRows).ToTable();
                return Dt;
            }
        }
Esempio n. 2
0
    public DataTable searchData()
    {
        #region 前置檢查與參數過濾


        string txt_SLP_SKU = this.SLP_SKU.Text;

        string txt_SLP_ItemPeriod = this.SLP_ItemPeriod.Text;

        string txt_SLP_User = this.SLP_User.Text;

        string txt_SLP_Issuance_Date = this.SLP_Issuance_Date.Text;

        string txt_SLP_Period_End_Date = this.SLP_Period_End_Date.Text;

        #endregion

        #region 清空靜態變數
        dt_Detail = null;
        #endregion

        #region 處理查詢 1:通路,2:營業所,3:縣市別
        ParameterList.Clear();
        ParameterList.Add(GetValueSetParameter(txt_SLP_SKU, "string"));//[品號]
        ParameterList.Add(GetValueSetParameter(txt_SLP_ItemPeriod, "string"));//[期別]
        ParameterList.Add(GetValueSetParameter(txt_SLP_Issuance_Date, "string"));
        ParameterList.Add(GetValueSetParameter(txt_SLP_Period_End_Date, "string"));
        ParameterList.Add(GetValueSetParameter(txt_SLP_User, "string"));
        ParameterList.Add(GetValueSetParameter(this.TextBoxRowCountLimit.Text, "int"));//筆數
        ParameterList.Add(SLP_BUS_DATE.StartDate); //進貨日期起
        ParameterList.Add(SLP_BUS_DATE.EndDate); //進貨日期迄
        BCO.QueryQtySum bco = new QueryQtySum(ConntionDB);
        DataTable Dt = null;

        if (this.searchType.Value == "1") //1:通路,2:營業所,3:縣市別
        {
            Dt = bco.QueryByChanNo(ParameterList);
        }
        else if (this.searchType.Value == "2")
        {
            Dt = bco.QueryByZO(ParameterList);
        }
        else if (this.searchType.Value == "3")
        {
            Dt = bco.QueryByAreaCode(ParameterList);
        }

        #endregion