public string GetRashutDocuments(int typeID, int numRashut, int fromRow, int toRow) { string retVal = string.Empty; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetReportDocumentsRashut(typeID, numRashut, fromRow, toRow); XElement itemsXml = new XElement("documents", from item in itemsList select new XElement("document", new XAttribute("rownum", item.rownum), new XAttribute("totalRows", item.totalRows), new XElement("docYear", item.DocYear), new XElement("docName", item.DocName.Trim()), new XElement("docID", item.DocId), new XElement("docDate", item.AcceptDate), new XElement("docType", item.DocTypeName.Trim()))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetReportDocumentsRashut(" + typeID.ToString() + ", " + numRashut.ToString() + ") - " + ex.Message); } return(retVal); }
public string GetElectionDocuments(DateTime fromDate, DateTime toDate, int fromRow, int toRow) { string retVal = string.Empty; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetDocumentsElection(fromRow, toRow, fromDate, toDate); XElement itemsXml = new XElement("documents", from item in itemsList select new XElement("document", new XAttribute("rownum", item.rownum), new XAttribute("totalRows", item.totalRows), new XElement("docType", item.DocTypeName.Trim()), new XElement("docID", item.DocId), new XElement("docName", item.DocName.Trim()), new XElement("rashutName", item.Shem_Rashut), new XElement("docDate", item.AcceptDate), new XElement("docYear", item.DocYear))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetElectionDocuments(" + fromDate.ToString() + ", " + toDate.ToString() + ") - " + ex.Message); } return(retVal); }
public string GetInspectionDocuments(int typeID, int year, int fromRow, int toRow) { string retVal = string.Empty; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetDocumentsInspection(year, typeID, fromRow, toRow); XElement itemsXml = new XElement("documents", from item in itemsList select new XElement("document", new XAttribute("rownum", item.rownum), new XAttribute("totalRows", item.totalRows), new XElement("docType", item.DocTypeName.Trim()), new XElement("docID", item.DocId), new XElement("docName", item.DocName.Trim()), new XElement("rashutName", item.Shem_Rashut))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetInspectionDocuments(" + typeID.ToString() + ", " + year.ToString() + ") - " + ex.Message); } return(retVal); }
public DocumentContent GetDocumentContent(int docID) { DocumentContent retVal = null; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetDocumentContent(docID).First(); retVal = new DocumentContent(itemsList.DocPath.ToArray(), itemsList.DocExtention); } catch (Exception ex) { Exceptions.WriteToLogFile("GetDocumentContent(" + docID.ToString() + ") - " + ex.Message); } return(retVal); }
public string GetInspactionDocumentTypes() { string retVal = string.Empty; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetDocumentsTypesInsp(); XElement itemsXml = new XElement("items", from item in itemsList select new XElement("item", new XElement("value", item.DocTypeID), new XElement("text", item.DocTypeName))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetInspactionDocumentTypes() - " + ex.Message); } return(retVal); }
public string GetPortalDocumentsTypes() //*** { string retVal = string.Empty; try { DocumentsDataContext db = new DocumentsDataContext(); var itemsList = db.GetPortalDocumentsTypes(); XElement itemsXml = new XElement("Root", from item in itemsList select new XElement("type", new XElement("DocMainTypeID", item.DocMainTypeID), new XElement("SysNo", item.SysNo), new XElement("DocMainTypeName", item.DocMainTypeName))); retVal = itemsXml.ToString(); } catch (Exception ex) { Exceptions.WriteToLogFile("GetPortalDocumentsTypes() - " + ex.Message); } return(retVal); }