// GET: WorkTasksAdmin/Create
 public ActionResult Create(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     var customers = db.Customers.ToList();
     ViewBag.CustomerListItems = from customer in customers
                                                     select new SelectListItem()
                                                     {
                                                         Text = customer.DisplayName,
                                                         Value = customer.CustomerId.ToString()
                                                     };
     CompleteWorkTaskVM completeWorkTaskVM = new CompleteWorkTaskVM()
     {
         StartDateTime = DateTime.Now,
         EndDateTime = DateTime.Now.AddHours(2)
     };
     completeWorkTaskVM.TechnicianId = id.Value;
     return View(completeWorkTaskVM);
 }
        // GET: WorkTasksAdmin/Delete/5
        public ActionResult Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            var workTask = db.WorkTasks.Include(wt => wt.Customer)
                                        .FirstOrDefault(wt => wt.WorkTaskId == id);
            if (workTask == null)
            {
                return HttpNotFound();
            }

            var completeWorkTaskVM = new CompleteWorkTaskVM()
            {
                WorkTaskId = workTask.WorkTaskId,
                StartDateTime = workTask.StartDateTime,
                EndDateTime = workTask.EndDateTime,
                WorkStatus = workTask.WorkStatus,
                CustomerId = workTask.Customer.CustomerId,
                CustomerName = workTask.Customer.DisplayName,
                TechnicianId = workTask.TechId
            };
            return View(completeWorkTaskVM);
        }
        // GET: WorkTasksAdmin/Edit/5
        public ActionResult Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            var workTask = db.WorkTasks.Include(wt => wt.Customer)
                                        .FirstOrDefault(wt => wt.WorkTaskId == id);
            if (workTask == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            var customers = db.Customers.ToList();
            ViewBag.CustomerListItems = from customer in customers
                                        select new SelectListItem()
                                        {
                                            Text = customer.DisplayName,
                                            Value = customer.CustomerId.ToString()
                                        };
            var completeWorkTaskVM = new CompleteWorkTaskVM()
            {
                WorkTaskId = workTask.WorkTaskId,
                StartDateTime = workTask.StartDateTime,
                EndDateTime = workTask.EndDateTime,
                WorkStatus = workTask.WorkStatus,
                CustomerId = workTask.Customer.CustomerId,
                CustomerName = workTask.Customer.DisplayName,
                TechnicianId = workTask.TechId
            };
            return View(completeWorkTaskVM);
        }