public bool Equals(Order other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Visitor, Visitor) && Equals(other.Cashier, Cashier) && Equals(other.Film, Film) &&
            other.DataSale.Equals(DataSale) && 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 detach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Film = null;
		}
		private void attach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Film = this;
		}
 partial void DeleteOrder(Order instance);
 partial void UpdateOrder(Order instance);
 partial void InsertOrder(Order instance);