Exemple #1
0
        public IActionResult SearchStore(string search, float Latitude, float Longitude)
        {
            String errMessage = "";
            int    errorCode  = 0;

            String[]         ouput = null;
            object[]         value = new object[] { Latitude, Longitude };
            List <DrugStore> lst   = DrupStoreRes.GetAllSearch(value, ref ouput, ref errorCode, ref errMessage);

            ViewBag.search    = search;
            ViewBag.Latitude  = Latitude;
            ViewBag.Longitude = Longitude;
            List <DrugStore> lst1 = DrupStoreRes.GetTopfive();

            ViewData["Topfive"] = lst1;
            ViewData["aaaaaaa"] = lst;
            ViewBag.search      = search;
            int total    = DrupStoreRes.GetAll().Count(i => i.status == 1);
            var pageSize = 5;
            int page;

            page = 1;
            var skip    = pageSize * (page - 1);
            var canPage = skip < total;
            List <DrugStore> lsttest = lst.Skip(skip).Take(pageSize).ToList();

            int pagetotal = FunctionUtility.CalcTotalPage(total, 5);

            ViewBag.page = pagetotal;
            return(View(lsttest));
        }
Exemple #2
0
        public IActionResult SearchStore(int id)
        {
            int total    = DrupStoreRes.GetAll().Count(i => i.status == 1);
            var pageSize = 5;
            int page;

            if (id == null)
            {
                page = 1;
            }
            else
            {
                page = id;
            }

            var skip             = pageSize * (page - 1);
            var canPage          = skip < total;
            List <DrugStore> lst = DrupStoreRes.GetAll().Where(a => a.status == 1).Skip(skip).Take(pageSize).ToList();

            int pagetotal = FunctionUtility.CalcTotalPage(total, 5);

            ViewBag.page = pagetotal;
            List <DrugStore>    lst1     = DrupStoreRes.GetTopfive().ToList();
            List <District>     dis      = DistrictRes.GetAll();
            List <DrugCategory> Category = DrugCategoryRes.GetAll();

            ViewData["Category"] = Category;
            ViewData["Distrist"] = dis;
            ViewData["Topfive"]  = lst1;
            return(View(lst));
        }