Exemple #1
0
        public void ActionDetail(string endCode)
        {
            var entity = ModDuThaoService.Instance.CreateQuery()
                         .Where(o => o.Activity == true && o.Code == endCode)
                         .ToSingle();

            if (entity != null)
            {
                ViewBag.Other = ModDuThaoService.Instance.CreateQuery()
                                .Where(o => o.Activity == true)
                                .Where(o => o.Order < entity.Order)
                                .OrderByDesc(o => o.Order)
                                .Take(PageSize)
                                .ToList();

                ViewBag.Data           = entity;
                SetObject["view.Meta"] = entity;

                MDuThaoModel model = new MDuThaoModel();
                model.PageSize = PageSize;
                string[] str = ((HL.Core.MVC.ViewPage)(ViewPage)).ReturnPath.Replace("%2fPage%2f", "&").Split('&');
                if (str.Length == 2)
                {
                    model.Page = HL.Core.Global.Convert.ToInt(str[1], 0);
                }

                //Lay toan bo gop y cua du thao
                var dbQuery = ModGopYService.Instance.CreateQuery()
                              .Where(o => o.Activity == true)
                              .Where(o => o.DuThaoID == entity.ID)
                              .OrderByDesc(o => o.Order)
                              .Take(PageSize)
                              .Skip(PageSize * model.Page);

                ViewBag.GopY      = dbQuery.ToList();
                model.TotalRecord = dbQuery.TotalRecord;
                model.PageSize    = PageSize;
                ViewBag.Model     = model;
            }
            else
            {
                ViewPage.Error404();
            }
        }
Exemple #2
0
        public void ActionIndex(MDuThaoModel model)
        {
            DateTime d       = DateTime.Now;
            var      dbQuery = ModDuThaoService.Instance.CreateQuery()
                               .Where(o => o.Activity == true && o.FinishDate >= d)
                               .OrderByDesc(o => o.Order);

            ViewBag.Data = dbQuery.ToList();

            var dbQuery2 = ModDuThaoService.Instance.CreateQuery()
                           .Where(o => o.Activity == true && o.FinishDate < d)
                           .OrderByDesc(o => o.Order)
                           .Take(PageSize)
                           .Skip(PageSize * model.Page);

            ViewBag.DataHetHan = dbQuery2.ToList();
            model.TotalRecord  = dbQuery2.TotalRecord;
            model.PageSize     = PageSize;
            ViewBag.Model      = model;
        }
Exemple #3
0
        public void ActionDetail(string endCode)
        {
            var entity = ModVideoService.Instance.CreateQuery()
                         .Where(o => o.Activity == true && o.Code == endCode)
                         //.WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("Video", MenuID, ViewPage.CurrentLang.ID))
                         .ToSingle();

            if (entity != null)
            {
                MDuThaoModel model = new MDuThaoModel();
                model.PageSize = PageSize;
                string[] str = ((HL.Core.MVC.ViewPage)(ViewPage)).ReturnPath.Replace("%2fPage%2f", "&").Split('&');
                if (str.Length == 2)
                {
                    model.Page = HL.Core.Global.Convert.ToInt(str[1], 0);
                }

                var dbQuery = ModVideoService.Instance.CreateQuery()
                              .Where(o => o.Activity == true)
                              .Where(o => o.Order < entity.Order)
                              .WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("Video", MenuID, ViewPage.CurrentLang.ID))
                              .OrderByDesc(o => o.Order)
                              .Take(PageSize)
                              .Skip(PageSize * model.Page);

                ViewBag.Other     = dbQuery.ToList();
                model.TotalRecord = dbQuery.TotalRecord;
                model.PageSize    = PageSize;
                ViewBag.Model     = model;

                ViewBag.Data           = entity;
                SetObject["view.Meta"] = entity;
            }
            else
            {
                ViewPage.Error404();
            }
        }