public DataView GetFamilyGridData(DataTable querytable, string familycd) { try { StringBuilder strQueryBuilder = new StringBuilder(); string strQuery = string.Empty; foreach (DataRow row in querytable.Rows) { // strQueryBuilder = strQueryBuilder.Append(row[2].ToString().ToUpper() + "= c." + row[1].ToString().ToUpper() + ", "); if (row[1].ToString().ToUpper() != "FAMILY_CD") { strQueryBuilder = strQueryBuilder.Append(row[1].ToString().ToUpper() + ", "); } } strQuery = strQueryBuilder.ToString(); strQuery = strQuery.Substring(0, strQuery.Length - 2); DataView dtCIReference; // dtCIReference =new DataView(); TollInfoModel toolmodel = new TollInfoModel(); //DataTable dataValue; //dtCIReference = ToDataTable((from c in DB.TOOL_PARAMETER.AsEnumerable() // where c.FAMILY_CD == FamilyCD // orderby c.PARAMETER_CD ascending // select new { c.PARAMETER_CD, strQuery }).ToList()); // return dtCIReference.DefaultView; string getQuery = "select TOOL_CD , " + strQuery + " FROM TOOL_DIMENSION WHERE FAMILY_CD = '" + familycd + "'"; //string getQuery = "select FAMILY_CD,TOOL_CD FROM TOOL_DIMENSION WHERE FAMILY_CD = '" + FamilyCD + "'"; return(dtCIReference = ToDataTable(DB.ExecuteQuery <TollInfoModel>(getQuery).ToList()).DefaultView); // var ci = ToDataTable(DB.ExecuteQuery<TollInfoModel>(getQuery).ToList()).DefaultView; // ci.DeFa // return null; } catch (Exception ex) { throw ex.LogException(); } }
public DataView GetFamilyGridToolCode(string familyCode, string tool_code) { try { TollInfoModel toolmodel = new TollInfoModel(); string getQuery = "select * FROM TOOL_DIMENSION WHERE FAMILY_CD = '" + familyCode + "' and TOOL_CD = '" + tool_code + "'"; return(ToDataTable(DB.ExecuteQuery <TollInfoModel>(getQuery).ToList()).DefaultView); } catch (Exception ex) { throw ex.LogException(); } }