Beispiel #1
0
        //
        // GET: /PhongBan/
        public ActionResult Index()
        {
            KeHoachCT keHoachCT = new KeHoachCT();
            PhongBanBussinessService phongBanBussinessService = new PhongBanBussinessService();

            keHoachCT.ListPhongBan         = phongBanBussinessService.GetNguoiDungPhongBan();
            keHoachCT.ListPhongBanDistinct = phongBanBussinessService.GetNguoiDungDistinct(keHoachCT.ListPhongBan);
            ViewBag.TuanLe = this.GetListWeek();
            return(View(keHoachCT));
        }
Beispiel #2
0
        public JsonResult GetJson(JQueryDataTableParamModel param)
        {
            // check login

            int    sortColumnIndex = param.ISortCol_0;
            string order           = param.SSortDir_0;

            string orderBy = string.Empty;

            switch (sortColumnIndex)
            {
            case 0:
                orderBy = "Name";
                break;

            case 1:
                orderBy = "Description";
                break;

            case 2:
                orderBy = "Code";
                break;

            case 3:
                orderBy = "CreateDate";
                break;
            }

            KeHoachCTBussinessService keHoachCTBussinessService = new KeHoachCTBussinessService();
            PhongBanBussinessService  phongBanBussinessService  = new PhongBanBussinessService();

            if (!string.IsNullOrEmpty(param.CanBo) && !"null".Equals(param.CanBo))
            {
                param.CanBo = StringExtensions.GetCanBo(param.CanBo);
            }
            else
            {
                param.CanBo = StringExtensions.GetListPhongBanOrLanhDao(phongBanBussinessService.GetNguoiDungPhongBan());
            }

            if (param.TuanLe == 0)
            {
                param.StartDate = DateTimeExtensions.FirstDateOfWeek(DateTime.Now.Year, DateTimeExtensions.WeekNumber(DateTime.Today), System.Globalization.CultureInfo.CurrentCulture);
                param.EndDate   = param.StartDate.AddDays(6);
            }
            else
            {
                param.StartDate = DateTimeExtensions.FirstDateOfWeek(DateTime.Now.Year, param.TuanLe, System.Globalization.CultureInfo.CurrentCulture);
                param.EndDate   = param.StartDate.AddDays(6);
            }
            List <KeHoachCongTacModel> listKeHoachCT = keHoachCTBussinessService.GetKeHoachCongTac(param, "distict");
            int totalRecords = 0;

            totalRecords = 1;

            // return jon datatable
            return(Json(new
            {
                sEcho = param.SEcho,
                iTotalRecords = totalRecords,
                iTotalDisplayRecords = totalRecords,
                aaData = listKeHoachCT
            }, JsonRequestBehavior.AllowGet));
        }