示例#1
0
        public ActionResult Index2(int id)
        {
            //View new
            NewServices newServices = new NewServices();
            newServices.ActiveFlg = Boolean.TrueString;
            newServices.IdFilter = id.ToString();
            NewModels newModel = newServices.select(-1, -1).FirstOrDefault();
            ViewData["new"] = newModel;
            if (newModel != null)
            {
                newServices = new NewServices();
                newModel.TotalView = newModel.TotalView + 1;
                newServices.update(newModel);

                newServices = new NewServices();
                newServices.MenuId = newModel.MenuId.ToString();
                newServices.NewNotIn = newModel.Id.ToString();
                ViewData["listNew"] = newServices.select(1, 7);
            }


            newServices = new NewServices();
            newServices.TypeNew = "3";
            newServices.ActiveFlg = Boolean.TrueString;
            newServices.addOrderBy("entry_datetime", "DESC");
            List<NewModels> lstNewTieuDiem = newServices.select(1, 7);
            ViewData["lstNewTieuDiem"] = lstNewTieuDiem;

            newServices = new NewServices();
            newServices.TypeNew = "2";
            newServices.ActiveFlg = Boolean.TrueString;
            newServices.addOrderBy("entry_datetime", "DESC");
            List<NewModels> lstNewNoiBat = newServices.select(1, 7);
            ViewData["lstNewNoiBat"] = lstNewNoiBat;



            newServices = new NewServices();
            newServices.ActiveFlg = Boolean.TrueString;
            newServices.addOrderBy("total_view", "DESC");
            List<NewModels> lstNewXemNhieu = newServices.select(1, 15);
            ViewData["lstNewXemNhieu"] = lstNewXemNhieu;
            //View Comment
            CommentServices commentSerives = new CommentServices();
            commentSerives.NewsId = id.ToString();
            commentSerives.ActiveFlg = "TRUE";
            List<CommentModels> lstComment = commentSerives.select(-1, -1);
            ViewData["lstComment"] = lstComment;
            return View();
        }
示例#2
0
 public void setSearchFilter(NewServices newServices, NewViewhelper newViewhelper)
 {
     if (!String.IsNullOrWhiteSpace(newViewhelper.KeySearch))
         newServices.KeySearch = newViewhelper.KeySearch;
 }
示例#3
0
        public void SaveCalendar(CalendarViewhelper calendarViewhelper)
        {
            NewServices newServices;
            newServices = new NewServices();
            newServices.ActiveFlg = Boolean.TrueString;
            newServices.addOrderBy("total_view", "DESC");
            List<NewModels> lstNewXemNhieu = newServices.select(1, 15);
            ViewData["lstNewXemNhieu"] = lstNewXemNhieu;

            if (calendarViewhelper.TypeView == 1) {
                calendarViewhelper.FromDate = getFirstDayOfWeek(calendarViewhelper.WeekNum);
                calendarViewhelper.ToDate = calendarViewhelper.FromDate.AddDays(6);

                CalendarServices calendarServices = new CalendarServices();
                calendarServices.FromDate = calendarViewhelper.FromDate.ToString("yyyy-MM-dd");
                calendarServices.ToDate = calendarViewhelper.ToDate.ToString("yyyy-MM-dd");
                List<CalendarModels> lstCalendar = calendarServices.select(-1, -1);
                calendarViewhelper.LstCalendar = lstCalendar;

                calendarServices = new CalendarServices();
                List<WorktimeModels> lstWorktime = calendarServices.selectTime();
                ViewData["lstWorktime"] = lstWorktime;
                ViewData["calendarViewhelper"] = calendarViewhelper;
            }
            else if(calendarViewhelper.TypeView == 2){ 
            
            }
        }