public Createpayment ( global rental_id, global payment_id, global customer_id, global staff_id, global amount, global payment_date, global last_update, global inventory_id, global filmtitle ) : |
||
rental_id | global | |
payment_id | global | |
customer_id | global | |
staff_id | global | |
amount | global | |
payment_date | global | |
last_update | global | |
inventory_id | global | |
filmtitle | global | |
return |
public override SPayment GetPayment(int id) { SPayment spayment = new SPayment(); using (SakilaEntities dc = new SakilaEntities()) { var model = from p in dc.payments where p.payment_id == id //orderby (p.payment_date) select p; List <payment> payments = model.ToList <payment>(); spayment = spayment.Createpayment((payments[0].rental_id ?? 0), payments[0].payment_id, payments[0].customer_id, payments[0].staff_id, payments[0].amount, payments[0].payment_date, payments[0].last_update, payments[0].rental.inventory_id, payments[0].rental.inventory.film.title); } simulator.PerformanceSimulation(); return(spayment); }
public override SPayment[] GetPaymentsByRental(int rentalid) { List <SPayment> spayments = new List <SPayment>(); using (SakilaEntities dc = new SakilaEntities()) { var model = from p in dc.payments where p.rental_id == rentalid //orderby (p.payment_date) select p; List <payment> payments = model.ToList <payment>(); simulator.PerformanceSimulation(); for (int i = 0; i < payments.Count; i++) { SPayment payment = new SPayment(); payment = payment.Createpayment((payments[i].rental_id ?? 0), payments[i].payment_id, payments[i].customer_id, payments[i].staff_id, payments[i].amount, payments[i].payment_date, payments[i].last_update, payments[i].rental.inventory_id, payments[i].rental.inventory.film.title); spayments.Add(payment); } } return(spayments.ToArray <SPayment>()); }
public override SPayment[] GetPaymentsByRental(int rentalid) { List<SPayment> spayments = new List<SPayment>(); using (SakilaEntities dc = new SakilaEntities()) { var model = from p in dc.payments where p.rental_id == rentalid //orderby (p.payment_date) select p; List<payment> payments = model.ToList<payment>(); simulator.PerformanceSimulation(); for (int i = 0; i < payments.Count; i++) { SPayment payment = new SPayment(); payment = payment.Createpayment((payments[i].rental_id ?? 0), payments[i].payment_id, payments[i].customer_id, payments[i].staff_id, payments[i].amount, payments[i].payment_date, payments[i].last_update, payments[i].rental.inventory_id, payments[i].rental.inventory.film.title); spayments.Add(payment); } } return spayments.ToArray<SPayment>(); }
public override SPayment GetPayment(int id) { SPayment spayment = new SPayment(); using (SakilaEntities dc = new SakilaEntities()) { var model = from p in dc.payments where p.payment_id == id //orderby (p.payment_date) select p; List<payment> payments = model.ToList<payment>(); spayment = spayment.Createpayment((payments[0].rental_id ?? 0), payments[0].payment_id, payments[0].customer_id, payments[0].staff_id, payments[0].amount, payments[0].payment_date, payments[0].last_update, payments[0].rental.inventory_id, payments[0].rental.inventory.film.title); } simulator.PerformanceSimulation(); return spayment; }