public async Task <IActionResult> DailyScheduler(string id)
        {
            List <string>   Checkfoodlist     = new List <string>();
            List <string>   combinedlist      = new List <string>();
            List <string>   timeresult        = new List <string>();
            List <string>   combinedlistsplit = new List <string>();
            List <DateTime> savetime          = new List <DateTime>();

            IdentityRole role = await roleManager.FindByIdAsync(id);

            List <AppUser> members    = new List <AppUser>();
            List <AppUser> nonMembers = new List <AppUser>();
            AppUser        user       = await _userManager.FindByNameAsync(User.Identity.Name);

            var checkExistUserInUserPSIDb = await _context.UserPlScheduler.Select(x => x.UserId).ToListAsync();

            if (checkExistUserInUserPSIDb.Contains(user.Id) == false)
            {
                _toastNotification.AddErrorToastMessage("Time for when sheduling to start should be selected first");
                return(RedirectToAction("Create", "FoodSchedulerTimeStarts"));
            }
            var gettingfoodfromlightfood = await _context.UserLightFoodSelection.Where(x => x.UserId == user.Id).Select(x => x.Id).ToListAsync();

            var gettingfoodfromgraindish = await _context.UserGrainDishSelection.Where(x => x.UserId == user.Id).Select(x => x.Id).ToListAsync();

            var gettingfoodfromswallow = await _context.UserSwallowSelection.Where(x => x.UserId == user.Id).Select(x => x.Id).ToListAsync();


            if (gettingfoodfromgraindish.Count < 4)
            {
                _toastNotification.AddErrorToastMessage("The selected grain dishes should not be less than 4");
                return(View());
            }
            if (gettingfoodfromlightfood.Count < 4)
            {
                _toastNotification.AddErrorToastMessage("The selected light food should not be less than 4");
                return(View());
            }
            if (gettingfoodfromswallow.Count < 4)
            {
                _toastNotification.AddErrorToastMessage("The selected swallow should not be less than 4");
                return(View());
            }
            var randomise = await _scheduleManager.OrderOne(user.Id);

            combinedlist = randomise;
            var comperuser = await _context.UserPlScheduler.Where(x => x.UserId == user.Id).Select(x => x.FoodList).ToListAsync();

            if (comperuser[0] == null)
            {
                string combinedFoodList =
                    (combinedlist[0] + "#" + combinedlist[1] + "#" + combinedlist[2] + "#" + combinedlist[3] + "#" + combinedlist[4] + "#" + combinedlist[5] + "#" + combinedlist[6]);

                //AppUser user = await _userManager.FindByNameAsync(User.Identity.Name);
                var starttime = await _context.FoodSchedulerTimeStarts.ToListAsync();

                foreach (var item in starttime)
                {
                    savetime.Add(item.Name.Date);
                }
                DateTime t        = savetime[0];
                var      FoodList = new UserPlSchedulers
                {
                    FoodList  = combinedFoodList,
                    UserId    = user.Id,
                    StartTime = t
                };
                var createFoodList = await _scheduleoperation.CreateFood(FoodList, user.Id);
            }



            AppUser users = await _userManager.FindByNameAsync(User.Identity.Name);



            var newlist = await _scheduleManager.SplitFoodList(users.Id);

            combinedlistsplit = newlist;



            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
            {
                var Monday = combinedlistsplit[0].Split(new char[] { '|' });
                ViewBag.dayofweek = "Monday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
            {
                var Monday = combinedlistsplit[1].Split(new char[] { '|' });
                ViewBag.dayofweek = "Tuesday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
            {
                var Monday = combinedlistsplit[2].Split(new char[] { '|' });
                ViewBag.dayofweek = "Wednesday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
            {
                var Monday = combinedlistsplit[3].Split(new char[] { '|' });
                ViewBag.dayofweek = "Thursday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
            {
                var Monday = combinedlistsplit[4].Split(new char[] { '|' });
                ViewBag.dayofweek = "Friday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                var Monday = combinedlistsplit[5].Split(new char[] { '|' });
                ViewBag.dayofweek = "Saturday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                var Monday = combinedlistsplit[6].Split(new char[] { '|' });
                ViewBag.dayofweek = "Sunday";
                ViewBag.Monday0   = Monday[0]; ViewBag.Monday1 = Monday[1]; ViewBag.Monday2 = Monday[2];
            }



            return(View());
        }