Пример #1
0
 public ActionResult Submit(UserTaskViewModel viewModelTask)
 {
     var task = new UserTask
     {
         Title = viewModelTask.Title,
         Description = viewModelTask.Description,
         MaximumOffer = viewModelTask.MaximumOffer,
         Submitted = DateTime.UtcNow
     };
     RavenSession.Store(task);
     return RedirectToAction("Details", new { id = task.Id });
 }
Пример #2
0
        private static UserTaskViewModel CreateTaskViewModel(UserTask task)
        {
            var userTaskBidViewModels = task.Bids == null ? new UserTaskBidViewModel[]{} : task.Bids.Select(b => new UserTaskBidViewModel
            {
                Id = b.Id, AgentId = b.Agent.Id, AgentName = b.Agent.Name, Amount = b.Amount,
            }).ToArray();

            var viewModel = new UserTaskViewModel
            {
                Id = task.Id,
                Title = task.Title,
                Description = task.Description,
                MaximumOffer = task.MaximumOffer,
                Bids = userTaskBidViewModels
            };
            return viewModel;
        }
Пример #3
0
 public ActionResult Submit(UserTask userTask)
 {
     RavenSession.Store(userTask);
     return RedirectToAction("Details", new {id = userTask.Id});
 }