public void displayTaskData(string uniquePhotoName) { DateTime today = DateTime.Today; string sentence = today.ToShortDateString(); string sentence2; String[] breakApart = sentence.Split('/'); String[] dateFromDB; int dbDay, dbMonth, dbYear; int tDay, tMonth, tYear; int dayCalcDB = 0, dayCalcToday = 0; TASK foundTask = new TASK(); PERSONTASK personTaskForAssignees = new PERSONTASK(); DataTable taskInfoDT; DataTable taskAssigneesDT; taskInfoDT = database.GetData(foundTask.generateTaskQuery(uniquePhotoName)); this.txtWarning.text = ""; foreach (DataRow row in taskInfoDT.Rows) { this.txtTaskCode.text = row["TaskCode"].ToString(); this.txtTaskName.text = row["TaskName"].ToString(); this.txtStatus.text = row["TaskProgress"].ToString(); this.txtTaskDefinition.text = row["TaskDetail"].ToString(); this.txtPlannedStartDate.text = row["PlannedStartDate"].ToString(); this.txtStartDate.text = row["StartDate"].ToString(); this.txtEndDate.text = row["EndDate"].ToString(); this.TFSLink = row["TFSLink"].ToString(); sentence2 = row["PlannedStartDate"].ToString(); dateFromDB = sentence2.Split('-'); dbDay = int.Parse(dateFromDB[2]); dbMonth = int.Parse(dateFromDB[1]); dbYear = int.Parse(dateFromDB[0]); dayCalcDB = dbDay + dbMonth * 30; tDay = int.Parse(breakApart[2]); tMonth = int.Parse(breakApart[1]); tYear = int.Parse(breakApart[0]); dayCalcToday = tDay + tMonth * 30; if (this.txtStatus.text.Equals("To Do") && dayCalcToday > dayCalcDB) { this.txtWarning.text = "Planned start date is passed!"; } else { this.txtWarning.text = ""; } } taskAssigneesDT = database.GetData(personTaskForAssignees.generatePersonTaskQueryAccordingToTask(this.taskIDForMeetingMode)); this.txtAssignees.text = ""; foreach (DataRow row in taskAssigneesDT.Rows) { this.txtAssignees.text += row["Name"].ToString(); this.txtAssignees.text += " "; this.txtAssignees.text += row["Surname"].ToString(); this.txtAssignees.text += "\n"; } }
public void displayOperationData(int personID) { string loginEmail = Login.getMail(); string loginPassword = Login.getPassword(); PERSON myPerson = new PERSON(); DataTable personInfo; personInfo = database.GetData(myPerson.generatePersonQuery(loginEmail, loginPassword)); foreach (DataRow row in personInfo.Rows) { this.loginId = Int32.Parse(row["PersonID"].ToString()); } PERSONTASK myPersonTask = new PERSONTASK(); DataTable currentTasksDT; DataTable currentTasksDT2Workload; DataTable sharedTasksDT; int numOfFeats; int numOfBugs; int numOfImp; int totalWorkload; currentTasksDT = database.GetData(myPersonTask.generatePersonTaskQueryAccordingToPerson(personID)); this.txtCurrentTasks.text = ""; numOfFeats = 0; numOfBugs = 0; numOfImp = 0; foreach (DataRow row in currentTasksDT.Rows) { if (row["TaskType"].ToString().Equals("1")) { numOfFeats++; } else if (row["TaskType"].ToString().Equals("2")) { numOfBugs++; } else if (row["TaskType"].ToString().Equals("3")) { numOfImp++; } this.txtCurrentTasks.text += row["TaskName"].ToString(); this.txtCurrentTasks.text += "\n"; } currentTasksDT2Workload = database.GetData(myPersonTask.generatePersonTaskQueryAccordingToPersonForWorkload(personID)); totalWorkload = 0; foreach (DataRow row in currentTasksDT2Workload.Rows) { totalWorkload += int.Parse(row["Workload"].ToString()); } this.txtNumOfFeats.text = numOfFeats.ToString(); this.txtNumOfBugs.text = numOfBugs.ToString(); this.txtNumOfImps.text = numOfImp.ToString(); this.txtTotalWorkload.text = totalWorkload.ToString() + " hours"; sharedTasksDT = database.GetData(myPersonTask.generatePersonTaskQueryAccordingToTaskSharing(loginId, personID)); this.txtSharedTasks.text = ""; foreach (DataRow row in sharedTasksDT.Rows) { this.txtSharedTasks.text += row["TaskName"].ToString(); this.txtSharedTasks.text += "\n"; } }