public void BindGridView() { string searchStr = "SELECT PKNO, COMPANY_CODE, BELONGFUNCTION, FUNCTIONPKNO, GROUPNO, ATTACHNAME, " + " ATTACHMANAGEMODE, ATTACHFORMATE, ATTACHSTORETYPE, ATTACHINTROD, ATTACHSTOREFILE, ISEQ, " + " CREATED_BY, CREATION_DATE, UPDATED_BY, LAST_UPDATE_DATE, UPDATED_INTROD,ISTATE,REMARK " + " FROM SYS_ATTACHINFO " + " WHERE PKNO IS NOT NULL "; if (!string.IsNullOrEmpty(BelongFunction)) { searchStr = $" AND BELONGFUNCTION = {BelongFunction}"; } if (!string.IsNullOrEmpty(FunctionPKNO)) { searchStr += $" AND FUNCTIONPKNO = {FunctionPKNO}"; } if (!string.IsNullOrEmpty(GroupNo)) { searchStr += $" AND GROUPNO = {GroupNo}"; } searchStr += " ORDER BY FUNCTIONPKNO, GROUPNO, ISEQ"; DataSet ds = wsSQL.UseService(s => s.GetDataSet(searchStr, null, null)); sysAttachInfos = SafeConverter.DataSetToModel <SysAttachInfo>(ds); gridView.ItemsSource = sysAttachInfos; }
public static List <T> GetModelListBySql <T>(string sql, List <string> paramNames, List <string> paramValues) where T : class, new() { DataSet ds = GetDataSet(sql, paramNames, paramValues); return(SafeConverter.DataSetToModel <T>(ds)); }
public static List <T> GetModelListBySql <T>(string sql) where T : class, new() { DataSet ds = GetDataSet(sql); return(SafeConverter.DataSetToModel <T>(ds)); }