Esempio n. 1
0
        public bool AddedProdId(int id)
        {
            IProductRepository r = new ProductRepository();

            var added = GetCart().Lines.Select(x => x.Product.ID).Contains(id);
            return added;
        }
Esempio n. 2
0
        //public IConfigRepository config { get { return _conf; } private set { _conf = value; } }
        public async Task<ActionResult> Index(string userid = null, string codeAuth = null, string credentialToken = null, int style = 0)
        {

            IConfigRepository _conf = new ConfigRepository();
            IMenuRepository _mrepo = new MenuRepository();
            IProductRepository _mprod = new ProductRepository();
            ViewBag.FirstCat = _mprod.Products.Any() ? _mprod.Products.First().ID : 0;
            if (_conf.Options().SelectedIsOnlineID)
            {
                throw new HttpException(410, "Offline");
            }
            var user = await UserManager.FindByIdAsync(userid);            
            ViewBag.ConfirmEmail = userid != null && !User.Identity.IsAuthenticated && codeAuth == null ? true : false;
            ViewBag.SetPassword = userid != null && codeAuth != null ? true : false;
            ViewBag.UserName = userid != null && !User.Identity.IsAuthenticated ? user.UserName : "";
            ViewBag.UserId = userid != null && codeAuth != null ? userid : "";
            ViewBag.Code = codeAuth != null && userid != null ? codeAuth : "";
            ViewBag.Style = style;
            ViewBag.Token = credentialToken;
            ViewBag.Titlee = _conf.Options().SiteName;
            var result = _mrepo.Menues.FirstOrDefault(x => x.Url == "Home");
            return View(result);
        }
Esempio n. 3
0
 public static bool CheckPreview(int pimgid)
 {
     IProductRepository rep = new ProductRepository();
     var check = rep.CheckPreview(pimgid);
     return check;
 }