public string GetRecordCountByString(List <EwavRule_Base> rules, string s, string tableName, string dsName) { try { EpiDashboard.GadgetParameters inputs = new EpiDashboard.GadgetParameters(); inputs.TableName = tableName; inputs.DatasourceName = dsName; EpiDashboard.DashboardHelper dashboardHelper = new EpiDashboard.DashboardHelper(inputs, s, rules); dashboardHelper.UseAdvancedUserDataFilter = true; dashboardHelper.AdvancedUserDataFilter = s; //EntityManager em = new EntityManager(); //return em.GetRecordsCount(dsName, tableName, s); dashboardHelper.EwavConstructTableColumnNames(inputs); dashboardHelper.GenerateView(inputs); string totalRecords = dashboardHelper.DataSet.Tables[0].Rows.Count.ToString(); string filteredRecords = dashboardHelper.DataSet.Tables[0].DefaultView.Count.ToString(); string result = totalRecords + "," + filteredRecords; return(result); } catch (Exception ex) { throw new Exception(ex.Message + " -- " + ex.StackTrace); } }
public string GetRecordCount(List <EwavDataFilterCondition> filterList, List <EwavRule_Base> rules, string tableName, string dsName) { Assembly assembly = Assembly.GetExecutingAssembly(); String version = assembly.FullName.Split(',')[1]; String fullversion = version.Split('=')[1]; try { string result; if (filterList.Count == 0 && rules.Count == 0) { EntityManager em = new EntityManager(); int recordCount = em.GetRawDataTableRecordCount(dsName, tableName); result = recordCount.ToString() + "," + recordCount.ToString(); } else { EpiDashboard.GadgetParameters inputs = new EpiDashboard.GadgetParameters(); inputs.TableName = tableName; inputs.DatasourceName = dsName; EpiDashboard.DashboardHelper dashboardHelper = new EpiDashboard.DashboardHelper(inputs, filterList, rules); dashboardHelper.EwavConstructTableColumnNames(inputs); dashboardHelper.CreateDataFilters(filterList); dashboardHelper.GenerateView(inputs); string totalRecords = dashboardHelper.DataSet.Tables[0].Rows.Count.ToString(); string filteredRecords = dashboardHelper.DataSet.Tables[0].DefaultView.Count.ToString(); result = totalRecords + "," + filteredRecords; } return(result); } catch (Exception ex) { throw new Exception(ex.Message + " -- " + ex.StackTrace); } }