Exemple #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);
        }
Exemple #2
0
        public object Clone()
        {
            Seance res = new Seance();

            res.Id         = Id;
            res.Film       = Film;
            res.Room       = Room;
            res.SeanceDate = SeanceDate;
            return(res);
        }