//追溯計算 protected void RE_COUNT() { try { btnRE_COUNT.Enabled = true; ParameterList.Clear(); ParameterList.Add(slpTRACE_DATE_B.Text);//V_TRACE_YM_S 0 ParameterList.Add(slpTRACE_DATE_E.Text);//V_TRACE_YM_E 1 ParameterList.Add(txtYEAR_MONTH.Text);//V_TRACE_CHECK_YM 2 ParameterList.Add(txtVENDOR_CODE.Text);//V_VENDOR_CODE 3 ParameterList.Add(txtCNT_NO.Text);//V_CNT_NO 4 ParameterList.Add(ViewState["EDIT_NO"].ToString());//N_EDIT_NO 5 ParameterList.Add(Session["UID"].ToString());//V_USER_ID 6 //異動合約主檔資料的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 7 ParameterList.Add(ds.Tables["Table_0"].Rows[0]["CREATEUID"].ToString());//V_OLD_CREATEUID 8 ParameterList.Add(GetValueSetParameter(ds.Tables["Table_0"].Rows[0]["UPDATEDATE"].ToString(), "datetime", false));//D_OLD_UPDATEDATE 9 ParameterList.Add(ds.Tables["Table_0"].Rows[0]["UPDATEUID"].ToString());//V_OLD_UPDATEUID 10 ParameterList.Add(System.DateTime.Now);//D_NEW_UPDATEDATE 11 ParameterList.Add(Session["UID"].ToString());//V_NEW_UPDATEUID 12 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.TraceCloseMonth(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(), "btnRE_COUNT", "if (confirm('帳款追溯成功,查詢 【供應商各項扣款表】?')){document.location.replace('../VAM/VAM131.aspx?Code=VAM13');}else {document.location.replace('VDM021.aspx?Code=VDM02');}", true); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnRE_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(); } }