feat: fmRsaj GridView 改用 ObjectDataSource

- RsajDAC 新增 SelectPage/SelectCount

- dsRSAJGrid 改 ObjectDataSource;Search/Selected 調整
This commit is contained in:
2026-09-10 11:00:06 +08:00
parent f1cf00d06c
commit b66279e5fa
4 changed files with 75 additions and 22 deletions
+4 -17
View File
@@ -23,11 +23,6 @@ public partial class forms_worker_fmRsaj : Wellan.Web.UI.WUserControlBase
protected DateTime _YYMM;
protected string _RSENO = "";
protected string _RSPYN = "";
private string select = "SELECT * ";
private string from = " FROM RSAJ ";
private string where = " WHERE 1=1 ";
// private string order = " ORDER BY RSPYN, RSREN";
private string order = " ORDER BY RSYMM DESC, RSREN DESC";
private TextBox[] RSYMMs = new TextBox[10];
private DropDownList[] RSENOs = new DropDownList[10];
private TextBox[] RSAMTs = new TextBox[10];
@@ -48,7 +43,6 @@ public partial class forms_worker_fmRsaj : Wellan.Web.UI.WUserControlBase
{
base.OnInit(e);
dsRSAJForm.ConnectionString = ConnectionString;
dsRSAJGrid.ConnectionString = ConnectionString;
dsRSAJ_RSENO.ConnectionString = ConnectionString;
dsRSAJ_RSENO.SelectCommand =
@"IF @RSPYN = '-ALL-'
@@ -201,15 +195,8 @@ public partial class forms_worker_fmRsaj : Wellan.Web.UI.WUserControlBase
// 查詢動作
private new void Search()
{
StringBuilder sql = new StringBuilder();
sql.Append(select);
sql.Append(from);
sql.Append(where);
dsRSAJGrid.SelectParameters.Clear();
AddSearch(sql, dsRSAJGrid, "RSENO", _RSENO, "", true);
AddSearch(sql, dsRSAJGrid, "RSPYN", _RSPYN, "", true);
sql.Append(order);
dsRSAJGrid.SelectCommand = sql.ToString();
dsRSAJGrid.SelectParameters["RSENO"].DefaultValue = _RSENO;
dsRSAJGrid.SelectParameters["RSPYN"].DefaultValue = _RSPYN;
}
// 存檔前的計算動作
@@ -254,9 +241,9 @@ public partial class forms_worker_fmRsaj : Wellan.Web.UI.WUserControlBase
RSAJGrid.DataBind();
}
protected void dsRSAJGrid_Selected(object sender, SqlDataSourceStatusEventArgs e)
protected void dsRSAJGrid_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.AffectedRows == 0)
if (e.ReturnValue is Int32 && WDAC.GetInt32Value(e.ReturnValue) == 0)
{
/*
if (ForwardSource != "")