Beispiel #1
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("EditTextEQ");
            string baseUrl = Environment.GetEnvironmentVariable("e1-baseUrl");
            var    e1      = new AIS.Server(baseUrl, log);

            e1.AuthRequest.username = Environment.GetEnvironmentVariable("e1-username");
            e1.AuthRequest.password = Environment.GetEnvironmentVariable("e1-password");

            string numb = req.Query["numb"];
            int    seq  = int.Parse(req.Query["seq"]);
            string text = req.Query["text"];
            var    mo   = new GT1701 <AIS.MoUpdateText>(numb, seq, text);

            try
            {
                var rs = await e1.RequestAsync(mo.Request);

                return(new OkObjectResult(rs));
            }
            catch (Exception e)
            {
                return(new BadRequestObjectResult(e.Message));
            }
        }
Beispiel #2
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("GetTextEQ");
            string baseUrl = Environment.GetEnvironmentVariable("e1-baseUrl");
            var    e1      = new AIS.Server(baseUrl, log);

            e1.AuthRequest.username = Environment.GetEnvironmentVariable("e1-username");
            e1.AuthRequest.password = Environment.GetEnvironmentVariable("e1-password");

            string numb = req.Query["numb"];
            var    mo   = new GT1701 <AIS.MoGetText>(numb, true);

            try
            {
                var rs = await e1.RequestAsync(mo.Request);

                var t = rs.textAttachments.FirstOrDefault(a => a.itemName.Equals(NAME));
                if (t != null)
                {
                    try
                    {
                        var adds = System.Text.RegularExpressions.Regex.Unescape(t.text).Split('\n')
                                   .Select(s => JsonSerializer.Deserialize <Address>(s))
                                   .ToList();
                        Address last = null;
                        foreach (var l in adds)
                        {
                            if (last != null)
                            {
                                l.distance = calculate(last.latitude, last.longitude, l.latitude, l.longitude, 'K');
                            }
                            last = l;
                        }
                        return(new OkObjectResult(new { t.sequence, adds }));
                    }
                    catch (Exception) { }
                }
                return(new OkObjectResult(null));
            }
            catch (Exception e)
            {
                return(new BadRequestObjectResult(e.Message));
            }
        }
Beispiel #3
0
        static async Task Main(string[] args)
        {
            var e1 = new AIS.Server("https://demo.steltix.com/jderest/v2/");

            e1.AuthRequest.username = "******";
            e1.AuthRequest.password = "******";

            var rs = await e1.RequestAsync(new AIS.DiscoverUBERequest
            {
                reportName    = "R45300",
                reportVersion = "ZJDE0001"
            });

            foreach (var d in rs.dataSelectionColumns)
            {
                Console.WriteLine("{0} {1}", d.dictItem, d.displayString);
            }
            Console.ReadKey();
        }
Beispiel #4
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("EQ Listing.");
            string baseUrl = Environment.GetEnvironmentVariable("e1-baseUrl");
            var    e1      = new AIS.Server(baseUrl, log);

            e1.AuthRequest.username = Environment.GetEnvironmentVariable("e1-username");
            e1.AuthRequest.password = Environment.GetEnvironmentVariable("e1-password");

            try
            {
                var list = await e1.RequestAsync <W1701A.Response>(new W1701A.Request());

                return(new OkObjectResult(list.fs_P1701_W1701A.data.gridData.rowset));
            }
            catch (Exception e)
            {
                return(new BadRequestObjectResult(e.Message));
            }
        }
Beispiel #5
0
 public TextAttachmentHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }
Beispiel #6
0
 public RefreshAddressHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }
Beispiel #7
0
 public EQListHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }
Beispiel #8
0
 public DemoFormHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }
Beispiel #9
0
 public RefreshHandler(IStore store, AIS.Server e1, Jira.Server jira) : base(store)
 {
     E1   = e1;
     Jira = jira;
 }
Beispiel #10
0
 public OMWAddHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }
Beispiel #11
0
 public JiraIssueTransitionHandler(IStore store, Jira.Server jira, AIS.Server e1) : base(store)
 {
     Jira = jira;
     E1   = e1;
 }
Beispiel #12
0
 public DemoRequestHandler(IStore store, AIS.Server e1) : base(store)
 {
     E1 = e1;
 }