Пример #1
0
        public async Task <JsonResult> WaiterPayWithPaidDetails(Cart cart, WaiterCartAddition cartAddition, WaiterPaidDetails paidDetails)
        {
            FunctionResult result = await waiterPay(cart, cartAddition, "WaiterWithPaidDetails");

            if (!result.Succeeded)
            {
                return(Json(new JsonError(result.Message)));
            }

            Dine dine = ((Dine)result.Data);

            await newDineInform(dine, "WaiterWithPaidDetail");
            await requestPrintDine(dine.Id);

            paidDetails.DineId = dine.Id;

            bool succeeded = await OrderManager.OfflinePayCompleted(paidDetails);

            if (!succeeded)
            {
                return(Json(new JsonError("支付金额与应付金额不匹配")));
            }

            NewDineInformTcpClient.SendNewDineInfrom(CurrHotel.Id, paidDetails.DineId, true);
            return(Json(new JsonSuccess {
                Data = paidDetails.DineId
            }));
        }
Пример #2
0
        public async Task <JsonResult> WaiterPayCompleted(WaiterPaidDetails paidDetails)
        {
            bool succeeded = await OrderManager.OfflinePayCompleted(paidDetails);

            if (!succeeded)
            {
                return(Json(new JsonError("支付金额与应付金额不匹配")));
            }

            NewDineInformTcpClient.SendNewDineInfrom(CurrHotel.Id, paidDetails.DineId, true);
            return(Json(new JsonSuccess {
                Data = paidDetails.DineId
            }));
        }