Exemplo n.º 1
0
        public void HandleProjectEdit(Project form, int projectId)
        {
            //Project project = Serializer.Serialize(form);
            form.ID = projectId;

            ProjectRepository.Update(form);
        }
Exemplo n.º 2
0
 public static void AssignUserToProject(ApplicationUser user, TaskVlopper.Base.Model.Project project)
 {
     using (IUnityContainer container = UnityConfig.GetConfiguredContainer())
     {
         var projLogic = container.Resolve <IProjectLogic>();
         projLogic.AssignUserToProject(project.ID, user.Email);
     }
 }
Exemplo n.º 3
0
 public static void AddTestTask(bool isUserLogged, TaskVlopper.Base.Model.Project project)
 {
     using (IUnityContainer container = UnityConfig.GetConfiguredContainer())
     {
         var taskLogic = container.Resolve <ITaskLogic>();
         taskLogic.HandleTaskAdd(ModelsMocks.TaskModelFirst, project.ID,
                                 isUserLogged ? ControllersMocks.LoggedUser : ControllersMocks.NotloggedUser);
     }
 }
Exemplo n.º 4
0
        public void HandleProjectAdd(Project project, string userId)
        {
            //Project project = Serializer.Serialize(form);
            ProjectRepository.Add(project);

            UserProjectAssignment userProjectAssignment = new UserProjectAssignment();
            userProjectAssignment.UserID = userId;
            userProjectAssignment.ProjectID = project.ID;

            UserProjectAssignmentRepository.Add(userProjectAssignment);
        }
Exemplo n.º 5
0
        public ActionResult Create(Project collection)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    IProjectLogic logic = container.Resolve<IProjectLogic>();
                    logic.HandleProjectAdd(collection, User.Identity.Name);

                    return Json(new JsonDataHandler(httpCode: HttpCodeEnum.Created, message: "Project successfully created!").getInfo(), JsonRequestBehavior.AllowGet);
                }
                return Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet);
            }
        }
Exemplo n.º 6
0
 public ProjectViewModel(Project project)
 {
     Project = project;
 }