Beispiel #1
0
        public DocumentClasses GetDocumentClasses(string department)
        {
            //
            DocumentClasses      classes = null;
            ImagingServiceClient client  = null;

            try {
                client  = new ImagingServiceClient();
                classes = client.GetDocumentClassesByDepartment(department);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <EnterpriseFault> ef) { client.Abort(); throw new ApplicationException(ef.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(classes);
        }
Beispiel #2
0
        public DocumentClasses GetDocumentClasses()
        {
            //Retrieve document classes
            DocumentClasses docs = null;

            try {
                docs = new DocumentClasses();
                System.Xml.XmlDataDocument xmlDoc = new System.Xml.XmlDataDocument();
                xmlDoc.DataSet.ReadXml(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "\\App_Data\\documentclass.xml");
                for (int i = 0; i < xmlDoc.DataSet.Tables["DocumentClassTable"].Rows.Count; i++)
                {
                    DocumentClass dc = new DocumentClass(xmlDoc.DataSet.Tables["DocumentClassTable"].Rows[i]["Department"].ToString(), xmlDoc.DataSet.Tables["DocumentClassTable"].Rows[i]["ClassName"].ToString());
                    docs.Add(dc);
                }
            }
            catch (Exception ex) { throw new FaultException <EnterpriseFault>(new EnterpriseFault(ex.Message), "Service Error"); }
            return(docs);
        }
Beispiel #3
0
        public DocumentClasses GetDocumentClasses(string department)
        {
            //Retrieve document classes
            DocumentClasses docs = null;

            try {
                docs = new DocumentClasses();
                DocumentClasses _docs = GetDocumentClasses();
                foreach (DocumentClass dc in _docs)
                {
                    if (dc.Department == department)
                    {
                        docs.Add(dc);
                    }
                }
            }
            catch (Exception ex) { throw new FaultException <EnterpriseFault>(new EnterpriseFault(ex.Message), "Service Error"); }
            return(docs);
        }