public string GetRashutLaws(int rashut_Lms, int fromRow, int toRow)//////////// { string retVal = string.Empty; try { LawSubjectsDataContext db = new LawSubjectsDataContext(); var itemsList = db.GetLaws(-1, rashut_Lms, fromRow, toRow); XElement itemsXml = new XElement("laws", from item in itemsList select new XElement("law", new XAttribute("rownum", item.rownum), new XAttribute("totalRows", item.totalRows), new XElement("lawID", item.LawID), new XElement("lawName", item.LawName.Trim()), new XElement("date", item.DateRecord), // new XElement("rashutID", item.RashutNumLms), // new XElement("rashutName", item.Shem_Rashut), //new XElement("subjectID", item.SubjectID), new XElement("subjectName", item.SubjectName.Trim()))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetRashutLaws(" + rashut_Lms.ToString() + ") - " + ex.Message); } return(retVal); }
public DocumentContent GetLawContent(int lawID) { DocumentContent retVal = null; try { LawSubjectsDataContext db = new LawSubjectsDataContext(); var itemsList = db.GetLawContent(lawID).First(); retVal = new DocumentContent(itemsList.Content.ToArray(), itemsList.Extention); } catch (Exception ex) { Exceptions.WriteToLogFile("GetLawContent(" + lawID.ToString() + ") - " + ex.Message); } return(retVal); }
public string GetLawSubjects() { string retVal = string.Empty; try { LawSubjectsDataContext db = new LawSubjectsDataContext(); var itemsList = db.GetLawSubjects(); XElement itemsXml = new XElement("items", from item in itemsList select new XElement("item", new XElement("value", item.SubjectID), new XElement("text", item.SubjectName))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetLawSubjects() - " + ex.Message); } /* int i = "k"; * LawSubjectsDataContext db = new LawSubjectsDataContext(); * var itemsList = db.GetLawSubjects(); * XElement itemsXml = new XElement("items", * from item in itemsList * select new XElement("item", * new XElement("value", item.SubjectID), * new XElement("text", item.SubjectName))); * retVal = itemsXml.ToString(); * Exceptions.WriteToLogFile("GetLawSubjects() - " ); * */ return(retVal); }