Exemple #1
0
        public void InitializeTasksForToday(Context context)
        {
            TaskCardSimpleList = new List <TaskCardSimple>();

            int timeImageId      = Resource.Drawable.stopwatch;
            int cleannessImageId = Resource.Drawable.performance;

            CleaningTaskForToday cleaningTaskForToday = new CleaningTaskForToday(context);

            cleaningTaskForToday.CalculateTasksForToday();
            cleaningTaskForToday.UpdateCleannessToZero();

            if (cleaningTaskForToday.GetTaskIdsForToday() != null)
            {
                for (int i = 0; i < cleaningTaskForToday.GetTaskIdsForToday().Length; i++)
                {
                    bool switchOn = false;
                    if (cleaningTaskForToday.GetTasksCleannessForToday()[i] == 1)
                    {
                        switchOn = true;
                    }

                    TaskCardSimpleList.Add(new TaskCardSimple(cleaningTaskForToday.GetTaskIdsForToday()[i],
                                                              cleaningTaskForToday.GetTaskTitlesForToday()[i], timeImageId,
                                                              cleaningTaskForToday.GetTasksTimeOfCleaningForToday()[i].ToString() + " " + context.GetString(Resource.String.minute_text),
                                                              cleannessImageId,
                                                              cleaningTaskForToday.GetTasksCleannessInPercentagesForToday()[i].ToString() + "%",
                                                              cleaningTaskForToday.GetTasksCleannessForToday()[i],
                                                              RoomDatabaseManagement.GetRoomTitle(context, cleaningTaskForToday.GetRoomIdsForToday()[i]),
                                                              switchOn, context.GetString(Resource.String.reschedule_for_the_next_day)));
                }
            }
        }
Exemple #2
0
        public void InitializeTasksForNextDay(Context context)
        {
            TaskCardSimpleList = new List <TaskCardSimple>();

            int timeImageId      = Resource.Drawable.stopwatch;
            int cleannessImageId = Resource.Drawable.performance;

            CleaningTaskForNextDay cleaningTaskForNextDay = new CleaningTaskForNextDay(context);

            cleaningTaskForNextDay.CalculateTasksForNextDay();

            DateTime dateTimeOfTasksForNextDay = cleaningTaskForNextDay.DateTimeOfTasksForNextDay;

            string dateString = context.GetString(Resource.String.today_text) + ": " +
                                DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() +
                                "/" + DateTime.Now.Day.ToString() + "\r\n" +
                                context.GetString(Resource.String.date_text) + ": " +
                                dateTimeOfTasksForNextDay.Year.ToString() + "/" + dateTimeOfTasksForNextDay.Month.ToString() +
                                "/" + dateTimeOfTasksForNextDay.Day.ToString();

            if (cleaningTaskForNextDay.GetTaskIdsForNextDay() != null)
            {
                for (int i = 0; i < cleaningTaskForNextDay.GetTaskIdsForNextDay().Length; i++)
                {
                    bool switchOn = false;
                    if (cleaningTaskForNextDay.GetTasksCleannessForNextDay()[i] == 1)
                    {
                        switchOn = true;
                    }

                    TaskCardSimpleList.Add(new TaskCardSimple(cleaningTaskForNextDay.GetTaskIdsForNextDay()[i],
                                                              cleaningTaskForNextDay.GetTaskTitlesForNextDay()[i], timeImageId,
                                                              cleaningTaskForNextDay.GetTasksTimeOfCleaningForNextDay()[i].ToString() + " " + context.GetString(Resource.String.minute_text),
                                                              cleannessImageId,
                                                              cleaningTaskForNextDay.GetTasksCleannessInPercentagesForNextDay()[i].ToString() + "%",
                                                              cleaningTaskForNextDay.GetTasksCleannessForNextDay()[i],
                                                              RoomDatabaseManagement.GetRoomTitle(context, cleaningTaskForNextDay.GetRoomIdsForNextDay()[i]),
                                                              switchOn, dateString,
                                                              context.GetString(Resource.String.transfer_task_to_today_task)));
                }
            }
        }