public Order(Visitor visitor, Cashier cashier, Film film, DateTime dateTime)
 {
     Visitor = visitor;
     Cashier = cashier;
     Film = film;
     DataSale = dateTime;
 }
 public bool Equals(Visitor other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(other, null)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.FirstName, FirstName) && Equals(other.LastName, LastName) &&
            other.PassportNumber == PassportNumber /*&& Equals(other.ID, ID)*/;
 }
 public Order(string id, Visitor visitor, Cashier cashier, Film film, DateTime dateTime)
 {
     ID = id;
     Visitor = visitor;
     Cashier = cashier;
     Film = film;
     DataSale = dateTime;
 }
 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 Visitor NewVisitor(EntitySet<Order> orders)
 {
     Console.Clear();
     Console.WriteLine("Enter your Name");
     var firstName = Console.ReadLine();
     Console.WriteLine("Enter your LastName");
     var lastName = Console.ReadLine();
     Console.WriteLine("Enter your pasport number");
     var pasportNumber = ChoiseOperation();
     Visitor visitor = null;
     if (pasportNumber != 0)
     {
         visitor = new Visitor(firstName, lastName, pasportNumber, orders);
         return visitor;
     }
     Console.WriteLine("Please, only digits");
     NewVisitor(orders);
     return visitor;
 }
 partial void DeleteVisitor(Visitor instance);
 partial void UpdateVisitor(Visitor instance);
 partial void InsertVisitor(Visitor instance);
 public void CreateVisitor(Visitor item)
 {
     _cinema.Visitors.InsertOnSubmit(item);
     _cinema.SubmitChanges();
 }