public Filter_Parameters Parse_Filter_Parameters_ToModel(List <string> searchParams) { Filter_Parameters result = new Filter_Parameters(); try { for (int i = 0; i < searchParams.Count; i++) { //If the parameter is over 1 digit long (all); the wildcard search in the SQL statement will be triggered with an empty string searchParams[i] = searchParams[i].Length > 1 ? string.Empty : searchParams[i]; } result.Department = searchParams[0]; result.Sub_Department = searchParams[1]; result.Section = searchParams[2]; result.Range = searchParams[3]; result.Sub_Range = searchParams[4]; } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); } return(result); }
public DataTable Return_CleansedData_ToDataTable(Filter_Parameters filterParams) { logger.Info("Retrieval started"); try { IEnumerable <Raw_Pack_Data> rawPackData = dataHandler.Return_RawPackData_ToModel(filterParams); IEnumerable <Cleansed_Pack_Data> cleansedPackData = dataHandler.Return_CleansedPackData_ToModel(rawPackData); DataTable result = dataHandler.Map_CleansedPackData_InToDataTable(cleansedPackData); return(result); } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); return(null); } finally { //Naaiers logger.Info("Retrieval ended"); } }
private void run() { searchParameters = new List <string>() { "9", "N", "1", "A", string.Empty }; Filter_Parameters filterParams = app.Parse_Filter_Parameters_ToModel(searchParameters); DataTable returnedPackData = app.Return_CleansedData_ToDataTable(filterParams); Bind_Data_ToDGV(this.dgvPackMaintView, returnedPackData); }
public IEnumerable <Raw_Pack_Data> GetAllPacks(Filter_Parameters filterParams) { using (new SharedConnection(dbConnection)) { var result = dbConnection.Query <Raw_Pack_Data>(SqlLoader.GetSql("Fetch_Packs"), filterParams.Department, filterParams.Sub_Department, filterParams.Section, filterParams.Range, filterParams.Sub_Range ); return(result.Any() ? result : null); } }
public IEnumerable <Raw_Pack_Data> Return_RawPackData_ToModel(Filter_Parameters filterParams) { return(performLookup.Lookup_RawPackData(filterParams)); }
public IEnumerable <Raw_Pack_Data> Lookup_RawPackData(Filter_Parameters filterParams) { IEnumerable <Raw_Pack_Data> result = oracleRepo.GetAllPacks(filterParams); return(result); }