public void updateDatabase() { if (beenChanged) { AssignedTaskTableAdapter taskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable taskTable = taskAdapter.GetAssignedTask(taskID); NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)taskTable.Rows[0]; taskRow.WorkType_UID = workTypeID; taskRow.Task_Name = taskName; taskRow.Task_Description = taskDescription; taskRow.Task_TakeFiveNeeded = takeFiveNeeded; taskRow.Task_DueDate = dueDate; if (taskStatus != null) { taskRow.Task_Status = taskStatus; } if (taskIncompleteReason != null) { taskRow.Task_IncompleteReason = taskIncompleteReason; } taskAdapter.Update(taskTable); } }
/// <summary> /// Return a TaskInfo object via specified assignedTaskID /// </summary> /// <param name="assignedTaskID"></param> /// <returns></returns> public static TaskInfo getAssignedTask(int assignedTaskID) { AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(assignedTaskID); if (assignedTaskTable.Rows.Count == 0) { throw new ArgumentException("Assigned Task Doesn't Exist"); } return(new TaskInfo((NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0])); }
public void resetData() { if (!beenChanged) { AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(taskID); NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0]; assigningUserInfo = UserInfo.getUser(taskRow.User_Username_AssignedBy); taskID = taskRow.Task_UID; workTypeID = taskRow.WorkType_UID; taskName = taskRow.Task_Name; taskDescription = taskRow.Task_Description; takeFiveNeeded = taskRow.Task_TakeFiveNeeded; if (!taskRow.IsTask_StatusNull()) { taskStatus = taskRow.Task_Status; if (!taskRow.IsTask_IncompleteReasonNull()) { taskIncompleteReason = taskRow.Task_IncompleteReason; } } dueDate = taskRow.Task_DueDate; AssignedUserTableAdapter assignedUserAdapter = new AssignedUserTableAdapter(); NuRacingDataSet.AssignedUserDataTable assignedUserTable = assignedUserAdapter.GetDataByTaskID(TaskID); userAssignedInfo = new List <UserInfo>(assignedUserTable.Rows.Count); foreach (NuRacingDataSet.AssignedUserRow assignedUserRow in assignedUserTable.Rows) { userAssignedInfo.Add(UserInfo.getUser(assignedUserRow.User_Username)); } } }
public void updateDatabase() { if (beenChanged) { AssignedTaskTableAdapter taskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable taskTable = taskAdapter.GetAssignedTask(taskID); NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)taskTable.Rows[0]; taskRow.WorkType_UID = workTypeID; taskRow.Task_Name = taskName; taskRow.Task_Description = taskDescription; taskRow.Task_TakeFiveNeeded = takeFiveNeeded; taskRow.Task_DueDate = dueDate; if (taskStatus != null) { taskRow.Task_Status = taskStatus; } if (taskIncompleteReason != null) { taskRow.Task_IncompleteReason = taskIncompleteReason; } taskAdapter.Update(taskTable); } }
public void resetData() { if (!beenChanged) { AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(taskID); NuRacingDataSet.AssignedTaskRow taskRow = (NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0]; assigningUserInfo = UserInfo.getUser(taskRow.User_Username_AssignedBy); taskID = taskRow.Task_UID; workTypeID = taskRow.WorkType_UID; taskName = taskRow.Task_Name; taskDescription = taskRow.Task_Description; takeFiveNeeded = taskRow.Task_TakeFiveNeeded; if (!taskRow.IsTask_StatusNull()) { taskStatus = taskRow.Task_Status; if (!taskRow.IsTask_IncompleteReasonNull()) { taskIncompleteReason = taskRow.Task_IncompleteReason; } } dueDate = taskRow.Task_DueDate; AssignedUserTableAdapter assignedUserAdapter = new AssignedUserTableAdapter(); NuRacingDataSet.AssignedUserDataTable assignedUserTable = assignedUserAdapter.GetDataByTaskID(TaskID); userAssignedInfo = new List<UserInfo>(assignedUserTable.Rows.Count); foreach (NuRacingDataSet.AssignedUserRow assignedUserRow in assignedUserTable.Rows) { userAssignedInfo.Add(UserInfo.getUser(assignedUserRow.User_Username)); } } }
/// <summary> /// Return a TaskInfo object via specified assignedTaskID /// </summary> /// <param name="assignedTaskID"></param> /// <returns></returns> public static TaskInfo getAssignedTask(int assignedTaskID) { AssignedTaskTableAdapter assignedTaskAdapter = new AssignedTaskTableAdapter(); NuRacingDataSet.AssignedTaskDataTable assignedTaskTable = assignedTaskAdapter.GetAssignedTask(assignedTaskID); if (assignedTaskTable.Rows.Count == 0) { throw new ArgumentException("Assigned Task Doesn't Exist"); } return new TaskInfo((NuRacingDataSet.AssignedTaskRow)assignedTaskTable.Rows[0]); }