Exemple #1
0
        public Model.HomeDOT GetHomeData()
        {
            try
            {
                var data   = new Model.HomeDOT();
                var slides = this.GetList(m => m.SlideType == "HOME").ToList();
                data.Sliders = new List <vw_SlideDetail>();
                data.Sliders = slides;

                var textDataBO = new TextDataBO();

                data.Introduction = new TextData();
                data.Introduction = textDataBO.GetList(m => m.TextID == "WELCOME_HOME").First();

                return(data);
            }
            catch
            {
                return(null);
            }
        }
        public JsonResult InitialData()
        {
            try
            {
                string jsonSlide = string.Empty, jsonIntroduction = string.Empty, jsonTours = string.Empty, jsonHome = string.Empty;
                var    slides = this.homeBO.GetList(m => m.SlideType == "");
                jsonSlide = new JavaScriptSerializer().Serialize(slides);

                var textDataBO    = new TextDataBO();
                var introductions = textDataBO.GetByID("WELCOME_HOME");
                jsonIntroduction = new JavaScriptSerializer().Serialize(introductions);

                var tourBO = new TourBO();
                var tours  = tourBO.GetHomeTour();
                jsonHome = new JavaScriptSerializer().Serialize(tours);

                return(Json(new { isOk = true, slides = jsonSlide, introduction = jsonIntroduction, tours = jsonHome }, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(new { isOk = false }, JsonRequestBehavior.AllowGet));
            }
        }
        public JsonResult InitialData()
        {
            try
                {
                    string jsonSlide = string.Empty, jsonIntroduction = string.Empty, jsonTours = string.Empty, jsonHome = string.Empty;
                    var slides = this.homeBO.GetList(m => m.SlideType == "");
                    jsonSlide = new JavaScriptSerializer().Serialize(slides);

                    var textDataBO = new TextDataBO();
                    var introductions = textDataBO.GetByID("WELCOME_HOME");
                    jsonIntroduction = new JavaScriptSerializer().Serialize(introductions);

                    var tourBO = new TourBO();
                    var tours = tourBO.GetHomeTour();
                    jsonHome = new JavaScriptSerializer().Serialize(tours);

                    return Json(new { isOk = true, slides = jsonSlide, introduction = jsonIntroduction, tours = jsonHome }, JsonRequestBehavior.AllowGet);

                }
                catch
                {
                    return Json(new { isOk = false }, JsonRequestBehavior.AllowGet);
                }
        }