Exemple #1
0
        public static string ShowShiftInfo(Shift shift, string title, SimDescription cheff, List <PhoneSimPicker.SimPickerInfo> waiters)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(title);
            sb.Append("\n");
            sb.Append(shift.StarWork + ":00 - " + shift.EndWork + ":00");
            sb.Append("\n");
            sb.Append("Chef: ");

            //Check if the cheff is valid
            if (cheff != null)
            {
                if (CheckIfValidEmployee(cheff.SimDescriptionId))
                {
                    sb.Append(cheff.FullName);
                    sb.Append(": " + shift.Cheff.Wage + "§/h");
                }
                else
                {
                    sb.Append("Selected chef is not valid.\n");
                    sb.Append("Please select a new chef");
                }
            }
            else
            {
                //If cheff null, re-check from shift info
                if (shift.Cheff == null)
                {
                    sb.Append("No chef selected");
                }
                else
                {
                    if (CheckIfValidEmployee(shift.Cheff.DescriptionId))
                    {
                        sb.Append("Selected chef is valid");
                    }
                    else
                    {
                        sb.Append("Selected chef is not valid");
                    }
                }
            }

            sb.Append("\n");

            int waiterWage = -1;

            if (shift.Waiters != null && shift.Waiters.Count > 0)
            {
                waiterWage = shift.Waiters[0].Wage;
            }

            if (waiters != null && waiters.Count > 0)
            {
                sb.Append("Waiters:\n");
                foreach (var w in waiters)
                {
                    sb.Append(((SimDescription)w.SimDescription).FullName);

                    if (waiterWage > -1)
                    {
                        sb.Append(": ");
                        sb.Append(waiterWage);
                        sb.Append("§/h");
                    }

                    sb.Append("\n");
                }
            }
            else
            {
                if (shift.Waiters != null && shift.Waiters.Count > 0)
                {
                    sb.Append("Waiters count:");
                    sb.Append(shift.Waiters.Count);
                }
                else
                {
                    sb.Append("No waiters selected.");
                }
            }

            return(sb.ToString());
        }
Exemple #2
0
        public static string ShowShiftInfo(Shift shift, string title, SimDescription cheff, List<PhoneSimPicker.SimPickerInfo> waiters)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(title);
            sb.Append("\n");
            sb.Append(shift.StarWork + ":00 - " + shift.EndWork + ":00");
            sb.Append("\n");
            sb.Append("Chef: ");

            //Check if the cheff is valid            
            if (cheff != null)
            {
                if (CheckIfValidEmployee(cheff.SimDescriptionId))
                {
                    sb.Append(cheff.FullName);
                    sb.Append(": " + shift.Cheff.Wage + "§/h");
                }
                else
                {
                    sb.Append("Selected chef is not valid.\n");
                    sb.Append("Please select a new chef");
                }
            }
            else
            {
                //If cheff null, re-check from shift info
                if (shift.Cheff == null)
                    sb.Append("No chef selected");
                else
                {
                    if (CheckIfValidEmployee(shift.Cheff.DescriptionId))
                        sb.Append("Selected chef is valid");
                    else
                        sb.Append("Selected chef is not valid");
                }
            }

            sb.Append("\n");

            int waiterWage = -1;
            if (shift.Waiters != null && shift.Waiters.Count > 0)
                waiterWage = shift.Waiters[0].Wage;

            if (waiters != null && waiters.Count > 0)
            {
                sb.Append("Waiters:\n");
                foreach (var w in waiters)
                {
                    sb.Append(((SimDescription)w.SimDescription).FullName);

                    if (waiterWage > -1)
                    {
                        sb.Append(": ");
                        sb.Append(waiterWage);
                        sb.Append("§/h");
                    }

                    sb.Append("\n");

                }
            }
            else
            {
                if (shift.Waiters != null && shift.Waiters.Count > 0)
                {
                    sb.Append("Waiters count:");
                    sb.Append(shift.Waiters.Count);
                }
                else
                    sb.Append("No waiters selected.");
            }

            return sb.ToString();
        }