Exemple #1
0
        public bool CheckShiftLimitations(Shift shift)
        {
            if (shift != null)
            {
                if (department != Department.SALES)
                {
                    if (department == Department.HUMANRESOURCES)
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.HR_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else if (department == Department.DEPOT)
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.DEPOT_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else if (department == Department.PR)
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.PR_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    if (shift.FloorOfStore == "Household appliances")
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.SALES_F1_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else if (shift.FloorOfStore == "Laptops")
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.SALES_F2_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else if (shift.FloorOfStore == "Hardware")
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.SALES_F3_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else if (shift.FloorOfStore == "Music, movies and games")
                    {
                        if (CheckShiftAssignedCount(shift) < limitStorage.SALES_F4_Limit)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            else
            {
                return(false);
            }
        }
Exemple #2
0
 public bool CheckShiftBusyness(int shiftNumber, DateTime day)
 {
     if (shiftNumber == 4)
     {
         Shift shift = FindShift(day, 1);
         if (CheckShiftLimitations(shift))
         {
             Shift shift2 = FindShift(day, 2);
             if (CheckShiftLimitations(shift2))
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else if (shiftNumber == 5)
     {
         Shift shift = FindShift(day, 2);
         if (CheckShiftLimitations(shift))
         {
             Shift shift2 = FindShift(day, 3);
             if (CheckShiftLimitations(shift2))
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else if (shiftNumber == 6)
     {
         Shift shift = FindShift(day, 1);
         if (CheckShiftLimitations(shift))
         {
             Shift shift2 = FindShift(day, 2);
             if (CheckShiftLimitations(shift2))
             {
                 Shift shift3 = FindShift(day, 3);
                 if (CheckShiftLimitations(shift3))
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         Shift shift = FindShift(day, shiftNumber);
         if (CheckShiftLimitations(shift))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }