public object Do_GetShopInfoHead(BaseApi baseApi) { GetShopInfoParam getShopInfoParam = JsonConvert.DeserializeObject <GetShopInfoParam>(baseApi.param.ToString()); if (getShopInfoParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } Utils.ClearCache(); ShopDao shopDao = new ShopDao(); ShopInfoHead shopInfoHead = Utils.GetCache <ShopInfoHead>(getShopInfoParam); if (shopInfoHead == null) { shopInfoHead = shopDao.GetShopInfoHead(getShopInfoParam.shopId); if (shopInfoHead == null) { throw new ApiException(CodeMessage.InvalidShopId, "InvalidShopId"); } else { shopInfoHead.Unique = getShopInfoParam.GetUnique(); Utils.SetCache(shopInfoHead); } } return(shopInfoHead); }
// GET: Admin/Shop public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new ShopDao(); var model = dao.ListAllPaging(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Index() { if (!verifica_acesso("Shop", "Visualizar")) { return(RedirectToAction("Index", "Login")); } ViewBag.pagina = "Shop"; ShopDao _ShopDao = new ShopDao(); IList <Shop> _Shop = _ShopDao.Listar_Shop_dt(); return(View(_Shop)); }
public ActionResult Edit(Shop Shop) { if (ModelState.IsValid) { var dao = new ShopDao(); var result = dao.Update(Shop); if (result) { return(RedirectToAction("Index", "Shop")); } else { ModelState.AddModelError("", "Modify Shop successfully"); } } return(View("Index")); }
public ActionResult Create(Shop Shop) { if (ModelState.IsValid) { var dao = new ShopDao(); var id = dao.Insert(Shop); if (id > 0) { return(RedirectToAction("Index", "Shop")); } else { ModelState.AddModelError("", "Add Shop successfully"); } } return(View("Index")); }
public object Do_GetShopMsg(BaseApi baseApi) { GetShopParam getShopParam = JsonConvert.DeserializeObject <GetShopParam>(baseApi.param.ToString()); if (getShopParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } ShopDao shopDao = new ShopDao(); ShopMsg shopMsg = shopDao.GetShopMsg(getShopParam.shopId); if (shopMsg == null) { throw new ApiException(CodeMessage.InvalidShopId, "InvalidShopId"); } return(shopMsg); }
public object Do_GetShopGoodsDetails(BaseApi baseApi) { GetShopGoodsDetailsParam getShopGoodsDetailsParam = JsonConvert.DeserializeObject <GetShopGoodsDetailsParam>(baseApi.param.ToString()); if (getShopGoodsDetailsParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } ShopDao shopDao = new ShopDao(); ShopGoodsDetails shopGoodsDetails = shopDao.GetShopGoodsDetails(getShopGoodsDetailsParam.barcode); if (shopGoodsDetails == null) { throw new ApiException(CodeMessage.InvalidShopId, "InvalidShopId"); } return(shopGoodsDetails); }
public ActionResult Edit(int id) { var Shop = new ShopDao().ViewDetail(id); return(View(Shop)); }
public ShopService() { dao = new ShopDao(); }