예제 #1
0
        public IActionResult Create([FromBody] string content)
        {
            if (content == null)
            {
                return(BadRequest());
            }
            byte[] cipherText = Convert.FromBase64String(content);
            string plaintext;
            // AES encrypt the password
            {
                sCrypt.setConfig(this.Configuration);
                sCrypt.SetKey("AES");
                plaintext = sCrypt.Decrypt(content);
            }
            // Read XML and parse
            RegParser parser = new RegParser(plaintext, Configuration, sCrypt, aGuid);

            parser.Parse();
            // does order already exist ?
            _context.Auser.Add(parser.auser);
            _context.Sources.Add(parser.source);
            foreach (AOrder _order in parser.itemorders)
            {
                _context.AOrder.Add(_order);
            }
            _context.SaveChanges();

            return(Ok(true));
        }
예제 #2
0
        public IActionResult Post([FromBody] string value)
        {
            if (value == null)
            {
                return(BadRequest());
            }

            // Read XML and parse
            RegParser parser = new RegParser(value, this.Configuration, sCrypt, aGuid);

            parser.Parse();
            _context.Auser.Add(parser.auser);
            _context.Sources.Add(parser.source);
            foreach (AOrder _order in parser.itemorders)
            {
                _context.AOrder.Add(_order);
            }
            _context.SaveChanges();
            return(Ok(true));
        }