示例#1
0
    /// <summary>
    /// BUTTON [查詢]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Query_Click(object sender, EventArgs e)
    {
        try
        {
            #region 檢查條件

            BCO.CAACommon CAAComm = new BCO.CAACommon();

            ArrayList arl_Check_Condition = Check_Condition("BUTTON [查詢]鈕");

            #region 如果檢查有誤,則Return

            if (arl_Check_Condition[1].ToString() != string.Empty)
            {
                #region 錯誤訊息

                this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

                #endregion

                #region Focus欄位

                if (arl_Check_Condition[0].ToString() != string.Empty)
                {
                    string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                    ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CAA331", s_ScriptManager_Script, true);
                }

                #endregion

                return;
            }

            #endregion

            #endregion

            #region 傳入參數

            ParameterList.Clear();
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_GROUP_NO_B.Text, "string", false));//[店群]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_GROUP_NO_E.Text, "string", false));//[店群]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_STORE_ID.Text, "string", false));//[店號]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_PROFIT_NO_B.Text, "string", false));//[利潤中心]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_PROFIT_NO_E.Text, "string", false));//[利潤中心]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_Z_O_B.Text, "string", false));//[營業所]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_Z_O_E.Text, "string", false));//[營業所]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_SAL_ID.Text, "string", false));//[營業人員]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_AC_UID.Text, "string", false));//[帳務人員]

            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_CLOSE_MONTH_B.Text, "string", false));//[結帳年月]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_CLOSE_MONTH_E.Text, "string", false));//[結帳年月]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_DATE.StartDate, "date", false));//[開立日期]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_DATE.EndDate, "date", false));//[開立日期]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_DUE_DATE.StartDate, "date", false));//[帳款到期日]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_DUE_DATE.EndDate, "date", false));//[帳款到期日]迄
            ParameterList.Add(CAAComm.GetValueSetParameter((this.radl_CANCEL_TYPE.Text == "2") ? string.Empty : this.radl_CANCEL_TYPE.Text, "int", false));//[作廢]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_CANCEL_DATE.StartDate, "date", false));//[作廢日期]起
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_CANCEL_DATE.EndDate, "date", false));//[作廢日期]迄
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_FORM.Text, "string", false));//[發票別]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_INV_NO.Text, "string", this.chb_LikeSearch.Checked));//[發票號碼]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false));//[商品群分類]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_TAX_TYPE.Text, "int", false));//[稅別]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.SLP_INVOICE_TYPE.Text, "string", false));//[發票性質]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_ITEM_NAME.Text, "string", this.chb_LikeSearch.Checked));//[品名]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_RFNO.Text, "string", this.chb_LikeSearch.Checked));//[結帳統編]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_VOUCH_RFNO.Text, "string", this.chb_LikeSearch.Checked));//[統一編號]

            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_WASH_AMT.Text, "int", false));//[累積沖帳金額(未稅)]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_WASH_AMT.Operator, "int", false));//[累積沖帳金額(未稅)]Operator
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_REMAIN_AMT.Text, "int", false));//[應收餘額]
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_INV_REMAIN_AMT.Operator, "int", false));//[應收餘額]Operator

            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_MEMO.Text, "string", this.chb_LikeSearch.Checked));//[備註說明]
            ParameterList.Add(CAAComm.GetValueSetParameter((this.txt_RowCountLimit.Text == string.Empty) ? "100" : (int.Parse(this.txt_RowCountLimit.Text) < 0) ? "100" : this.txt_RowCountLimit.Text, "int", false));//[筆數]
            ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//V_LOG_UID

            #endregion

            #region 連結資料庫

            DataTable dt_Return = new DataTable();
            BCO.CAA33_BCO bco = new BCO.CAA33_BCO(ConntionDB);
            dt_Return = bco.QUERY_CAA331_INVOICE(ParameterList);

            #endregion

            #region 資料與GridView繫結

            //抓取本頁初次登記的時間
            string SessionIDName = "CAA331_" + PageTimeStamp.Value;

            Session["SessionID"] = SessionIDName;
            Session[SessionIDName] = dt_Return;

            this.gv_QueryResult.DataSource = dt_Return;
            this.gv_QueryResult.PageSize = (this.txt_Pagesize.Text == string.Empty) ? 20 : (int.Parse(this.txt_Pagesize.Text) < 0) ? 20 : int.Parse(this.txt_Pagesize.Text);
            this.gv_QueryResult.PageIndex = 0;
            this.gv_QueryResult.DataBind();

            #endregion

            #region 將Key值存到Session中

            ArrayList arl_Key = new ArrayList();
            foreach (DataRow drRow in dt_Return.Rows)
            { arl_Key.Add(drRow["INV_NO"].ToString()); }

            Session["CAA332_SortKey" + this.PageTimeStamp.Value] = arl_Key;

            #endregion

            #region 檢查回傳資料

            if (dt_Return.Rows.Count == 0)
            { this.ErrorMsgLabel.Text = "查無資料"; }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
