public void DeleteOrder(int flightId, int orderAmount) { BankUtil bankUt = new BankUtil(); FlightUtil flUtil = new FlightUtil(); if (bankUt.MoneyTransfer(companyAcountId, clnId, flUtil.GetFlightCost(flightId) * orderAmount)) { flUtil.UnBookFlight(flightId, clnId, orderAmount); clnTrack.Set_Result(-orderAmount); appErr.ShowMsg("Order deleted successfully"); } else { appErr.ShowErrorMsg("Bank error"); } }
public void MakeOrder(int flightId, int orderAmount) { BankUtil bankUt = new BankUtil(); FlightUtil flUtil = new FlightUtil(); if (flUtil.IsEnoughTicket(flightId, orderAmount)) { if (bankUt.MoneyTransfer(clnId, companyAcountId, flUtil.GetFlightCost(flightId) * orderAmount)) { flUtil.BookFlight(flightId, clnId, orderAmount); clnTrack.Set_Result(orderAmount); appErr.ShowMsg("Order completed successfully"); } else { appErr.ShowErrorMsg("Bank error"); } } else { appErr.ShowErrorMsg("Zero tickets left"); } }