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

            ProjectRepository.Update(form);
        }
Esempio 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);
     }
 }
Esempio 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);
     }
 }
Esempio 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);
        }
        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);
            }
        }
 public ProjectViewModel(Project project)
 {
     Project = project;
 }