public void GetNumber() { EmployeeHotel user = new EmployeeHotel(); WorkShift w = new WorkShift(); double manager = Convert.ToDouble(user.GetNumberOfManager()); Getnum.Text = "Manager: " + manager.ToString(); }
public void ReturnRoleID() { DataTable table = this.ShowId(); EmployeeHotel employee = new EmployeeHotel(); Total = Convert.ToInt32(employee.GetNumberJanitor()) + Convert.ToInt32(employee.GetNumberOfManager()) + Convert.ToInt32(employee.GetNumberReceptionist()); for (int i = 0; i < Total; i++) { arrayRole[i] = table.Rows[i]["role"].ToString().Trim(); arrayID[i] = Convert.ToInt32(table.Rows[i]["id"].ToString().Trim()); } }
public void ReLoad() { DataTable table = this.ShowId(); EmployeeHotel employee = new EmployeeHotel(); Random random = new Random(); Total = Convert.ToInt32(employee.GetNumberJanitor()) + Convert.ToInt32(employee.GetNumberOfManager()) + Convert.ToInt32(employee.GetNumberReceptionist()); this.ReturnRoleID(); for (int i = 0; i < Total; i++) { int mon = random.Next(1, 4); int tue = random.Next(1, 4); int wed = random.Next(1, 4); int thu = random.Next(1, 4); int fri = random.Next(1, 4); this.UppdateShiftColumn1(arrayID[i], mon); this.UppdateShiftColumn2(arrayID[i], tue); this.UppdateShiftColumn3(arrayID[i], wed); this.UppdateShiftColumn4(arrayID[i], thu); this.UppdateShiftColumn5(arrayID[i], fri); } }
public void GetShift() { this.ReturnRoleID(); EmployeeHotel employee = new EmployeeHotel(); int manager = Convert.ToInt32(employee.GetNumberOfManager()); int receptionist = Convert.ToInt32(employee.GetNumberReceptionist()); int Janitor = Convert.ToInt32(employee.GetNumberJanitor()); //Monday for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Manager" && manager > 0) { Check = 0; int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn1(arrayID[i], 1); } else { this.UppdateShiftColumn1(arrayID[i], s1); } Check = 1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Receptionist" && receptionist > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn1(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Janitor" && Janitor > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn1(arrayID[i], s1); } Check = s1; } } //Tuesday for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Manager" && manager > 0) { Check = 0; int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn2(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Receptionist" && receptionist > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn2(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Janitor" && Janitor > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn2(arrayID[i], s1); } Check = s1; } } //Wednesday for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Manager" && manager > 0) { Check = 0; int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn3(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Receptionist" && receptionist > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn3(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Janitor" && Janitor > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn3(arrayID[i], s1); } Check = s1; } } //Thursday for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Manager" && manager > 0) { Check = 0; int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn4(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Receptionist" && receptionist > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn4(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Janitor" && Janitor > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn4(arrayID[i], s1); } Check = s1; } } //Friday for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Manager" && manager > 0) { Check = 0; int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn5(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Receptionist" && receptionist > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn5(arrayID[i], s1); } Check = s1; } } for (int i = 0; i < Total; i++) { if (arrayRole[i] == "Janitor" && Janitor > 0) { int s1 = random.Next(1, 4); if (Check != s1) { this.UppdateShiftColumn5(arrayID[i], s1); } Check = s1; } } //for (int i = 0; i < Total; i++) //{ // int mon = random.Next(1, 4); // int tue = random.Next(1, 4); // int wed = random.Next(1, 4); // int thu = random.Next(1, 4); // int fri = random.Next(1, 4); // int sat = random.Next(1, 4); // int sun = random.Next(1, 4); // this.UppdateShift(arrayID[i], mon, tue, wed, thu, fri, sat, sun); //} }