Ejemplo n.º 1
0
        public int AddProject(Project Project)
        {
            foreach (SkillSet s in Project.SkillSets)
                _context.Attach(s);

            _context.Add(Project);
            return Project.ProjectId;
        }
        public ActionResult CreateProject(Project Project)
        {
            try
            {
                var skill = _projectService.GetSkillSetById(Project.skillSetId);
                Project.SkillSets.Add(skill); 

                var projectId = _projectService.AddProject(Project);
                if (projectId >= 0)
                {
                    TempData["AlertMessage"] = Project.ProjectName + " Having ProjectId: " + projectId + " Created Successfully.";

                }

                return RedirectToAction("GetProjectList");
            }
            catch
            {
                return View();
            }
        }    
Ejemplo n.º 3
0
 public int UpdateProject(Project Project)
 {
     _context.Attach<Project>(Project);
     _context.Update<Project>(Project);
     return Project.ProjectId;
 }
Ejemplo n.º 4
0
 public Project GetProjectCode()
 {
     Project project = new Project();
     var projectId = _context.Query<Project>().Max(p => p == null ? 0 : p.ProjectId);
     project.ProjectCode = "PR100" + (projectId + 1);
     return project;
 }
        public ActionResult CreateProject(Project project)
        {
            try
            {
                var projectId = _projectService.AddProject(project);
                if (projectId >= 0)
                {
                    TempData["AlertMessage"] = project.ProjectName + " Having ProjectId: " + projectId + " Created Successfully.";

                }
                return RedirectToAction("GetProjectList");
            }
            catch (Exception ex)
            {
                return View();
            }
        }
 public ActionResult EditProject(Project project)
 {
     var updatedProjectId = _projectService.UpdateProject(project);
     if (updatedProjectId >= 0)
     {
         TempData["AlertMessage"] = project.ProjectName + " Having ProjectId: " + updatedProjectId + " Updated Successfully.";
     }
     return RedirectToAction("GetProjectList");
 }
 public int AddProject(Project Project)
 {
     _context.Add(Project);
     return Project.ProjectId;
 }