/// <summary> /// Returns the serialized form of the requested project from the server /// </summary> public virtual DataResponse GetProject(ProjectRequest request) { return(cruiseServer.GetProject(request)); }
/// <summary> /// Gets the external links. /// </summary> /// <param name="request">The request.</param> /// <returns></returns> /// <remarks></remarks> public virtual ExternalLinksListResponse GetExternalLinks(ProjectRequest request) { return(cruiseServer.GetExternalLinks(request)); }
/// <summary> /// Returns the name of the most recent build for the specified project /// </summary> public virtual DataResponse GetLatestBuildName(ProjectRequest request) { return(cruiseServer.GetLatestBuildName(request)); }
/// <summary> /// Returns the names of all builds for the specified project, sorted s.t. the newest build is first in the array /// </summary> public virtual DataListResponse GetBuildNames(ProjectRequest request) { return(cruiseServer.GetBuildNames(request)); }
protected void Unnamed_Click(object sender, EventArgs e) { double totalCost = Convert.ToDouble(txtProjectTotalCost.Text); Project newProject = (Project)Application["newProject"]; newProject.ProjectTotalCost = totalCost; newProject.ProjectEndDateTime = newProject.ProjectEndDateTime.AddHours(Convert.ToDouble(txtLabourHours.Text)); //Changes Project Request Status if (newProject.ProjectRequestNumber != 0) { ProjectRequest pr = new ProjectRequest(); ProjectRequestBindingList.ProjectRequestList.Clear(); pr.SearchProjectRequests(); pr.CancelPrjectRequest(newProject.ProjectRequestNumber); } Application["newProject"] = newProject; Response.Redirect("./AddEmployee"); }
public ProjectResponse ReadProject(ProjectRequest request) { return(new MongoProject().Read(database, request)); }
public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var project = _context.Projects .Include(w => w.WorkPackages) .First(f => f.ProjectId == id); if (project == null) { return(NotFound()); } var manager = _context.ProjectEmployees .Where(e => e.ProjectId == id && e.Role == ProjectEmployee.PROJECT_MANAGER) .FirstOrDefault(); var assistant = _context.ProjectEmployees .Include(a => a.Employee) .Where(e => e.ProjectId == id && e.Role == ProjectEmployee.PROJECT_ASSISTANT) .FirstOrDefault(); //Check authorization to edit var uid = (await _usermgr.GetUserAsync(User)).Id; if (!User.IsInRole("AD") && manager.EmployeeId != uid && assistant != null && assistant.EmployeeId != uid) { return(RedirectToAction(nameof(Index))); } //We get the ProjectEmployees separately so we can Include the Employee of each var mgmtAndUnasigned = _context.ProjectEmployees .Include(e => e.Employee) .Where(e => e.ProjectId == id && e.Status == ProjectEmployee.CURRENTLY_WORKING) .GroupBy(pe => new { pe.EmployeeId, pe.Role }) .Select(pe => pe.FirstOrDefault()) .OrderBy(pe => pe.Role) .Distinct() .ToList(); var reqs = _context.ProjectRequests .Include(r => r.PayGrade) .Where(r => r.ProjectId == id) .ToList(); //This is for when new pay grades have been added that the project does not yet have #region Not Enough Pay Grades var grds = _context.PayGrades.ToList(); if (reqs.Count < grds.Count) { bool exists = false; foreach (var grade in grds) { foreach (var req in reqs) { if (grade.PayGradeId == req.PayGradeId) { exists = true; break; } } if (!exists) { ProjectRequest request = new ProjectRequest { PayGradeId = grade.PayGradeId, AmountRequested = 0, ProjectId = id, Status = ProjectRequest.VALID }; reqs.Add(request); _context.Add(request); } else { exists = false; } } await _context.SaveChangesAsync(); } #endregion ManageProject model = new ManageProject(); model.project = project; model.project.ProjectEmployees = mgmtAndUnasigned; model.requests = reqs; model.projectManager = manager.EmployeeId; if (assistant != null) { model.managersAssistant = assistant.EmployeeId; } List <Employee> mgrList = new List <Employee>(); List <Employee> assList = new List <Employee>(); ViewBag.Assistant = false; if (User.IsInRole("AD")) //Admin { mgrList = _context.Employees .ToList(); assList = mgrList; } else if (manager.EmployeeId == uid) // Project Manager { mgrList = _context.ProjectEmployees .Where(pe => pe.ProjectId == id) .Join(_context.Employees, pe => pe.EmployeeId, em => em.Id, (pe, em) => em) .Distinct() .ToList(); assList = mgrList; } else // Assistant { mgrList.Add(_context.Employees.Find(manager.EmployeeId)); assList.Add(_context.Employees.Find(assistant.EmployeeId)); ViewBag.Assistant = true; } List <SelectListItem> mgrItems = new List <SelectListItem>(); mgrItems.AddRange(new SelectList(mgrList, "Id", "Email")); List <SelectListItem> assItems = new List <SelectListItem>(); if (ViewBag.Assistant) { assItems.Insert(0, new SelectListItem { Text = assistant.Employee.Email, Value = assistant.EmployeeId }); } else { assItems.AddRange(new SelectList(mgrList, "Id", "Email")); assItems.Insert(0, new SelectListItem { Text = "None", Value = "" }); } ViewBag.EmployeesM = mgrItems; ViewBag.EmployeesA = assItems; ViewBag.Status = new SelectList(Project.Statuses.ToList(), "Key", "Value", project.Status); ViewBag.WPs = new SelectList(_context.WorkPackages.Where(w => w.ProjectId == project.ProjectId).ToList() , "Name", "Name", project.WorkPackages.First()); return(View(model)); }
protected void Page_Load(object sender, EventArgs e) { ProjectRequest pr = new ProjectRequest(); gvwStudents.DataSource = db.SearchQuery(pr.SearchProjectRequestClients(), "ProductRequestTable"); gvwStudents.DataMember = "ProductRequestTable"; gvwStudents.DataBind(); }
public void SetUp() { var input = new NewCommandInput { SolutionName = "NewThing", AppFlag = true }; var request = NewCommand.BuildTemplateRequest(input); project = request.Projects.Single(); }
public async Task FindAllTimeEntriesForProjectAsync_ShouldReturnTimeEntryDtoImplList() { // Create project var projectRequest = new ProjectRequest { Name = "FindAllTimeEntriesForProjectAsync " + Guid.NewGuid(), Color = "#FF00FF" }; var createProject = await _client.CreateProjectAsync(_workspaceId, projectRequest); createProject.IsSuccessful.Should().BeTrue(); createProject.Data.Should().NotBeNull(); ProjectDtoImpl project = createProject.Data; // Create TimeEntries var now = DateTimeOffset.UtcNow; var timeEntry1Request = new TimeEntryRequest { ProjectId = project.Id, Start = now, End = now.AddMinutes(2), Description = "TimeEntry1" }; var addTimeEntry1 = await _client.CreateTimeEntryAsync(_workspaceId, timeEntry1Request); addTimeEntry1.IsSuccessful.Should().BeTrue(); addTimeEntry1.Data.Should().NotBeNull(); TimeEntryDtoImpl timeEntry1 = addTimeEntry1.Data; var timeEntry2Request = new TimeEntryRequest { ProjectId = project.Id, Start = now.AddDays(-1), End = now.AddMinutes(3), Description = "TimeEntry2" }; var addTimeEntry2 = await _client.CreateTimeEntryAsync(_workspaceId, timeEntry2Request); addTimeEntry2.IsSuccessful.Should().BeTrue(); addTimeEntry2.Data.Should().NotBeNull(); TimeEntryDtoImpl timeEntry2 = addTimeEntry2.Data; // Send request var response = await _client.FindAllTimeEntriesForProjectAsync(_workspaceId, projectId : project.Id, start : DateTimeOffset.Now.AddDays(-2), end : DateTimeOffset.Now.AddDays(1)); //response.IsSuccessful.Should().BeTrue(); response.Data.Should().NotBeNull(); List <TimeEntryDtoImpl> responseContent = response.Data as List <TimeEntryDtoImpl>; responseContent.Should().Contain(timeEntry => timeEntry.Id.Equals(timeEntry1.Id)); responseContent.Should().Contain(timeEntry => timeEntry.Id.Equals(timeEntry2.Id)); // Clean up await _client.DeleteTimeEntryAsync(_workspaceId, addTimeEntry1.Data.Id); await _client.DeleteTimeEntryAsync(_workspaceId, addTimeEntry2.Data.Id); var deleteProject = await _client.ArchiveAndDeleteProject(_workspaceId, createProject.Data.Id); deleteProject.IsSuccessful.Should().BeTrue(); }
public ActionResult Create() { var projectYourRequest = new ProjectRequest(); return(View(projectYourRequest)); }
/// <summary> /// Add a new project to workspace. /// </summary> public Task <IRestResponse <ProjectDtoImpl> > CreateProjectAsync(string workspaceId, ProjectRequest projectRequest) { if (projectRequest == null) { throw new ArgumentNullException(nameof(projectRequest)); } if (projectRequest.Name == null) { throw new ArgumentNullException(nameof(projectRequest.Name)); } if (projectRequest.Color == null) { throw new ArgumentNullException(nameof(projectRequest.Color)); } if (projectRequest.Estimate != null && !Enum.IsDefined(typeof(EstimateType), projectRequest.Estimate.Type)) { throw new ArgumentOutOfRangeException(nameof(projectRequest.Estimate.Type)); } var request = new RestRequest($"workspaces/{workspaceId}/projects", Method.POST); request.AddJsonBody(projectRequest); return(_client.ExecutePostAsync <ProjectDtoImpl>(request)); }
public ProjectResponse DeleteProject(ProjectRequest request) { return(new MongoProject().Delete(database, request)); }
public string teacherSync_request(string person_id, int type_person) { ResponseRequestList r = new ResponseRequestList(); ProjectRequest p = new ProjectRequest(); if (type_person == 0) { r.code = 11; r.msg = "Parameter Wrong"; } else { try { string constr = WebConfigurationManager.ConnectionStrings["Dbconnection"].ConnectionString; SqlConnection con = new SqlConnection(constr); con.Open(); //project_id = getProjectID(person_id); string sqlproject = "SELECT * FROM Request_Title WHERE AcceptanceID = '" + person_id + "'"; SqlCommand qrproject = new SqlCommand(sqlproject, con); SqlDataReader reader = qrproject.ExecuteReader(); r.request = new List<ProjectRequest>(); while (reader.Read()) { p = new ProjectRequest(); p.project_id = reader["ProjID"].ToString(); // p.project_id = getNameProject(reader["ProjID"].ToString()); p.project_title = getRequest(reader["ReqID"].ToString()); p.date = reader["Date"].ToString(); r.request.Add(p); } reader.Close(); con.Close(); r.code = 0; r.msg = "OK"; } catch { r.code = 9; r.msg = "Database Error"; } } return JsonConvert.SerializeObject(r); }
/// <summary> /// Aborts the build of the selected project. /// </summary> /// <param name="request">A <see cref="ProjectRequest"/> containing the request details.</param> /// <returns>A <see cref="Response"/> containing the results of the request.</returns> public Response AbortBuild(ProjectRequest request) { return(cruiseServer.AbortBuild(request)); }
protected void TextBox2_Click(object sender, EventArgs e) { string date = default_datetimepicker.Text; if (String.IsNullOrEmpty(date)) { date = "10/10/2010"; } string[] words = date.Split('/'); DateTime dateRequestedFor = new DateTime(Convert.ToInt32(words[2]), Convert.ToInt32(words[1]), Convert.ToInt32(words[0])); DateTime dateRequestedOn = DateTime.Today; try { clientVehicleNumber = Convert.ToInt32(VehicleDDL.SelectedItem.Value); } catch(Exception) { Lbl.Text = "Please select a vehicle"; } if(CheckBox1.Checked) { if(CheckBox2.Checked) { if(Minor.Checked) { modtype = "Modification and Minor Service"; } else { modtype = "Modification and Major Service"; } } else { modtype = "Modification"; } } else { if (CheckBox2.Checked) { if (Minor.Checked) { modtype = "Minor Service"; } else { modtype = "Major Service"; } } } string projectDescription = txtProjectDescription.Text; if (CheckBox1.Checked == false && Major.Checked == false && Minor.Checked == false) { Lbl.Text = "Please select whether you would like to modify your vehicle and/or service it"; } else if (CheckBox1.Checked == true && string.IsNullOrWhiteSpace(projectDescription)) { Lbl.Text = "You have selected to Modify Your Vehicle - Please enter a description of what you would like Tweek performance to do"; } else if (string.IsNullOrWhiteSpace(default_datetimepicker.Text)|| dateRequestedFor < dateRequestedOn) { Lbl.Text = "You have selected a valid date for the project"; } else { ProjectRequest newPR = new ProjectRequest(0, usernumber, clientVehicleNumber, dateRequestedFor, dateRequestedOn, 1, projectDescription, modtype); try { Label lblMasterStatus = (Label)Master.FindControl("message"); lblMasterStatus.Visible = true; lblMasterStatus.Text = newPR.InsertNewProjectRequest(newPR); } catch(Exception) { Label lblMasterStatus = (Label)Master.FindControl("message"); lblMasterStatus.Visible = true; lblMasterStatus.Text = newPR.InsertNewProjectRequest(newPR); } Response.Redirect("/"); } }
/// <summary> /// Cancel a pending project integration request from the integration queue. /// </summary> public Response CancelPendingRequest(ProjectRequest request) { return(cruiseServer.CancelPendingRequest(request)); }
protected void Unnamed_Click(object sender, EventArgs e) { ProjectRequest pr = new ProjectRequest(); pr.CancelPrjectRequest(projectRequestNumber); }
/// <summary> /// Waits for the project to exit. /// </summary> /// <param name="request"></param> /// <returns></returns> public virtual Response WaitForExit(ProjectRequest request) { return(cruiseServer.WaitForExit(request)); }
public IQueryable<SoftwareProject> All(ProjectRequest request = null, string username = null) { request = request ?? new ProjectRequest(); var query = this.projects.All().Where(pr => !pr.Private); if (!string.IsNullOrWhiteSpace(username) && !request.OnlyPublic) { query = this.projects .All() .Where(pr => !pr.Private || (pr.Private && pr.Users.Any(c => c.Email == username))); } if (!string.IsNullOrWhiteSpace(request.Filter)) { query = query .Where(pr => pr.Name.ToLower().Contains(request.Filter.ToLower()) || pr.Description.ToLower().Contains(request.Filter.ToLower())); } if (!string.IsNullOrWhiteSpace(request.ByUser)) { query = query .Where(pr => pr.Users.Any(u => u.Email == request.ByUser)); } if (request.OrderBy == "collaborators") { if (request.OrderType == "desc") { query = query.OrderByDescending(pr => pr.Users.Count()); } else { query = query.OrderBy(pr => pr.Users.Count()); } } else if (request.OrderBy == "name") { if (request.OrderType == "desc") { query = query.OrderByDescending(pr => pr.Name); } else { query = query.OrderBy(pr => pr.Name); } } else { if (request.OrderType == "desc") { query = query.OrderByDescending(pr => pr.CreatedOn); } else { query = query.OrderBy(pr => pr.CreatedOn); } } return query .Skip((request.Page - 1) * request.PageSize) .Take(request.PageSize); }
public Task <List <ProjectResponse> > GetListAsync(ProjectRequest request) { return(Service.GetListAsync(request)); }