예제 #1
0
        /// <summary>
        /// CRM02_1報表(匯出鈕)
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <param name="ReportOutputFormat">報表格式(PDF,EXCEL)</param>
        /// <param name="EOT">匯出Excel方式</param>           
        /// <returns>回傳查詢結果</returns>
        public DataTable CRM02_1(ArrayList ParameterList,
                                 string ReportOutputFormat,
                                 ref ReportList.ExcelOtherType EOT
                                 )
        {

            #region
            CRMModel.QueryCRMTicketReport BCO = new CRMModel.QueryCRMTicketReport(ConntionDB);
            DataTable Dt = BCO.QueryCRMRecordAndTicketByFind(ParameterList);


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


            //設定使用第三方元件匯出EXCEL
            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 = "主管簽核日";
                #endregion

                EOT = ReportList.ExcelOtherType.Normal;
            }


            return Dt;
            #endregion
        }
예제 #2
0
    /// <summary>
    /// 從資料數讀取資料

    /// </summary>
    /// <returns></returns>
    private DataTable GetQueryData()
    {
        #region
        try
        {

            #region 組SQL字串

            System.Text.StringBuilder srb_SQL = new System.Text.StringBuilder();

            srb_SQL.Append(@"
select M.CRM_DATE, M.CRM_NO,
       (select R1.name
         from   SYS_USER R1
         where  R1.CODE = M.BUSUID) as BUSUID_NAME, M.KD, M.REQUEST_NO,
       M.REQUEST_STATEMENT,
       (select R1.name
         from   SYS_USER R1
         where  R1.CODE = M.PROC_MAN) as PROC_MAN_NAME, M.CLOSE_DATE,
       M.CONFIRM_DATE, M.ID
from   VDS_CRM_MAINA_VIEW M
            ");

            srb_SQL.Append(ToMakeSQL().ToString());

            #endregion

            ArrayList ParameterList = new ArrayList();

            ParameterList.Clear();
            ParameterList.Add(srb_SQL.ToString());
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add("CRM021_按下Button[查詢]");

            DataTable dt_Return = new DataTable();

            BCO.QueryCRMTicketReport bco = new BCO.QueryCRMTicketReport(ConntionDB);
            dt_Return = bco.QueryCRMRecordAndTicketByFind(ParameterList);

            return dt_Return;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        #endregion
    }