Exemplo n.º 1
0
        //GET Index
        //This loads the my work items as a summary
        public async Task <IActionResult> Index()
        {
            var data = new MyWorkItemsViewModel
            {
                WorkItems = await _workItemDataService.GetMyWorkItemsAsync("due"),
                WorkItem  = new WorkItem()
            };


            return(View(data));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateFromVM(MyWorkItemsViewModel model)
        {
            model.WorkItem.CreatedOn   = DateTime.Now;
            model.WorkItem.LastUpdated = DateTime.Now;
            //make the due time equal to CoB on the date (1700 hrs)
            model.WorkItem.DueDate   = model.WorkItem.DueDate.AddHours(17);
            model.WorkItem.Complete  = false;
            model.WorkItem.Active    = true;
            model.WorkItem.CreatedBy = Constants.HardCodedSignedInUser;
            model.WorkItem.Status    = Constants.OnTrack;
            await _workItemDataService.AddWorkItemAsync(model.WorkItem);

            ModelState.Clear();

            return(RedirectToAction("Index"));
        }