public static void ChangeStatus(int WorkTypeID, string newStatus) { WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable WorkTypeTable = workTypeAdapter.GetWorkType(WorkTypeID); NuRacingDataSet.WorkTypeRow WorkTypeRow = (NuRacingDataSet.WorkTypeRow) WorkTypeTable.Rows[0]; WorkTypeRow.WorkType_Status = newStatus; WorkTypeRow.WorkType_StatusChangedDate = DateTime.Now; workTypeAdapter.Update(WorkTypeTable); }
public static void AddWorkType(int ProjectID, string Name) { if (!Project.projectExists(ProjectID)) { throw new ArgumentException("ProjectID wasn't valid"); } WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable WorkTypeTable = workTypeAdapter.GetData(); NuRacingDataSet.WorkTypeRow WorkTypeRow = WorkTypeTable.NewWorkTypeRow(); WorkTypeRow.Project_UID = ProjectID; WorkTypeRow.WorkType_Name = Name; WorkTypeRow.WorkType_Status = "Planning"; WorkTypeRow.WorkType_StatusChangedDate = DateTime.Now; WorkTypeTable.AddWorkTypeRow(WorkTypeRow); workTypeAdapter.Update(WorkTypeTable); }
/// <summary> /// Return a list of assigned tasks for a project /// </summary> /// <param name="ProjectID"></param> /// <returns></returns> public static List<TaskInfo> getProjectTasks(int ProjectID) { WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable workTypeTable = workTypeAdapter.GetDataByProjectID(ProjectID); List<TaskInfo> result = new List<TaskInfo>(); foreach (NuRacingDataSet.WorkTypeRow workTypeRow in workTypeTable) { result.AddRange(getWorkTypeTasks(workTypeRow.WorkType_UID)); } return result; }
public static List<WorkTypeInfo> getActiveWorkTypes() { WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable WorkTypeTable = workTypeAdapter.GetData(); List<WorkTypeInfo> result = new List<WorkTypeInfo>(); foreach (NuRacingDataSet.WorkTypeRow WorkTypeRow in WorkTypeTable.Rows) { if (BusinessLogicLayer.Project.projectActive(WorkTypeRow.Project_UID)) { result.Add(new WorkTypeInfo(WorkTypeRow)); } } return result; }
public static WorkTypeInfo getWorkType(int WorkType) { WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable WorkTypeTable = workTypeAdapter.GetWorkType(WorkType); if (WorkTypeTable.Rows.Count == 0) { throw new ArgumentException("Work Type Doesn't Exist"); } return new WorkTypeInfo((NuRacingDataSet.WorkTypeRow)WorkTypeTable.Rows[0]); }
public static List<WorkTypeInfo> getProjectWorkTypes(int ProjectID) { WorkTypeTableAdapter workTypeAdapter = new WorkTypeTableAdapter(); NuRacingDataSet.WorkTypeDataTable WorkTypeTable = workTypeAdapter.GetDataByProjectID(ProjectID); List<WorkTypeInfo> result = new List<WorkTypeInfo>(); foreach (NuRacingDataSet.WorkTypeRow WorkTypeRow in WorkTypeTable.Rows) { result.Add(new WorkTypeInfo(WorkTypeRow)); } return result; }