目的: V80404 - 挑選資料 - Cache 是否最新資料的機制 - 若非最新資料,則需重抓資料
處理說明: 1>建立 Cache DataSet
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "CSM_AF" });
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "CSM_AF" });
// //public DataSet setupPickDs(string pickKey, string sql, string[] tables, bool paging = true, bool realTime = false)
2>由 Cache DataSet 過濾資料
ds = getPickDsbyCondi(n, "GONOAF='" + GONOAF + "'");
1>*.js
[HttpPost]
public dynamic get_s_GONOAFPick(string GONOAF = "", int isComplete = 0)
{
DBLINK = "TLSEU";
string Tmp_Sql = " SELECT DISTINCT GONOAF "
+ " from CSM_AF "
+ " ORDER BY GONOAF ";
string n = funId + "s_GONOAF";
// TableName 有@會Error , 所以先設定 DBLink
//public DataSet setupPickDs(string pickKey, string sql, string[] tables, bool paging = true, bool realTime = false)
//建立 PickDs , 若已存在,則直接取用目前 Cache DataSet
//DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "CSM_AF@TLS_245" });
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "CSM_AF" });
if (GONOAF != null && !GONOAF.Equals(""))
{
if (isComplete == 1)
{
////由 Cache DataSet 過濾資料
ds = getPickDsbyCondi(n, "GONOAF='" + GONOAF + "'");
}
else
{
ds = getPickDsbyCondi(n, "GONOAF LIKE '%" + GONOAF + "%'");
}
}
return ds;
} // end of get_s_GONOAFPick