protected void getNote(SearchWebService.Term term) { btnNote.HRef = "TermEdit.aspx?term=" + term.ID; if (term.Note.Length == 0) { lblNote.Visible = false; } lblNote.InnerText = term.Note; }
protected void getTerm() { txtNote2.Enabled = false; btnCancel.Visible = false; int userid = (int)Session["userid"]; int termid = Convert.ToInt32(Request["term"]); SearchWebService.Term term = searchService.getTermByIdWithUser(termid, userid); kindOfDictionary.InnerText = term.Content; getNote(term); showDefinition(term); }
protected void getDefinitions(string input, int kindOfDictionary) { SearchWebService.Term term = null; object userid = Session["userid"]; if (userid != null) { term = ss.getTermByStringWithUser(kindOfDictionary, input, Convert.ToInt32(userid)); if (term.ID != -1) { divNote.Visible = true; getNote(term); } } else { term = ss.getTermByString(kindOfDictionary, input); } showDefinition(term); }
protected void showDefinition(SearchWebService.Term term) { var html = ""; html += "<table>"; foreach (SearchWebService.Definition d in term.Definitions) { html += "<tr>"; if (d.Type == "word-class") { html += "<td class=\"word-class\">* " + d.Content + "</td>"; } else if (d.Type == "meaning") { html += "<td class=\"meaning\"> " + d.Content + "</td>"; } else if (d.Type == "header") { html += "<td class=\"header\">" + d.Content + "</td>"; } else if (d.Type == "example") { html += "<td class=\"example\">-  " + d.Content + "</td>"; } else if (d.Type == "explain") { html += "<td class=\"explain\">  " + d.Content + "</td>"; } else if (d.Type == "other") { html += "<td class=\"other\">" + d.Content + "</td>"; } // more cells here as needed html += "</tr>"; } html += "</table>"; demo.InnerHtml = html; }
protected void getNote(SearchWebService.Term term) { //txtNote.InnerText = term.Note; txtNote2.Text = term.Note; }