public bool loadallfinds() { if (clusterid > 0) { helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); string s = "select * from dbo.fncGetAllFndsFromClusterId('" + clusterid + "') order by seq asc"; try { var allfldrec = db.getmylist(s); if (allfldrec.Count > 0) { foreach (shlpMyDictionary b in allfldrec) { onefind t = new onefind(b.getint("findid")); allfnds.Add(b.getint("seq"), t); } } } catch (Exception e) { return(false); } } return(true); }
public void getqry() { //try{ string s = "select * from getallprocesses()"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); coreprocess txt = new coreprocess(); var allrows = db.getmylist(s); if (allrows.Count > 0) { foreach (shlpMyDictionary a in allrows) { if (a.getint("coreid") != txt.coreid) { txt.setcoreid(a.getint("coreid")); getwebfile.rooturl = a.getvalue("rootlnk"); } txt.queryid = a.getint("qryprocessid"); string strtbl = a.getvalue("storetable"); txt.processtxt(strtbl); } // running post download s = "exec [dbo].[spCleantblStore]"; int res = db.getfirstint(s); } //} //catch (Exception e){} }
public bool setfindid(int findid) { try{ string s = "select * from fncGetFindTxtArray('" + (id = findid) + "') order by id asc, seq asc"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); var allrows = db.getmylist(s); if (allrows.Count > 0) { foreach (shlpMyDictionary a in allrows) { if (a.getint("id") == 1) { frs.Add(a.getvalue("txt"), a.getint("delid")); } else if (a.getint("id") == 2) { lst.Add(a.getvalue("txt"), a.getint("delid")); } else if (a.getint("id") == 3) { string txt = a.getvalue("txt"); toremove.Add(txt, a.getint("delid")); /* * int i = 0; * string txt = a.getvalue("txt"); * if (int.TryParse(txt, out i)) * { * if (i < 0) removekind = i; * } * else * { * toremove.Add(txt); * } */ } else if (a.getint("id") == 4) { removekind = a.getint("seq"); } } } return(true); } catch (Exception e) { msg = "Text Find error: " + e.Message; return(false); } }
public bool processtxt(string tbl) { // going through all query groups //string s = "select * from fncSelectAllSearchSkills()"; string s = "select * from dbo.fcnGetQueryGyId('" + queryid + "')"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); var allrows = db.getmylist(s); if (allrows.Count > 0) { foreach (shlpMyDictionary b in allrows) { string lnk = ""; //int groupid = b.getint("groupid"); //setquerygroup(groupid); setqueryvalues(b.getvalue("one"), b.getvalue("two")); string pagelink = makelnk(); pagetxt = getwebfile.getonepage(pagelink); string tmpmxlim = checkfnd.retrievedata(pagetxt, 0); int tstint = 0; if (int.TryParse(tmpmxlim, out tstint)) { maxlimid = tstint; } else { maxlimid = 0; } int pageid = 0; while (((curitemscnt == 0) && (maxlimid > 0)) || (curitemscnt < maxlimid)) { processonetext(pagetxt, tbl, pageid, 1); curitemscnt += itemsperpage; pageid++; pagetxt = getwebfile.getonepage(makelnk()); } } } return(true); }
public void setquerygroup(int qrygroupid) { // going through all query groups string s = "select * from fncQueryListByGroupId('" + qrygroupid + "')"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); var allrows = db.getmylist(s); if (allrows.Count > 0) { foreach (shlpMyDictionary b in allrows) { int seq = b.getint("seqid"); string txt = b.getvalue("txt"); qrylst.Add(seq, txt); } } }
// kind 1 for checkbad, 2 - for checkgood public bool getcheckvalues(int groupid, int kind) { string s = "select * from [dbo].[fncGetAllfndText]('" + groupid + "') order by seq asc"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); var allrows = db.getmylist(s); if (allrows.Count > 0) { foreach (shlpMyDictionary a in allrows) { if (kind == 1) { checkbad.Add(a.getvalue("txt")); } else if (kind == 2) { checkgood.Add(a.getvalue("txt")); } } } return(true); }
public bool setcoreid(int idin) { if (idin > 0) { try{ string s = "select * from fctGetOneCore('" + (coreid = idin) + "')"; helper.hlpDbConnect1 db = new helper.hlpDbConnect1(clsglobal.cn); var allrows = db.getmylist(s); if (allrows.Count > 0) { corestructid = allrows[0].getint("corestructid"); if (corestructid > 0) { s = "select * from fncGetCoreStruct('" + corestructid + "')"; var allfldrec = db.getmylist(s); if (allfldrec.Count > 0) { foreach (shlpMyDictionary b in allfldrec) { string txt = b.getvalue("text"); int seq = b.getint("seq"); int tp = b.getint("type"); KeyValuePair <string, int> ktmp = new KeyValuePair <string, int>(txt, tp); corestruct.Add(seq, ktmp); } } } navtype = allrows[0].getint("navtype"); itemsperpage = allrows[0].getint("itemsperpage"); // getting all the finds desc = allrows[0].getvalue("descript"); pgfind = new onefindcluster(allrows[0].getint("pagefindclustid"), "Page find"); segfind = new onefindcluster(allrows[0].getint("segfindclustid"), "Segment find"); checkfnd = new onefindcluster(allrows[0].getint("checkfindclustid"), "Check find"); navfind = new onefindcluster(allrows[0].getint("navfindclustid"), "Nav find"); allflds = new List <onefindcluster>(); // loading fields int fldgroupid = allrows[0].getint("fieldgroupid"); if (fldgroupid > 0) { s = "select * from fncFieldGetAllFieldInGroup('" + fldgroupid + "') order by seq asc"; var allfldrec = db.getmylist(s); if (allfldrec.Count > 0) { foreach (shlpMyDictionary b in allfldrec) { onefindcluster t = new onefindcluster(b.getint("findclusterid"), b.getvalue("fldname"), b.getint("fldkind"), b.getint("iskey"), b.getint("checkbadgroupid"), b.getint("goodgroupid") ); allflds.Add(t); } } } } } catch (Exception e) { return(false); } } return(true); }