Exemplo n.º 1
0
 public IHttpActionResult setMoneyOperation(EfectivoViewModel vm)
 {
     try
     {
         Common.Error response = new Common.Error()
         {
             Message  = "Hubo un error al abrir la compuerta1",
             HasError = true
         };
         PaymentService pyment = new PaymentService();
         if (vm.operacion == "sumar")
         {
             response = pyment.AddMoney(vm.efectivo, vm.user).error;
         }
         else if (vm.operacion == "restar")
         {
             response = pyment.RemoveMoney(vm.efectivo, vm.user).error;
         }
         else
         {
             response = pyment.SetMoney(vm.efectivo).error;
         }
         return(Ok(response));
     }
     catch (SystemException E)
     {
         return(NotFound());
     }
 }
Exemplo n.º 2
0
        public ActionResult Details(string device, string operation)
        {
            var res = _kioskoCoreService.getInventory().Where(c => c.Location == device).ToList();
            //objects[0] = new List<Kiosko.Models.InventarioCash.Efectivo>(); ;

            EfectivoViewModel Model = new EfectivoViewModel();

            Model.efectivo  = res;
            Model.operacion = operation;

            return(PartialView(Model));
        }
Exemplo n.º 3
0
        public ActionResult Cash(EfectivoViewModel vm)
        {
            vm.user       = new Models.User();
            vm.user.id    = (int)Session["UserId"];
            vm.user.email = (string)Session["UserName"];

            if (_kioskoCoreService.SetMoneyOperation(vm))
            {
            }
            else
            {
            }



            return(RedirectToAction("Index", "Admin"));
        }
Exemplo n.º 4
0
        public bool SetMoneyOperation(EfectivoViewModel vm)
        {
            var userResponse = Helpers.Utilities.doRequest <bool>(url, "SetMoneyOperation", vm, "post", 20000);

            return(userResponse);
        }