public void GetUserProjects_Test() { ProjectManagement manager = new ProjectManagement(new ApplicationDbContext()); var projects = manager.GetUserProjects(userTestId); Assert.IsNotNull(projects); }
protected void gridPM_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { //ASPxHtmlEditor txDescription = gridPM.FindEditFormTemplateControl("txDescription") as ASPxHtmlEditor; //ASPxHtmlEditor txSolution = gridPM.FindEditFormTemplateControl("txSolution") as ASPxHtmlEditor; ProjectManagement NewPM = new ProjectManagement(); NewPM.Id = (string)e.Keys [0]; NewPM.Description = (string)e.NewValues["Description"]; NewPM.Solution = (string)e.NewValues["Solution"]; NewPM.Priority = (string)e.NewValues["Priority"]; NewPM.Status = (string)e.NewValues["Status"]; NewPM.Title = (string)e.NewValues["Title"]; NewPM.UniqueID = (string)e.NewValues["UniqueID"]; NewPM.Type = (string)e.NewValues["Type"]; NewPM.Area = (string)e.NewValues["Area"]; NewPM.Home = (string)e.NewValues["Home"]; rc_services.UpdatePMitem(NewPM); bool EnterpriseAuthorized = rc_services.CheckPermission("ent_pm"); gridPM.DataSource = rc_services.GetPMitems(EnterpriseAuthorized); e.Cancel = true; gridPM.CancelEdit(); gridPM.DataBind(); }
protected void gridPM_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ProjectManagement NewPM = new ProjectManagement(); NewPM.Description = (string)e.NewValues["Description"]; NewPM.Solution = (string)e.NewValues["Solution"]; NewPM.Priority = (string)e.NewValues["Priority"]; NewPM.Status = (string)e.NewValues["Status"]; NewPM.Title = (string)e.NewValues["Title"]; NewPM.UniqueID = (string)e.NewValues["UniqueID"]; NewPM.Type = (string)e.NewValues["Type"]; NewPM.Area = (string)e.NewValues["Area"]; NewPM.CreatedBy = rc_services.GetUserEmail(); //Check if user has enterprise level permission. If so, allow their choice of Home, if not, force project level bool EnterpriseAuthorized = rc_services.CheckPermission("ent_pm"); if (EnterpriseAuthorized) { NewPM.Home = (String)e.NewValues["Home"]; } else { NewPM.Home = "P"; } rc_services.InsertPMitem(NewPM); gridPM.DataSource = rc_services.GetPMitems(EnterpriseAuthorized); e.Cancel = true; gridPM.CancelEdit(); gridPM.DataBind(); }
public ActionResult Create(ProjectManagement projectmanagement) { if (ModelState.IsValid) { if (Request.Files.Count > 0) { try { var file = Request.Files[0]; if (file != null && file.ContentLength > 0) { string path = Path.Combine(Server.MapPath("~/Images/"), Path.GetFileName(file.FileName)); file.SaveAs(path); projectmanagement.UploadFile = path; ViewBag.Message = "File uploaded successfully"; } } catch (Exception ex) { ViewBag.Message = "ERROR:" + ex.Message.ToString(); } } } { projectmanagement.UserId = WebSecurity.CurrentUserId; db.ProjectManagements.Add(projectmanagement); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(projectmanagement)); }
public void GetNewProjects_Test() { ProjectManagement manager = new ProjectManagement(new ApplicationDbContext()); var projects = manager.GetNewProjects(); Assert.AreEqual(2, projects.Count); }
public async Task <ActionResult <ProjectManagement> > PostProjectManagement(ProjectManagementDTO projectManagementDTO) { var projassigned = _context.ProjectManagements.Where(p => p.EmployeeId == projectManagementDTO.EmployeeId && p.ProjectId == projectManagementDTO.ProjectId).FirstOrDefault(); if (projassigned != null) { return(Conflict(new RespStatus { Status = "Failure", Message = "Employee is already assigned to the Project" })); } ProjectManagement projectManagement = new ProjectManagement { ProjectId = projectManagementDTO.ProjectId, EmployeeId = projectManagementDTO.EmployeeId }; _context.ProjectManagements.Add(projectManagement); await _context.SaveChangesAsync(); return(Ok(new RespStatus { Status = "Success", Message = "Employee is assigned to the Project" })); }
public static void Testing() { using CFDbContext db = new CFDbContext(); ProjectManagement projMng = new ProjectManagement(db); //ProjectOption projOption = new ProjectOption //{ // ProjectCreatorId = 1, // Title = "Full of sugar juice", // Description = "We are NOT using stevia", // Category = "HealthNOT", // EndDate = DateTime.Now.AddDays(4), // Goal = 5000m, //}; //Project project = projMng.CreateProject(projOption); ////////////////////////////////////////// Console.WriteLine(projMng.TrackProgressByProjectId(1)); ////////////////////////////////////////// //var proj = projMng.FindProjectsByProjectCreator(1); //var trediProjects = projMng.SortProjectsByTrends(); }
public ActionResult Details(int id = 0) { ProjectManagement projectmanagement = db.ProjectManagements.Find(id); if (projectmanagement == null) { return(HttpNotFound()); } var tasks = (from taskAssign in db.TaskAssigns join assignBy in db.UserProfiles on taskAssign.TaskAssignBy equals assignBy.UserId join assignTo in db.UserProfiles on taskAssign.PersonUserId equals assignTo.UserId where taskAssign.ProjectId == id select new ShowTaskVM() { Description = taskAssign.Description, AssignTo = assignTo.UserName, Priority = taskAssign.Priority, AssignedBy = assignBy.UserName, DueDate = taskAssign.DueDate }).ToList(); //var tasks = db.TaskAssigns.Where(_ => _.ProjectId == id).ToList(); ViewBag.Tasks = tasks; return(View(projectmanagement)); }
public ProjectController() { this.pm = new ProjectManagement(); this.cm = new CompentenceManagement(); this.categoryM = new CategoryManagement(); this.tk = new TaskManagement(); this.am = new AccountManagement(); }
public UserController(WorkFlowDbContext context) { converter = new Converter(); um = new UserManagement(context); rm = new RoleManagement(context); es = new EmailSendingManagement(); pm = new ProjectManagement(context); }
public ActionResult DeleteConfirmed(int id) { ProjectManagement projectmanagement = db.ProjectManagements.Find(id); db.ProjectManagements.Remove(projectmanagement); db.SaveChanges(); return(RedirectToAction("Index")); }
public static bool addProjectStudent(ProjectManagement projectM) { using (var _context = new DBProjectStudentEntities()) { _context.ProjectManagements.Add(projectM); _context.SaveChanges(); return(true); } }
private Theme LoadThemeInDesingMode(ThemeSource themeSource) { ProjectManagement managementInstance = ProjectManagement.GetProjectManagementInstance((IServiceProvider)themeSource.OwnerThemeManager.Site); string activeProjectFullPath = managementInstance.Services.GetActiveProjectFullPath(); if (!themeSource.SettingsAreValid) { return(this.theme); } string configurationPropertyValue = (string)managementInstance.Services.GetProjectConfigurationPropertyValue("OutputPath"); if (string.IsNullOrEmpty(activeProjectFullPath) || string.IsNullOrEmpty(configurationPropertyValue)) { return((Theme)null); } string path1 = Path.Combine(activeProjectFullPath, configurationPropertyValue); string str = (string)null; if (themeSource.StorageType == ThemeStorageType.File) { if (Path.IsPathRooted(themeSource.ThemeLocation)) { return((Theme)null); } string themeLocation = themeSource.ThemeLocation; if (path1 != null && !string.IsNullOrEmpty(themeLocation)) { string path2 = themeLocation.Replace("~\\", "").Replace("~", ""); str = Path.Combine(path1, path2); if (!File.Exists(str)) { themeSource.loadError = "Path not found: " + str; return(this.theme); } } } else if (themeSource.StorageType == ThemeStorageType.Resource) { string themeLocation = themeSource.ThemeLocation; string[] fileNameParts = themeLocation.Split('.'); str = ThemeSource.SearchFile(activeProjectFullPath, fileNameParts); if (str == null) { themeSource.loadError = string.Format("Unable locate Resource file '{0}' in the project folder '{1}'", (object)string.Join(Path.DirectorySeparatorChar.ToString(), themeLocation.Split('.')), (object)activeProjectFullPath); return(this.theme); } } if (str == null) { themeSource.loadError = "Unable to determine active project path."; return(this.theme); } Theme theme = Theme.ReadXML(str); ThemeRepository.Add(theme); return(theme); }
// // GET: /ProjectManagement/Edit/5 public ActionResult Edit(int id = 0) { ProjectManagement projectmanagement = db.ProjectManagements.Find(id); if (projectmanagement == null) { return(HttpNotFound()); } return(View(projectmanagement)); }
public ActionResult Edit(ProjectManagement projectmanagement) { if (ModelState.IsValid) { db.Entry(projectmanagement).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(projectmanagement)); }
/// <summary> /// Simple query, yields <c>ShortProject</c> objects. Can drill down later if needed. /// </summary> /// <param name="startsWith"></param> /// <returns></returns> public IList <ShortProject> Projects(string startsWith) { startsWith = startsWith.ToLowerInvariant(); var pm = new ProjectManagement(Connection); var mapper = new ProjectToShortProjectMapper(); return(pm.GetProjects().Where(p => p.Name.StartsWith(startsWith, StringComparison.InvariantCultureIgnoreCase) || p.ShortName.StartsWith(startsWith, StringComparison.InvariantCultureIgnoreCase)) .Select(mapper.Map) .ToList()); }
static void Main() { var optionsBuilder = new DbContextOptionsBuilder <CrowdDbContext>(); optionsBuilder.UseSqlServer(CrowdDbContext.ConnectionString); using CrowdDbContext db = new CrowdDbContext(optionsBuilder.Options); IPackageManager projectMngr = new PackageManagement(db); var list = projectMngr.BackerRewards(3); IProjectManager project = new ProjectManagement(db); int c = project.PagesNum(); }
public async Task <ActionResult <ProjectManagement> > PostProjectManagement(ProjectManagementDTO projectManagementDTO) { ProjectManagement projectManagement = new ProjectManagement(); projectManagement.ProjectId = projectManagementDTO.ProjectId; projectManagement.EmployeeId = projectManagementDTO.EmployeeId; _context.ProjectManagements.Add(projectManagement); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProjectManagement", new { id = projectManagement.Id }, projectManagement)); }
private void dgvProjectDetail_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) // chac chan phai chon 1 hang { rowStudent = new ProjectManagement(); DataGridViewRow row = this.dgvProjectDetail.Rows[e.RowIndex]; rowStudent.P_ID = int.Parse(lblProjectID.Text); rowStudent.S_ID = row.Cells[0].Value.ToString(); var student = StudentController.findStudentbySID(rowStudent.S_ID); if (student != null) { frmProgress frm = new frmProgress(rowStudent.P_ID, rowStudent.S_ID, student.S_fullname); frm.ShowDialog(); } } }
public Management(IApplicationProgrammableInterface service) { InitializeComponent(); this.service = service; pManagement = new ProjectManagement(service); aManagement = new ActivityManagement(service); hManagement = new HourManagement(service); pManagement.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; aManagement.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; hManagement.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; service.SubScribe(pManagement); service.SubScribe(aManagement); service.SubScribe(hManagement); MainLayoutCount = MainLayout.Controls.Count; MenuSelectorView.ExpandAll(); }
private void btnAdd_Click(object sender, EventArgs e) { ProjectManagement student = new ProjectManagement(); student.S_ID = this.cmbStudentName.SelectedValue.ToString(); student.P_ID = id; if (ProjectManagementController.addProjectStudent(student) == false) { MessageBox.Show("Error in adding a new student!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Add success!!!", "Note", MessageBoxButtons.OK, MessageBoxIcon.Information); } BindingSource source = new BindingSource(); source.DataSource = ProjectManagementController.getAllStudentbyIDproject(id); this.dgvProjectDetail.DataSource = source; }
/// <summary> /// This method will add details of project management. (Also this will be called while adding employee.) /// </summary> /// <param name="projectManagement"></param> public void AddEmployeeToProject(ProjectManagement projectManagement) { _dbContext.ProjectManagement.Add(projectManagement); }
public ProjectsController() { db = new ApplicationDbContext(); projectManagement = new ProjectManagement(db); tasksManagement = new TasksManagement(db); }
//[Authorize(Roles = "Admin, Project Manager, Developer, Submitter")] public ProjectsController() { projectManager = new ProjectManagement(db); }
public ProjectsController(WorkFlowDbContext context) { pm = new ProjectManagement(context); converter = new Converter(); }
private bool LoadThemeInDesingMode(ThemeSource themeSource) { ProjectManagement pm = ProjectManagement.GetProjectManagementInstance(themeSource.OwnerThemeManager.Site); string projectFullPath = pm.Services.GetActiveProjectFullPath(); //return true - means no further processing required if (!themeSource.SettingsAreValid) { return(true); } string baseFolder = null; string fileName = null; string outputPath = (string)pm.Services.GetProjectConfigurationPropertyValue("OutputPath"); if (string.IsNullOrEmpty(projectFullPath) || string.IsNullOrEmpty(outputPath)) { return(false); } baseFolder = Path.Combine(projectFullPath, outputPath); string validFilePath = null; if (themeSource.StorageType == ThemeStorageType.File) { if (Path.IsPathRooted(themeSource.ThemeLocation)) { return(false); } fileName = themeSource.ThemeLocation; if (baseFolder != null && !string.IsNullOrEmpty(fileName)) { fileName = fileName.Replace("~\\", ""); fileName = fileName.Replace("~", ""); validFilePath = Path.Combine(baseFolder, fileName); if (!File.Exists(validFilePath)) { themeSource.loadError = "Path not found: " + validFilePath; return(true); } } } else if (themeSource.StorageType == ThemeStorageType.Resource) { string themeLocation = themeSource.ThemeLocation; string[] fileNameParts = themeLocation.Split('.'); validFilePath = SearchFile(projectFullPath, fileNameParts); if (validFilePath == null) { themeSource.loadError = string.Format( "Unable locate Resource file '{0}' in the project folder '{1}'", string.Join(Path.DirectorySeparatorChar.ToString(), themeLocation.Split('.')), projectFullPath ); return(true); } } if (validFilePath == null) { themeSource.loadError = "Unable to determine active project path."; return(true); } using (XmlReader reader = XmlReader.Create(validFilePath)) { this.DeserializePartiallyThemeFromReader(reader, validFilePath); } themeSource.loadSucceeded = true; return(true); }
public AccountController() { this.am = new AccountManagement(); this.cm = new CompentenceManagement(); this.pm = new ProjectManagement(); }