public ActionResult Read(int page = 1, string find1 = "")
        {
            if (!CheckMemberlogin)
            {
                return RedirectToAction("login", "admin");
            }
            else
            {
                leftModel();

                ViewBag.searchResult = 0;
                ViewBag.search = 1;
                ViewBag.gowhere = Url.Action("Read", "adminBonus");
                if (find1 != "")
                {
                    ViewBag.searchResult = 1;
                    ViewBag.searchText = find1;
                }
                var currentpage = page < 1 ? 1 : page;
                var pagesize = 10;
                var pro = bonusdata.Get().ToList().Where(a => a.wdate.ToString("yyyy-MM-dd hh:mm:ss").Contains(find1));
                var model = new BonusViewModel()
                {
                    Bonus_pagelist = pro.ToPagedList(currentpage, pagesize),
                };

                return View(model);
            }
        }
        public ActionResult Read(int page = 1, string find1 = "")
        {
            if (!CheckMemberlogin)
            {
                return RedirectToAction("login", "admin");
            }
            else
            {
                leftModel();
                var data = orderdata.Get().ToList().Where(a => a.Status == 3);
                int bonusTotal = 0;
                foreach (var i in data)
                {
                    bonusTotal += Convert.ToInt32(Math.Ceiling(i.Total * 0.08));
                }
                bonus.Total = bonusTotal;
                bonus.wdate = DateTime.Now;
                bonus.udate = DateTime.Now;
                bonusdata.Create(bonus);

                ViewBag.searchResult = 0;
                ViewBag.search = 1;
                ViewBag.gowhere = Url.Action("Read", "adminBonus");
                if (find1 != "")
                {
                    ViewBag.searchResult = 1;
                    ViewBag.searchText = find1;
                }
                var currentpage = page < 1 ? 1 : page;
                var pagesize = 10;
                var pro = bonusdata.Get().ToList().Where(a => a.wdate.ToString("yyyy-MM-dd hh:mm:ss").Contains(find1));
                var model = new BonusViewModel()
                {
                    Bonus_pagelist = pro.ToPagedList(currentpage, pagesize),
                };

                return View(model);
            }
        }
        public ActionResult UpdateBonus()
        {
            if (!CheckMemberlogin)
            {
                return RedirectToAction("login", "admin");
            }
            else
            {
                leftModel();

                var bdata = bonusdata.Get().ToList().Count;
                if (bdata <= 0)
                {
                    var data = orderdata.Get().ToList().Where(a => a.Status == 3);
                    int bonusTotal = 0;
                    foreach (var i in data)
                    {
                        bonusTotal += Convert.ToInt32(Math.Ceiling(i.Total * 0.08));
                    }
                    bonus.Total = bonusTotal;
                    bonus.wdate = DateTime.Now;
                    bonus.udate = DateTime.Now;
                    bonusdata.Create(bonus);
                }
                var model = new BonusViewModel()
                {
                    Bonus = bonusdata.Get().ToList().OrderByDescending(a=>a.wdate),
                    bonusmoney = bonusmoneyd.Get().ToList()
                };

                return View(model);
            }
        }