Beispiel #1
0
    //停止往來計算
    protected void STOP_COUNT()
    {
        try
        {
            ParameterList.Clear();
            ParameterList.Add(slpSTOP_DATE.Text);//V_TRACE_YM_S 0
            ParameterList.Add(txtVENDOR_CODE.Text);//V_VENDOR_CODE 1
            ParameterList.Add(txtCNT_NO.Text);//V_CNT_NO 2
            ParameterList.Add(ViewState["EDIT_NO"].ToString());//N_EDIT_NO 3
            ParameterList.Add(Session["UID"].ToString());//V_USER_ID 4

            //異動合約主檔資料的PK欄位
            string SessionIDName = "VDM022_" + PageTimeStamp.Value;
            DataSet ds = (DataSet)Session[SessionIDName];

            ParameterList.Add(GetValueSetParameter(ds.Tables["Table_0"].Rows[0]["CREATEDATE"].ToString(), "datetime", false));//D_OLD_CREATEDATE 5
            ParameterList.Add(ds.Tables["Table_0"].Rows[0]["CREATEUID"].ToString());//V_OLD_CREATEUID 6
            ParameterList.Add(GetValueSetParameter(ds.Tables["Table_0"].Rows[0]["UPDATEDATE"].ToString(), "datetime", false));//D_OLD_UPDATEDATE 7
            ParameterList.Add(ds.Tables["Table_0"].Rows[0]["UPDATEUID"].ToString());//V_OLD_UPDATEUID 8
            ParameterList.Add(System.DateTime.Now);//D_NEW_UPDATEDATE 9
            ParameterList.Add(Session["UID"].ToString());//V_NEW_UPDATEUID 10

            string V_MSG, V_STATUS_CREATEUID;
            DateTime D_STATUS_CREATEDATE;

            BCO.MaintainVendorAgm bco = new BCO.MaintainVendorAgm(ConntionDB);
            //((ScriptManager)Page.Controls[0].Controls[3].FindControl("ScriptManager1")).AsyncPostBackTimeout = 1800;
            bco.StopCloseMonth(ParameterList, null, out V_MSG, out V_STATUS_CREATEUID, out D_STATUS_CREATEDATE);

            if (V_MSG != "")
            {
                lblErrMsg1.Text = V_MSG + ",結帳人員:" + V_STATUS_CREATEUID + ",結帳時間:" + D_STATUS_CREATEDATE.ToString() + "。";
            }
            else
            {
                ds.AcceptChanges();
                Session[SessionIDName] = ds;
                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnSTOP_COUNT", "if (confirm('停止往來帳款試算成功,查詢 【供應商各項扣款表】?')){document.location.replace('../VAM/VAM134R.aspx');}else {document.location.replace('VDM021.aspx');}", true);"VDM022.aspx?arl_Key=VDM021_SortKey" + PageTimeStamp.Value + "&VDM021=EDIT&CNT_NO=" + e.Row.Cells[2].Text + "&EDIT_NO=" + e.Row.Cells[7].Text
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnSTOP_COUNT", "if (confirm('停止往來帳款試算成功,查詢 【供應商各項扣款表】?')){document.location.replace('../VAM/VAM131.aspx?Code=VAM13');} else {document.location.replace('VDM022.aspx?arl_Key=" + Request.QueryString["arl_Key"] + "&isToolBar=N&Code=VDM02&VDM021=EDIT&CNT_NO=" + txtCNT_NO.Text + "&EDIT_NO=" + txtEDIT_NO.Text + "');}", true);
            }
            UpdatePanel2.Update();
        }
        catch (Exception ex)
        {
            lblErrMsg1.Text = "帳款往來計算不成功 !! " + ex.Message;
            UpdatePanel2.Update();
        }
    }