Example #1
0
        public override void ProcessRequest(HttpContext context)
        {
            var machine = MachineMemoryManager.Instance();
            var userBug = UserBugMemoryManager.Instance();

            machine.PayOut(userBug);
            MachineMemoryManager.InsertMachine(machine);
            UserBugMemoryManager.InsertBug(userBug);
            WriteResult(context.Response, new
            {
                Result  = true,
                UserBug = userBug
            });
        }
        public override void ProcessRequest(HttpContext context)
        {
            var  coin    = JsonConvert.DeserializeObject <CoinModel>(context.Request.QueryString["coin"]);
            var  machine = MachineMemoryManager.Instance();
            var  userBug = UserBugMemoryManager.Instance();
            bool result  = userBug.InsertCoinToMachine(machine, coin);

            MachineMemoryManager.InsertMachine(machine);
            UserBugMemoryManager.InsertBug(userBug);
            WriteResult(context.Response, new
            {
                Result     = result,
                UserSumRur = machine.UserSumRur
            });
        }
 protected string WriteUserBugToJs()
 {
     return(JsonConvert.SerializeObject(UserBugMemoryManager.Instance(), Formatting.Indented));
 }