示例#2
0
        /// <summary>
        /// CAA18 頁籤=銷貨折讓維護
        /// </summary>
        /// <param name="ParameterList"></param>
        /// <returns></returns>
        public DataTable CAA33_1(ArrayList ParameterList)
        {
            #region 宣告變數

            BCO.CAACommon CAAComm = new BCO.CAACommon();
            ArrayList arl_ReportService = new ArrayList();
            DataTable dt_Return = new DataTable();
            bool b_LikeSearch;

            #endregion

            #region 傳入參數

            b_LikeSearch = (ParameterList[33].ToString() == "true") ? true : false;

            arl_ReportService.Clear();
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[0].ToString(), "string", false));//[店群]起(0)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[1].ToString(), "string", false));//[店群]迄(1)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[2].ToString(), "string", false));//[店號](2)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[3].ToString(), "string", false));//[利潤中心]起(3)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[4].ToString(), "string", false));//[利潤中心]迄(4)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[5].ToString(), "string", false));//[營業所]起(5)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[6].ToString(), "string", false));//[營業所]迄(6)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[7].ToString(), "string", false));//[營業人員](7)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[8].ToString(), "string", false));//[帳務人員](8)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[9].ToString(), "string", false));//[結帳年月]起(9)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[10].ToString(), "string", false));//[結帳年月]迄(10)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[11].ToString(), "date", false));//[開立日期]起(11)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[12].ToString(), "date", false));//[開立日期]迄(12)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[13].ToString(), "date", false));//[帳款到期日]起(13)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[14].ToString(), "date", false));//[帳款到期日]迄(14)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[15].ToString(), "int", false));//[作廢](15)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[16].ToString(), "date", false));//[作廢日期]起(16)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[17].ToString(), "date", false));//[作廢日期]迄(17)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[18].ToString(), "string", false));//[發票別](18)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[19].ToString(), "string", b_LikeSearch));//[發票號碼](19)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[20].ToString(), "string", false));//[商品群分類](20)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[21].ToString(), "int", false));//[稅別](21)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[22].ToString(), "int", false));//[發票性質](22)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[23].ToString(), "string", b_LikeSearch));//[品名](23)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[24].ToString(), "string", b_LikeSearch));//[結帳統編](24)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[25].ToString(), "string", b_LikeSearch));//[統一編號](25)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[26].ToString(), "int", false));//[累積沖帳金額](26)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[27].ToString(), "int", false));//[累積沖帳金額]Operator(27)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[28].ToString(), "int", false));//[應收餘額](28)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[29].ToString(), "int", false));//[應收餘額]Operator(29)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[30].ToString(), "string", b_LikeSearch));//[備註說明](30)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[31].ToString(), "string", false));//[筆數](31)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[32].ToString(), "string", false));//[V_LOG_UID](30)

            #endregion

            #region 連結資料庫

            BCO.CAA33_BCO bco = new BCO.CAA33_BCO(ConntionDB);
            dt_Return = bco.QUERY_CAA331_INVOICE(arl_ReportService);

            #endregion

            #region 檢查回傳資料

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

            #endregion

            return dt_Return;
        }