Ejemplo n.º 1
0
 public ActionResult Create(ProjectViewModel data)
 {
     Project model = Mapper.Map<ProjectViewModel, Project>(data);
     try
     {
         string currentUserId = User.Identity.GetUserId();
         model.CreatedOn = DateTime.Now;
         model.UpdatedOn = DateTime.Now;
         model.CreatedByUser = _userService.GetUserByGuid(User.Identity.GetUserId()); ;
         _projectService.CreateProject(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Ejemplo n.º 2
0
 public ActionResult Edit(ProjectViewModel data)
 {
     Project model = Mapper.Map<ProjectViewModel, Project>(data);
     try
     {
         // TODO: Add update logic here
        // model.UpdatedOn = DateTime.Now;
         //model.ModifiedBy = _userService.GetUserByGuid(User.Identity.GetUserId());
         model.ModifiedById = User.Identity.GetUserId();
         _projectService.UpdateProject(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }