public EventScheduleEntryViewModel(EventScheduleEntry dbModel)
        {
            this.Dbmodel = dbModel;

            var dbLoc = LunarSportsDBContext.getInstance().EventLocations.Where(el => el.ID == this.Dbmodel.LocationID).FirstOrDefault();

            this.Location = new EventLocationViewModel(dbLoc);
        }
 public EventListViewModel(Event dbmodel)
 {
     this.Dbmodel    = dbmodel;
     this.LaunchSite = new LaunchSiteViewModel(LunarSportsDBContext.getInstance().LaunchSites.Where(ls => this.Dbmodel.LaunchSiteID == ls.ID).FirstOrDefault());
 }
Example #3
0
        //Event Schedule entries -> as a list

        public EventDetailsViewModel(Event dbmodel) : base(dbmodel)
        {
            this.ScheduleEntries = LunarSportsDBContext.getInstance()
                                   .EventScheduleEntries.Where(ese => ese.EventID == this.Dbmodel.ID)
                                   .Select(ese => new EventScheduleEntryViewModel(ese)).ToList();
        }
Example #4
0
        public static LaunchSite LaunchSiteFromDb(int id)
        {
            var site = LunarSportsDBContext.getInstance().LaunchSites.Where(ls => ls.ID == id).FirstOrDefault();

            return(site);
        }
Example #5
0
 public LaunchSiteViewModel(LaunchSite dbmodel)
 {
     this.Dbmodel  = dbmodel;
     this.Location = LunarSportsDBContext.getInstance().EventLocations.Where(loc => this.Dbmodel.Location == loc.ID).FirstOrDefault();
     this.Contact  = LunarSportsDBContext.getInstance().EventLocationContactDetails.Where(c => c.ID == this.Location.ContactDetail).FirstOrDefault();
 }
 public EditUserModel(ApplicationUser au)
 {
     this._context = LunarSportsDBContext.getInstance();
     this.SetApplicationUserDetails(au);
     this.GetAdditionalUserDetails();
 }
Example #7
0
 public EventLocationViewModel(EventLocation dbmodel)
 {
     this.Dbmodel = dbmodel;
     this.Contact = LunarSportsDBContext.getInstance().
                    EventLocationContactDetails.Where(elcd => elcd.ID == this.Dbmodel.ContactDetail).FirstOrDefault();
 }