public JsonResult ListOrder([FromBody] ListingHex listing)
        {
            bool valid = ListingEntry.TryParse(_rpc, _db, listing, out var result, out var error, true);


            //If we got a valid one, mark it as active, and save it to the db
            if (valid)
            {
                result.Active = true;
                //Listings can be updated if they use the same UTXO as a previously uploaded tx
                if (_db.Entry(result)?.State == EntityState.Detached)
                {
                    _db.Listings.Add(result);
                }
                _db.SaveChanges();
            }

            return(new JsonResult(new ListingResult(valid, result, error)));
        }
Beispiel #2
0
        // GET: Home
        /// <summary>
        /// This is the first method that you are redirectioned when you can succesfully sing in
        /// </summary>
        /// <returns>Void</returns>
        public ActionResult landing()

        {
            ListingEntry entrys = new ListingEntry();

            try
            {
                using (BlogContext db = new BlogContext())
                {
                    entrys.Listing = db.Entry.SqlQuery("SELECT * FROM [Entry]").ToList();
                }
            }

            catch (Exception)
            {
                Session["message"] = "Theres no entrys to load";
            }



            return(View(entrys));
        }
 public ListingResult(bool valid, ListingEntry result, string error)
 {
     Valid  = valid;
     Result = result;
     Error  = error;
 }
        public JsonResult QuickParse([FromBody] ListingHex listing)
        {
            bool valid = ListingEntry.TryParse(_rpc, _db, listing, out var result, out var error, false);

            return(new JsonResult(new ListingResult(valid, result, error)));
        }