feat: fmBpjb GridView 改用 ObjectDataSource
- 新增 BpjbDAC(SelectPage/SelectCount) - dsBPJBGrid 改 ObjectDataSource;Search/Selected 調整
This commit is contained in:
@@ -24,10 +24,6 @@ public partial class forms_customer_fmBpjb : Wellan.Web.UI.WUserControlBase
|
||||
protected string _BPPYN = "";
|
||||
protected string _BPJNO = "";
|
||||
protected string _BPJME = "";
|
||||
private string select = "SELECT * ";
|
||||
private string from = " FROM BPJB ";
|
||||
private string where = " WHERE 1=1 ";
|
||||
private string order = " ORDER BY BPPYN, BPJNO, BPCNO";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -39,7 +35,6 @@ public partial class forms_customer_fmBpjb : Wellan.Web.UI.WUserControlBase
|
||||
{
|
||||
base.OnInit(e);
|
||||
dsBPJBForm.ConnectionString = ConnectionString;
|
||||
dsBPJBGrid.ConnectionString = ConnectionString;
|
||||
|
||||
_BPNUM = GetStringParam("BPNUM");
|
||||
_BPPYN = GetStringParam("BPPYN");
|
||||
@@ -54,15 +49,8 @@ public partial class forms_customer_fmBpjb : Wellan.Web.UI.WUserControlBase
|
||||
// 查詢動作
|
||||
private new void Search()
|
||||
{
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.Append(select);
|
||||
sql.Append(from);
|
||||
sql.Append(where);
|
||||
dsBPJBGrid.SelectParameters.Clear();
|
||||
AddSearch(sql, dsBPJBGrid, "BPPYN", _BPPYN, "", true);
|
||||
AddSearch(sql, dsBPJBGrid, "BPJNO", _BPJNO, "", true);
|
||||
sql.Append(order);
|
||||
dsBPJBGrid.SelectCommand = sql.ToString();
|
||||
dsBPJBGrid.SelectParameters["BPPYN"].DefaultValue = _BPPYN;
|
||||
dsBPJBGrid.SelectParameters["BPJNO"].DefaultValue = _BPJNO;
|
||||
}
|
||||
|
||||
private new void CalcFields(SqlDataSourceCommandEventArgs e)
|
||||
@@ -115,9 +103,9 @@ public partial class forms_customer_fmBpjb : Wellan.Web.UI.WUserControlBase
|
||||
gvBPJB.DataBind();
|
||||
}
|
||||
|
||||
protected void dsBPJBGrid_Selected(object sender, SqlDataSourceStatusEventArgs e)
|
||||
protected void dsBPJBGrid_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
if (e.AffectedRows == 0)
|
||||
if (e.ReturnValue is Int32 && WDAC.GetInt32Value(e.ReturnValue) == 0)
|
||||
{
|
||||
fvBPJB.ChangeMode(FormViewMode.Insert);
|
||||
fvBPJB_ModeChanged(sender, e);
|
||||
|
||||
Reference in New Issue
Block a user