Beispiel #1
0
        public ActionResult EditMain()
        {
            CommonDataService cds = new CommonDataService();

            CommonModel cm = new CommonModel();

            cm = cds.GenerateCommonModel();
            Session["FaceBook"]      = cm.FaceBook;
            Session["Twitter"]       = cm.Twitter;
            Session["Youtube"]       = cm.Youtube;
            Session["Instagram"]     = cm.Instagram;
            Session["PhoneNumber"]   = cm.PhoneNumber;
            Session["Email"]         = cm.Email;
            Session["ShoppingHours"] = cm.ShoppingHours;
            HomePageHelper homeHelp = new HomePageHelper();
            MainViewModel  mvm      = new MainViewModel();

            try
            {
                mvm = homeHelp.GenerateMainViewModel();
                return(View(mvm));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                homeHelp = null;
                mvm      = null;
            }
        }
Beispiel #2
0
        public ActionResult Index()
        {
            CommonDataService cds = new CommonDataService();

            CommonModel cm = new CommonModel();

            cm = cds.GenerateCommonModel();
            Session["FaceBook"]      = cm.FaceBook;
            Session["Twitter"]       = cm.Twitter;
            Session["Youtube"]       = cm.Youtube;
            Session["Instagram"]     = cm.Instagram;
            Session["PhoneNumber"]   = cm.PhoneNumber;
            Session["Email"]         = cm.Email;
            Session["ShoppingHours"] = cm.ShoppingHours;


            CarouselsHelper carHelp  = new CarouselsHelper();
            HomePageHelper  homeHelp = new HomePageHelper();
            HomeViewModels  hvm      = new HomeViewModels();

            try
            {
                hvm.CarouselsViewModels = carHelp.GenerateCarousels();
                hvm.MainViewModels      = homeHelp.GenerateMainViewModel();
                hvm.FeatureMainModel    = homeHelp.GenerateFeatureMainModel();

                return(View(hvm));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                carHelp  = null;
                homeHelp = null;
                hvm      = null;
            }
        }