public Order(Visitor visitor, Cashier cashier, Film film, DateTime dateTime) { Visitor = visitor; Cashier = cashier; Film = film; DataSale = dateTime; }
public Order(string id, Visitor visitor, Cashier cashier, Film film, DateTime dateTime) { ID = id; Visitor = visitor; Cashier = cashier; Film = film; DataSale = dateTime; }
public override int GetHashCode() { unchecked { int result = (Visitor != null ? Visitor.GetHashCode() : 0); result = (result * 397) ^ (Cashier != null ? Cashier.GetHashCode() : 0); result = (result * 397) ^ (Film != null ? Film.GetHashCode() : 0); result = (result * 397) ^ DataSale.GetHashCode(); return(result); } }
public bool Equals(Cashier other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.FirstName, FirstName) && Equals(other.LastName, LastName) /* && Equals(other.ID, ID)*/); }
public void BuyTicket(Film film, Visitor visitor, Cashier cashier, string seat) { var dateTime = new DateTime(2012, 7, 5); var order = new Order { OrderID = Guid.NewGuid().ToString(), Visitor = visitor, VisitorID = visitor.VisitorID, Cashier = cashier, CashierID = cashier.CashierID, Film = film, FilmID = film.FilmID, DataSale = dateTime }; _cinema.Orders.InsertOnSubmit(order); //_cinema.Seats.InsertOnSubmit(new Seat { OrderID = order.OrderID, SeatNumber = seat }); _cinema.Visitors.InsertOnSubmit(visitor); _cinema.SubmitChanges(); }
private void MakeOrder(Cashier cashier) { Console.WriteLine("Select operation"); Console.WriteLine("1 - Buy / 2 - Book (not implemented)"); var operationNumber = ChoiseOperation(); switch (operationNumber) { case 1: MakeBuyOrder(cashier); break; case 2: try { _cinema.BookTicket(); } catch (NotImplementedException e) { Console.WriteLine(e.Message); } break; } }
private void MakeBuyOrder(Cashier cashier) { var film = SelectFilms(); if (film == null) { return; } var visitor = NewVisitor(film.Orders); var seat = ChooseSeat(); if (seat == 0) { return; } // ToDo: more seat to choose for one order; _cinema.BuyTicket(film, visitor, cashier, seat.ToString()); }
partial void DeleteCashier(Cashier instance);
partial void UpdateCashier(Cashier instance);
partial void InsertCashier(Cashier instance);
public bool Equals(Cashier other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.FirstName, FirstName) && Equals(other.LastName, LastName)/* && Equals(other.ID, ID)*/; }