Beispiel #1
0
        static TableElement OpenInRedactor(TableElement tableEl, bool canEdit, Type typeOfTableElement = null)
        {
            if (tableEl != null)
            {
                typeOfTableElement = tableEl.GetType();
            }

            if (typeOfTableElement == typeof(Film))
            {
                if (tableEl == null)
                {
                    tableEl = new Film();
                }
                if (canEdit)
                {
                    return(Window_FilmRedactor.ShowDialog_Redactor(tableEl as Film));
                }
                Window_FilmRedactor.ShowDialog_View(tableEl as Film);
            }
            else if (typeOfTableElement == typeof(Seance))
            {
                if (tableEl == null)
                {
                    tableEl = new Seance();
                }
                if (canEdit)
                {
                    return(Window_SeanceRedactor.ShowDialog_Redactor(tableEl as Seance));
                }
                Window_SeanceRedactor.ShowDialog_View(tableEl as Seance);
            }
            else if (typeOfTableElement == typeof(Seller))
            {
                if (tableEl == null)
                {
                    tableEl = new Seller();
                }
            }
            else if (typeOfTableElement == typeof(CinemaRoom))
            {
                if (tableEl == null)
                {
                    tableEl = new CinemaRoom();
                }
                if (canEdit)
                {
                    return(Window_CinemaRoomRedactor.ShowDialog_Redactor(tableEl as CinemaRoom));
                }
                Window_CinemaRoomRedactor.ShowDialog_View(tableEl as CinemaRoom);
            }
            else if (typeOfTableElement == typeof(SoldTicket))
            {
                if (tableEl == null)
                {
                    tableEl = new SoldTicket();
                }
            }

            return(null);
        }
Beispiel #2
0
        public object Clone()
        {
            SoldTicket res = new SoldTicket();

            res.Id         = Id;
            res.SeatRow    = SeatRow;
            res.SeatColumn = SeatColumn;
            res.SaleDate   = SaleDate;
            res.Price      = Price;
            res.Seance     = Seance;
            res.Seller     = Seller;
            return(res);
        }