Beispiel #1
0
        public ActionResult Index()
        {
            shAboutService _about = new shAboutService();
            shAboutu       about  = _about.DanhSachAbout().OrderBy(x => x.AboutId).FirstOrDefault();

            IEnumerable <shAboutu> dsChildAbout = _about.DanhSachAbout_ByParentId(about.AboutGuid).OrderBy(x => x.AboutId);

            ViewBag.dsChildAbout = dsChildAbout;
            return(View(about));
        }
Beispiel #2
0
        public ActionResult DsChildAbout(string AboutGuid)
        {
            shAboutService         _about  = new shAboutService();
            IEnumerable <shAboutu> dsAbout = _about.DanhSachAbout_ByParentId(AboutGuid).OrderBy(x => x.AboutId);

            if (dsAbout == null)
            {
                dsAbout = new List <shAboutu>();
            }
            return(PartialView("DsChildAbout", dsAbout));
        }
Beispiel #3
0
        public ActionResult MenuLeft()
        {
            shAboutService _about = new shAboutService();

            IEnumerable <shAboutu> dsAbout = _about.DanhSachAbout();

            if (dsAbout == null)
            {
                dsAbout = new List <shAboutu>();
            }

            return(PartialView("MenuLeft", dsAbout));
        }
Beispiel #4
0
        public PartialViewResult ListAbout(int?page)
        {
            int pageCurrent = 1;

            if (page.HasValue)
            {
                pageCurrent = page.Value;
            }

            shAboutService        _about  = new shAboutService();
            IPagedList <shAboutu> dsAbout = _about.DanhSachAbout_PhanTrang(pageCurrent, Config.PAGE_SIZE_10);

            ViewBag.ListAbout = dsAbout;
            return(PartialView("ListAbout", dsAbout));
        }
Beispiel #5
0
        public ActionResult Details(int?id)
        {
            shAboutService _about = new shAboutService();
            shAboutu       about  = new shAboutu();

            if (id.HasValue)
            {
                about = _about.FindList().Where(x => x.AboutId == id).FirstOrDefault();
            }

            IEnumerable <shAboutu> dsChild = _about.DanhSachAbout_ByParentId(about.AboutGuid);

            ViewBag.dsChild = dsChild;

            return(View(about));
        }
Beispiel #6
0
        public ActionResult Create(string id)
        {
            ViewBag.BannerGuid = id;
            shAboutService _about = new shAboutService();
            shAboutu       about  = new shAboutu();

            if (!string.IsNullOrWhiteSpace(id))
            {
                about = _about.FindByKey(id);
            }

            IEnumerable <shAboutu> dsAbout = _about.DanhSachAbout();

            ViewBag.Parent = new SelectList(dsAbout, "AboutGuid", "AboutTitle", about.ParentId);

            return(View(about));
        }
Beispiel #7
0
        public ActionResult Create(string AboutGuid, string AboutTitle, string AboutName,
                                   string AboutContent, int?Year, string Parent, string Sign,
                                   string ImageUrl, int?SortOrder,
                                   bool?Status, string Url)
        {
            using (var context = new ShopOnlineDb())
            {
                using (var dbContextTransaction = context.Database.BeginTransaction())
                {
                    try
                    {
                        shAboutService _about = new shAboutService();
                        shAboutu       about  = new shAboutu();

                        about = _about.Insert_About(
                            AboutGuid,
                            null,
                            AboutTitle,
                            AboutName,
                            AboutContent,
                            Year,
                            Sign,
                            ImageUrl,
                            Parent,
                            SortOrder,
                            Status,
                            DateTime.Now);

                        dbContextTransaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        dbContextTransaction.Rollback();
                    }
                }
            }



            return(RedirectToAction("Index"));
        }