예제 #1
0
    private void Save_DataTable()
    {
        try
        {
            string SessionIDName = "PSS021_" + PageTimeStamp.Value;
            DataTable dt = (DataTable)Session[SessionIDName];

            ParameterList.Clear();
            ParameterList.Add(SLP_ADJUST_DATE.Text); //0
            ParameterList.Add("E8"); //1
            ParameterList.Add(SLP_UPDATEUID.Text); //2
            ParameterList.Add(DateTime.Now); //3
            ParameterList.Add(SLP_UPDATEUID.Text); //4
            ParameterList.Add(DateTime.Now); //5
            ParameterList.Add(txtSTART_DATE.Text); //6 差異年月
            ParameterList.Add((txtE8_PLUS.Text == "系統自動產生") ? "" : txtE8_PLUS.Text);
            ParameterList.Add((txtE8_MINUS.Text == "系統自動產生") ? "" : txtE8_MINUS.Text);

            BCO.MaintainAdjust bco = new BCO.MaintainAdjust(ConntionDB);
            bco.ProcessAdjustData(ParameterList, dt, null);

            if (dt.Rows.Count > 0)
                this.lbPageRowCount.Text = "總共" + Math.Ceiling(dt.Rows.Count / 15.0) + "頁 /共" + dt.Rows.Count.ToString() + "筆";
            else
                this.lbPageRowCount.Text = "";


            Response.Redirect("PSS022.aspx?Code=PSS02&AJD=" + SLP_ADJUST_DATE.Text + "&AJM=" + txtSTART_DATE.Text + "&ShowMsg=Y&ss=" + DateTime.Now.ToString("mmss"));
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }
예제 #2
0
    private void Query_Data()
    {
        ParameterList.Clear();
        ParameterList.Add(Request.QueryString["AJM"]);
        BCO.MaintainAdjust bco = new BCO.MaintainAdjust(ConntionDB);

        #region 查詢帳差正項調整單號,帳差負項調整單號

        DataTable dtAdjustNo = bco.QueryAdjustNo(ParameterList);

        this.txtE8_PLUS.Text = dtAdjustNo.Rows[0]["E8_PLUS"].ToString();//正項調整單號
        this.txtE8_MINUS.Text = dtAdjustNo.Rows[0]["E8_MINUS"].ToString();//負項調整單號

        if (this.txtE8_PLUS.Text == "")
            this.txtE8_PLUS.Text = "系統自動產生";

        if (this.txtE8_MINUS.Text == "")
            this.txtE8_MINUS.Text = "系統自動產生";

        #endregion

        DataTable dt = bco.QueryAdjustPSSDiff(ParameterList);
        dt.PrimaryKey = new DataColumn[] { dt.Columns["ROWNUM"] };
        GridView1.DataSource = dt;
        GridView1.DataBind();
        ViewState["MaxRowNum"] = dt.Rows.Count + 1;
        if (dt.Rows.Count > 0)
        {
            this.lbPageRowCount.Text = "總共" + Math.Ceiling(dt.Rows.Count / 15.0) + "頁 /共" + dt.Rows.Count.ToString() + "筆";
        }
        else
        {
            this.lbPageRowCount.Text = "";
        }
        string SessionIDName = "PSS021_" + PageTimeStamp.Value;
        Session[SessionIDName] = dt;
    }