VideoRentalService.DataFacade1.PayForMovie C# (CSharp) Method

PayForMovie() public method

public PayForMovie ( byte staffid, byte customerid, byte rentalid, double paymentAmount ) : bool
staffid byte
customerid byte
rentalid byte
paymentAmount double
return bool
        public override bool PayForMovie(byte staffid, byte customerid, byte rentalid, double paymentAmount)
        {
            payment payment = new payment();
            payment.amount = (decimal)paymentAmount;
            payment.customer_id = customerid;
            payment.staff_id = staffid;
            payment.rental_id = rentalid;

            using (SakilaEntities dc = new SakilaEntities())
            {
                simulator.PerformanceSimulation();
                dc.AddTopayments(payment);
                dc.SaveChanges();
            }
            return true;
        }