Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Navigation navigation = NavigationRepository.GetSingle(id);

            try
            {
                NavigationRepository.Delete(navigation);
                NavigationRepository.Save();
                if (IsSuperAdmin)
                {
                    return(RedirectToAction("Index", new { storeId = navigation.StoreId }));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Unable to delete:" + ex.StackTrace, navigation);
                //Log the error (uncomment dex variable name and add a line here to write a log.
                ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
            }
            return(View(navigation));
        }
Ejemplo n.º 2
0
        public Navigation GetNavigationBySiteAndSection(string site, string section)
        {
            var navigation = NavigationRepository.GetSingle(x => x.MicroSiteId.Equals(site, StringComparison.CurrentCultureIgnoreCase) &&
                                                            x.Section.Equals(section, StringComparison.CurrentCultureIgnoreCase));

            if (navigation == null)
            {
                return(null);
            }

            navigation.NavigationItems = NavigationItemRepository.GetList(x => x.NavigationId.Equals(navigation.Id));

            return(navigation);
        }
Ejemplo n.º 3
0
        public ActionResult StoreDetails(int id = 0)
        {
            try
            {
                Navigation item = NavigationRepository.GetSingle(id);
                Store      s    = StoreRepository.GetSingle(item.StoreId);
                var        productDetailLink = LinkHelper.GetNavigationLink(item);
                String     detailPage        = String.Format("http://{0}{1}", s.Domain, productDetailLink);

                return(Redirect(detailPage));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                return(new EmptyResult());
            }
        }
Ejemplo n.º 4
0
        //
        // GET: /Navigations/Create

        public ActionResult SaveOrEdit(int id = 0, int selectedStoreId = 0)
        {
            var item = new Navigation();

            item.StoreId = GetStoreId(selectedStoreId);
            if (id == 0)
            {
                item.ParentId    = 0;
                item.CreatedDate = DateTime.Now;
                item.State       = true;
            }
            else
            {
                item             = NavigationRepository.GetSingle(id);
                item.UpdatedDate = DateTime.Now;
            }


            return(View(item));
        }
Ejemplo n.º 5
0
        //
        // GET: /Navigations/Details/5

        public ViewResult Details(int id)
        {
            Navigation navigation = NavigationRepository.GetSingle(id);

            return(View(navigation));
        }
Ejemplo n.º 6
0
        //
        // GET: /Navigations/Delete/5

        public ActionResult Delete(int id)
        {
            Navigation navigation = NavigationRepository.GetSingle(id);

            return(View(navigation));
        }