예제 #1
0
        public ActionResult ShopImage(int id)
        {
            List <ShopImage> model = WorkContext.GetContext().ShopImage.Where(x => x.shopId == id).ToList();

            // return Json(model.ElementAt(0).ShopImage, JsonRequestBehavior.AllowGet);
            return(File(model.FirstOrDefault().shopImage, "image/png"));
        }
예제 #2
0
 public ActionResult GetMoreShops(long ID)
 {
     obj = WorkContext.GetContext().Shops.Where(x => x.ID > ID).Take(6).OrderBy(x => x.ID).ToArray();
     if (obj.Length > 0)
     {
         return(Json(obj, JsonRequestBehavior.AllowGet));
     }
     return(null);
 }
예제 #3
0
        public ActionResult ChooseShop()
        {
            var citynames = WorkContext.GetContext().City.Select(x => new SelectListItem()
            {
                Value = x.ID.ToString(), Text = x.cityName
            }).ToList();

            return(PartialView(citynames));
        }
예제 #4
0
        public ActionResult getShops(string name)
        {
            citylist = WorkContext.GetContext().City.ToList();
            int  myInt       = 0;
            bool isNumerical = int.TryParse(name, out myInt);

            if (isNumerical)
            {
                obj = WorkContext.GetContext().Shops.Where(x => x.Location == myInt).Take(50).OrderBy(x => x.ID).ToArray();
                if (obj != null && obj.Length > 0)
                {
                    return(Json(obj, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(RedirectToAction("ChooseShop", "UserRegister"));
                }
            }
            else
            {
                if (!(name.Trim().Equals("")))
                {
                    string[] info = name.Split(',');

                    foreach (var item in info)
                    {
                        foreach (var item2 in info)
                        {
                            foreach (var cityname in citylist)
                            {
                                if (item.Trim() == cityname.cityName && item2.Trim() == cityname.countryName || item.Trim() == cityname.countryName && item2.Trim() == cityname.cityName ||
                                    item2.Trim() == cityname.cityName)
                                {
                                    Cobj = cityname;
                                }
                            }
                        }
                    }

                    if (Cobj != null)
                    {
                        obj = WorkContext.GetContext().Shops.Where(x => x.Location == Cobj.ID).Take(50).ToArray();
                        return(Json(obj, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            return(RedirectToAction("ChooseShop", "UserRegister"));
        }
예제 #5
0
 public static void GetData()
 {
     shopData = WorkContext.GetContext().Shops.ToList();
 }
예제 #6
0
 public ActionResult ShopRegister()
 {
     return(View(new Tuple <Shop, SHOPKEEPER, List <ShopType> >(null, null, WorkContext.GetContext().Shoptype.ToList())));
 }