Пример #1
0
        /// <summary>
        /// MKT07(中分類)匯出報表所需要的資料內容
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <param name="ReportOutputFormat">報表格式(PDF,EXCEL)</param>
        /// <param name="EOT">匯出Excel方式</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable MKT07_2(ArrayList ParameterList,
                                 string ReportOutputFormat,
                                 ref ReportList.ExcelOtherType EOT
                                 )
        {
            MKTModel.MaintainSale BCO = new MKTModel.MaintainSale(ConntionDB);

            DataTable Dt = BCO.QuerySwitch(MKTModel.MaintainSale.QueryType.QueryByCATEGORY, ParameterList);

            if (Dt.Rows.Count == 0)
            {
                throw new Exception("查無資料");
            }

            if (ReportOutputFormat == "EXCEL")
            {
                #region 表頭

                Dt.Columns[0].ColumnName = "群分類";
                Dt.Columns[1].ColumnName = "群分類名稱";
                Dt.Columns[2].ColumnName = "大分類";
                Dt.Columns[3].ColumnName = "大分類名稱";
                Dt.Columns[4].ColumnName = "中分類";
                Dt.Columns[5].ColumnName = "中分類名稱";
                Dt.Columns[6].ColumnName = "進貨數量";
                Dt.Columns[7].ColumnName = "退貨數量";
                Dt.Columns[8].ColumnName = "實銷數量";
                Dt.Columns[9].ColumnName = "進貨牌價";
                Dt.Columns[10].ColumnName = "退貨牌價";
                Dt.Columns[11].ColumnName = "實銷牌價";
                Dt.Columns[12].ColumnName = "進貨成本";
                Dt.Columns[13].ColumnName = "退貨成本";
                Dt.Columns[14].ColumnName = "實銷成本";
                Dt.Columns[15].ColumnName = "進貨零售價";
                Dt.Columns[16].ColumnName = "退貨零售價";
                Dt.Columns[17].ColumnName = "實銷零售價";

                #endregion
                //設定使用第三方元件匯出EXCEL
                EOT = ReportList.ExcelOtherType.Normal;
            }

            return Dt;
        }
Пример #2
0
    protected void ButtonPrint_3_Click(object sender, EventArgs e)
    {
        if (VerifyFormData() == true)
        {
            try
            {
                MKTModel.MaintainSale BCO = new MKTModel.MaintainSale(ConnectionDB);

                ParameterList.Clear();

                ParameterList.Add(GetValueSetParameter(this.TextBoxRowCountLimit.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_MDC_START_DATE.StartDate, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_MDC_START_DATE.EndDate, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_ROOT_NO_S.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_ROOT_NO_E.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_PMA_S.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_PMA_E.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_CATEGORY_S.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_CATEGORY_E.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_SORTOUT_S.Text, "string", false));
                ParameterList.Add(GetValueSetParameter(this.SLP_SORTOUT_E.Text, "string", false));

                DataTable Dt = BCO.QuerySwitch(MKTModel.MaintainSale.QueryType.QueryBySORT, ParameterList);

                if (Dt.Rows.Count == 0)
                {
                    ErrorMsgLabel3.Text = "查無資料";
                    return;
                }
                ShowReport(Dt);
            }
            catch (Exception ex)
            {
                ErrorMsgLabel3.Text = ex.Message;
            }
            finally { }
        }
    }
Пример #3
0
    }//databind_SORT

    private void databind_ITEM()
    {
        #region

        //抓取本頁初次登記的時間

        string SessionIDName = string.Format("{0}_{1}", PAGE_DT_04, PageTimeStamp.Value);

        MKTModel.MaintainSale BCO = new MKTModel.MaintainSale(ConnectionDB);

        ParameterList.Clear();

        ParameterList.Add(GetValueSetParameter(this.TextBoxRowCountLimit.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_MDC_START_DATE.StartDate, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_MDC_START_DATE.EndDate, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_ROOT_NO_S.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_ROOT_NO_E.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_PMA_S.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_PMA_E.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_CATEGORY_S.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_CATEGORY_E.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_SORTOUT_S.Text, "string", false));
        ParameterList.Add(GetValueSetParameter(this.SLP_SORTOUT_E.Text, "string", false));

        DataTable Dt_ITEM = BCO.QuerySwitch(MKTModel.MaintainSale.QueryType.QueryByITEM, ParameterList);
        Session[SessionIDName] = Dt_ITEM;
        GridView4.DataSource = Dt_ITEM;

        //設定分頁大小
        GridView4.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text);
        GridView4.PageIndex = 0;
        GridView4.DataBind();

        if (Dt_ITEM == null || (Dt_ITEM != null && Dt_ITEM.Rows.Count <= 0))
        {
            ErrorMsgLabel4.Text = "查無資料";
            //TabContainer2.ActiveTabIndex = 2;
        }

        #endregion
    }//databind_ITEM