/// <summary> /// Fill transaction form with transaction's information when user process transaction for pay deposit money /// </summary> public void FillTransactionInformationWhenRentBike() { this.status = TRANSACTION_STATUS.RENT_BIKE; this.deposit = 40 * Config.RENTAL_BIKE.Value / 100; depositTxt.Text = String.Format("{0:n0}", this.deposit); rentalMoneyTxt.Text = "Không có dữ liệu"; transactionDateTxt.Text = "Không có dữ liệu"; cancelBut.Visible = true; }
private int GetIntFromTransactionStatus(TRANSACTION_STATUS te) { int iRes = -1; switch (te) { case TRANSACTION_STATUS.CONFIRMATION_RECEIVED_FROM_PDM: { iRes = 30; break; } case TRANSACTION_STATUS.CONFIRMATION_RESPONSE_RECEIVED: { iRes = 50; break; } case TRANSACTION_STATUS.CONFIRMATION_SENT_TO_WD: { iRes = 40; break; } case TRANSACTION_STATUS.REQUEST_SENT: { iRes = 10; break; } case TRANSACTION_STATUS.RESPONSE_RECEIVED: { iRes = 20; break; } } return(iRes); }
/// <summary> /// Fill transaction form with transaction's information when user process transaction for pay rental money /// </summary> /// <param name="stationId">The return station id</param> public void FillTransactionInformationWhenPay(int stationId) { this.status = TRANSACTION_STATUS.PAY; this.stationId = stationId; remainMoneyTxt.Text = "111"; transactionDateTxt.Text = DateTime.Now.ToString("f"); cancelBut.Visible = false; Config.SQL.BikeCategory category = SQL.BikeCategory.BIKE; if (Config.RENTAL_BIKE is Bike) { category = SQL.BikeCategory.BIKE; } else if (Config.RENTAL_BIKE is ElectricBike) { category = SQL.BikeCategory.ELECTRIC; } else if (Config.RENTAL_BIKE is Tandem) { category = SQL.BikeCategory.TANDEM; } rentalMoney = returnBikeController.CalculateFee(Config.TIME_RENTAL_BIKE, category); rentalMoneyTxt.Text = (rentalMoney == 0) ? "Miễn phí" : rentalMoney.ToString(); }