//private HolidayDetailViewModel _vm;

        public HolidayDetailPage()
        {
            this.InitializeComponent();
            _vm         = new HolidayDetailViewModel();
            DataContext = _vm;

            Name.Text          = "Holiday Details - " + _vm.Holiday.Name;
            Destination.Text   = "Destination: " + _vm.Holiday.Destination;
            DepartureDate.Text = "Departure Date: " + _vm.Holiday.DepartureDate.ToLongTimeString();
            Description.Text   = "Description: " + _vm.Holiday.Description;

            ItemListView.ItemsSource = _vm.Holiday._items;

            List <HolidayTask> tasks = new List <HolidayTask>();

            HolidayTask t1 = new HolidayTask("Get new ID card.", false);
            HolidayTask t2 = new HolidayTask("Find babysitter for cat.", false);
            HolidayTask t3 = new HolidayTask("Work hard to save 1k euros. ", true);

            tasks.Add(t1);
            tasks.Add(t2);
            tasks.Add(t3);

            TaskListView.ItemsSource = tasks;
        }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            HolidayTask holidayTask = db.HolidayTasks.Find(id);

            db.HolidayTasks.Remove(holidayTask);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ID,UpBy815,EntryDate,PhilipWordQuantity,JamesWordQuantity,JohnWordQuantity,PhilipLastRunDate,PhilipLastWeightsDate,PhilipLastCycleDate,UserID")] HolidayTask holidayTask)
 {
     if (ModelState.IsValid)
     {
         db.Entry(holidayTask).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", holidayTask.UserID);
     return(View(holidayTask));
 }
Ejemplo n.º 4
0
        // GET: HolidayTasks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HolidayTask holidayTask = db.HolidayTasks.Find(id);

            if (holidayTask == null)
            {
                return(HttpNotFound());
            }
            return(View(holidayTask));
        }
Ejemplo n.º 5
0
        // GET: HolidayTasks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HolidayTask holidayTask = db.HolidayTasks.Find(id);

            if (holidayTask == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", holidayTask.UserID);
            return(View(holidayTask));
        }