public TheatersChairs(int? _showTimeID, int? _theatresID, int? timescreenID)
        {
            db= new HomeCinemaContext();

            movieID = (from movid in db.Movies
                       where movid.MovieID ==
                       (from mst in db.MovieShowTimes
                        where mst.MovieShowTimeID == _showTimeID
                        select mst).FirstOrDefault().MovieID
                       select movid).SingleOrDefault().MovieID;

            theaters = (from mt in db.Theaters
                        where mt.MovieTheatersID == _theatresID
                        select mt).SingleOrDefault();

            theaters.HomeCinema = db.HomeCinemas.Find(theaters.HomeCinemaID);

            timeScreening = db.TimeScreening.Find(timescreenID);

            rows = (from rws in db.Rows
                    where rws.TheatersID == theaters.MovieTheatersID
                    select rws).ToList();

            hallChairs = new List<HallChairs>();

            //adding hallChairs item's
            foreach (var rowItem in rows)
            {
                List<HallChairs> hallChairCollection = new List<Models.HallChairs>();

                hallChairCollection = (from hc in db.HallChairs
                                       where hc.RowID == rowItem.RowsID
                                       select hc).ToList();

                foreach (var hallchairItem in hallChairCollection)
                {
                    hallChairs.Add(hallchairItem);
                }
            }
        }
        //ctor(order)
        public EventsData(Event _Event, bool OrderExist)
        {
            if (_Event != null)
            {
                try
                {
                    //first get the full implement
                    evnt = _Event;
                    cartID = evnt.cartID;

                    // get the movieShowTime via Event.MovieShowTimeID
                    movieShowTime = db.MovieShowTimes.Find(Event.MovieShowTimeID);

                    movie = MovieShowTime.Movie;

                    // get the theatres item
                    theaters = (from theat in db.Theaters
                                where theat.MovieTheatersID ==
                                (from rw in db.Rows
                                 where rw.RowsID ==
                                 (from hc in db.HallChairs
                                  where hc.HallChairsID ==
                                  (from co in db.ChairsOrderd
                                   where co.EventID == Event.EventID
                                   select co).FirstOrDefault().HallChairID
                                  select hc).FirstOrDefault().RowID
                                 select rw).FirstOrDefault().TheatersID
                                select theat).SingleOrDefault();

                    // get the TimeScreening item
                    timeScreening = (from ts in db.TimeScreening
                                     where _Event.MovieShowTimeID == ts.MovieShowTimeID && ts.MovieTheatersID == theaters.MovieTheatersID
                                     select ts).SingleOrDefault();

                    ChairsNumber = new List<string>();
                    int[] ChairOrderID = Event.ChairsOrderds.Where(x=>x.EventID== Event.EventID).Select(x=>x.ChairsOrderdiD).ToArray();

                    ChairsNumber.AddRange(EcomLogic.GetChairNumbers(ChairOrderID,Event.ChairsOrderds));
                    getTotalChairsOrdered();

                    OrderDate = DateTime.Now;

                    // if there is a order all fine.. if no , go to catch and make one.
                    try
                    {
                        if (OrderExist == true)
                        {
                            order = (from odr in db.Orders
                                     where odr.EventID == evnt.EventID && odr.CartId == cartID
                                     select odr).SingleOrDefault();
                        }

                    }
                    catch (Exception)
                    {

                        ifEror = "Error by adding the Order.";
                    }

                    ifEror = null;
                }
                catch (Exception ex)
                {
                    ifEror = "There is an error while adding detial's."+ex.Message;
                }
            }
        }