public EditTaskForm(TaskClass task, ProjectClass project)
 {
     InitializeComponent();
     SelectedTask    = task;
     SelectedProject = project;
     ShowSelectedTask(task);
 }
Beispiel #2
0
 public EditProjectForm(ProjectClass project)
 {
     InitializeComponent();
     SelectedProject = project;
     ShowSelectedProject(project);
     rBtnFinished.Enabled = AreAllTasksDone();
 }
Beispiel #3
0
        public void AddNewProjectWeb(string projectName, int projectPrice, string projectDescription, DateTime projectStartDate, DateTime projectEndDate, ProjectState projectState, int managerId, int departmantId)
        {
            bool delay = false;

            if (projectEndDate < DateTime.Now)
            {
                delay = true;
            }
            using (var db = new CompanyDbContext())
            {
                var project = new ProjectClass.Project
                {
                    ProjectName        = projectName,
                    ProjectPrice       = projectPrice,
                    ProjectDescription = projectDescription,
                    ProjectStartDate   = projectStartDate,
                    ProjectEndDate     = projectEndDate,
                    ProjectState       = projectState,
                    DepartmentId       = departmantId,
                    ProjectManagerId   = managerId,
                    Delayed            = delay
                };
                db.Projects.Add(project);
                db.SaveChanges();
            }
        }
        public EmployeeTasksForm(ProjectClass project) : base(columns, false, true, false, false, false)
        {
            FillTable(taskService.GetEmployeeTasksForSelectedProject(Company.Instance.CurrentUser.Id, project.Id));

            SelectedProject = project;

            this.Text = "Tasks";
        }
Beispiel #5
0
        public TaskForm(ProjectClass selectedProject) : base(columns, true, false, false, false, false)
        {
            FillTable(taskService.GetAllTasksForSelectedProject(selectedProject.Id));

            SelectedProject = selectedProject;

            this.Text = "Tasks";
        }
Beispiel #6
0
 private void ShowSelectedProject(ProjectClass project)
 {
     lblOwnerName.Text      = Company.Instance.CurrentUser.Name;
     lblOwnerLastname.Text  = Company.Instance.CurrentUser.LastName;
     txtbxName.Text         = project.ProjectName;
     txtbxCost.Text         = project.ProjectPrice.ToString();
     rtxtbxDescription.Text = project.ProjectDescription;
     if (project.ProjectState == ProjectState.InProgres)
     {
         rBtnInProgres.Checked = true;
     }
 }
Beispiel #7
0
 public void AddNewProject(string projectName, int projectPrice, string projectDescription, DateTime projectStartDate, DateTime projectEndDate)
 {
     using (var db = new CompanyDbContext())
     {
         var project = new ProjectClass.Project
         {
             ProjectName        = projectName,
             ProjectPrice       = projectPrice,
             ProjectDescription = projectDescription,
             ProjectStartDate   = projectStartDate,
             ProjectEndDate     = projectEndDate,
             DepartmentId       = (int)Company.Instance.CurrentUser.DepartmentId,
             ProjectManagerId   = Company.Instance.CurrentUser.Id,
         };
         db.Projects.Add(project);
         db.SaveChanges();
     }
 }
Beispiel #8
0
 public CreateTask(ProjectClass selectedProject)
 {
     InitializeComponent();
     FillTable();
     SelectedProject = selectedProject;
 }