예제 #1
0
        public void SendMail(MailInfo mailInfo)
        {
            var helper = new WebAPIHelper();
            var result = helper.Post <Stream>("SendMail", mailInfo);

            if (result != null)
            {
                result.Dispose();
            }
        }
예제 #2
0
        public string ProcessApi(string action, string controller, object request)
        {
            if (string.IsNullOrEmpty(action))
            {
                throw new ArgumentNullException("action");
            }

            if (string.IsNullOrEmpty(controller))
            {
                throw new ArgumentNullException("controller");
            }

            var helper = new WebAPIHelper(_url);

            switch (action.ToUpper())
            {
            case "POST":
                using (var ms = helper.Post <Stream>(controller, request))
                {
                    if (ms != null)
                    {
                        using (var reader = XmlReader.Create(ms))
                        {
                            var responseXmlDoc = XmlDocumentConverter.ConvertTo <XmlDocument>(reader);
                            if (responseXmlDoc != null)
                            {
                                return(responseXmlDoc.InnerXml);
                            }
                        }
                    }
                }
                break;

            default:
                throw new NotImplementedException(string.Format("Action '{0}' is not Implemented", action));
            }

            return(null);
        }
예제 #3
0
        public Stream GetReportPreview(Output task)
        {
            var helper = new WebAPIHelper();

            return(helper.Post <Stream>("EPSPreviewReport", task));
        }
예제 #4
0
        public OutputBatch PrintReportBatch(OutputBatch batch)
        {
            var helper = new WebAPIHelper();

            return(helper.Post <OutputBatch>("EPSPrintReportBatch", batch));
        }
예제 #5
0
        public Output PrintReport(Output task)
        {
            var helper = new WebAPIHelper();

            return(helper.Post <Output>("EPSPrintReport", task));
        }