コード例 #1
0
 public void executeXMLReport()
 {
     try
     {
         using (var lm = new MagicLinkWrap.LoginHelper(this.User, this.Pass, this.loginServerMago, this.loginInstallationName, this.loginCompany))
         {
             var esitologin = lm.Login();
             if (esitologin.okLogin)
             {
                 using (MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient elsc = new MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient())
                 {
                     var EasyLookServiceConnectionString = "http://{0}:{1}/{2}/EasyLook/EasyLookService.asmx";
                     var ep = string.Format(EasyLookServiceConnectionString, this.loginServerMago, myReportrequest.Port, this.loginInstallationName);
                     elsc.Endpoint.Address = new System.ServiceModel.EndpointAddress(ep);
                     myXMLresult           = elsc.XmlExecuteReport(esitologin.Token, myXMLrequest, DateTime.Now, "AllUsers", true);
                     lm.LogOut(esitologin.Token);
                 }
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
        public async Task <byte[]> executePDFReportAsync()
        {
            string diagnosi = "";

            byte[] r = null;

            try
            {
                using (var lm = new MagicLinkWrap.LoginHelper(this.User, this.Pass, this.loginServerMago, this.loginInstallationName, this.loginCompany))
                {
                    var esitologin = lm.Login();
                    if (esitologin.okLogin)
                    {
                        using (MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient elsc = new MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient())
                        {
                            var EasyLookServiceConnectionString = "http://{0}:{1}/{2}/EasyLook/EasyLookService.asmx";
                            var ep = string.Format(EasyLookServiceConnectionString, this.loginServerMago, myReportrequest.Port, this.loginInstallationName);
                            elsc.Endpoint.Address = new System.ServiceModel.EndpointAddress(ep);
                            var result = await elsc.PdfExecuteReportAsync(esitologin.Token, myXMLrequest, DateTime.Now, "AllUsers", true, diagnosi);

                            lm.LogOut(esitologin.Token);

                            return(result.Body.PdfExecuteReportResult.ToArray <byte>());
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(r);
        }
コード例 #3
0
        public void setParamsTemplate()
        {
            string docparam = "";

            docparam = myReportrequest.getDocParameter();
            using (var lm = new MagicLinkWrap.LoginHelper(this.User, this.Pass, this.loginServerMago, this.loginInstallationName, this.loginCompany))
            {
                var esitologin = lm.Login();
                if (esitologin.okLogin)
                {
                    using (MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient elsc = new MagicLinkWrap.myEasyLook.EasyLookServiceSoapClient())
                    {
                        var EasyLookServiceConnectionString = "http://{0}:{1}/{2}/EasyLook/EasyLookService.asmx";
                        var ep = string.Format(EasyLookServiceConnectionString, this.loginServerMago, myReportrequest.Port, this.loginInstallationName);
                        elsc.Endpoint.Address = new System.ServiceModel.EndpointAddress(ep);

                        myXMLforfind = elsc.XmlGetParameters(esitologin.Token, docparam, DateTime.Now, "AllUsers", true);
                    }
                    lm.LogOut(esitologin.Token);
                }
            }
        }
コード例 #4
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            var esitosetdata = "";

            using (var lm = new MagicLinkWrap.LoginHelper(this.textBoxUser.Text, this.textBoxPass.Text, this.SERVERMAGO, this.INSTALLATIONNAME, this.COMPANY))
            {
                var esitologin = lm.Login();
                if (esitologin.okLogin)
                {
                    try
                    {
                        //questa stringa può essere utilizzata sull'azienda DBPrefixCompany

                        var stringaSetData = "<?xml version=\"1.0\"?><maxs:Invoice xmlns:maxs=\"http://www.microarea.it/Schema/2004/Smart/ERP/Sales/Invoice/Standard/DefaultLight.xsd\" tbNamespace=\"Document.ERP.Sales.Documents.Invoice\" xTechProfile=\"DefaultLight\"><maxs:Data><maxs:SaleDocument master=\"true\"><maxs:DocNo>000032</maxs:DocNo><maxs:DocumentDate>2018-01-08</maxs:DocumentDate><maxs:CustSupp>0017</maxs:CustSupp><maxs:OurReference></maxs:OurReference><maxs:YourReference></maxs:YourReference><maxs:Payment>RBFM3</maxs:Payment><maxs:PostingDate>2018-01-08</maxs:PostingDate><maxs:Currency>EUR</maxs:Currency><maxs:Issued>true</maxs:Issued></maxs:SaleDocument><maxs:Detail><maxs:DetailRow><maxs:SaleDocId>76</maxs:SaleDocId><maxs:Line>1</maxs:Line><maxs:LineType>3538946</maxs:LineType><maxs:Description>Acconto</maxs:Description><maxs:Item></maxs:Item><maxs:UoM></maxs:UoM><maxs:Qty>1.000000000000000</maxs:Qty><maxs:UnitValue>200.000000000000000</maxs:UnitValue><maxs:DiscountFormula></maxs:DiscountFormula><maxs:DiscountAmount>0.000000000000000</maxs:DiscountAmount></maxs:DetailRow></maxs:Detail></maxs:Data></maxs:Invoice>";

                        //var ep = string.Format("http://{0}/{1}/Tbservices/Tbservices.asmx", magoNetSettings.loginServerMago, magoNetSettings.loginInstallationName);
                        using (MagicLinkWrap.TBHelper tbh = new MagicLinkWrap.TBHelper(this.SERVERMAGO, this.INSTALLATIONNAME))
                        {
                            esitosetdata = tbh.mySetData(esitologin.Token, stringaSetData, true);

                            lm.LogOut(esitologin.Token);
                            this.richTextBoxEsito.Text = esitosetdata;
                        }
                    }
                    catch (Exception em)
                    {
                        var err = em.Message;
                        lm.LogOut(esitologin.Token);
                        esitosetdata = err;
                    }
                }
                else
                {
                    var testlogin = esitologin.Errori;
                }
            }
        }