예제 #1
0
        public ActionResult Search(string[] lanhDao, int tuanLe, string search)
        {
            KeHoachCT keHoachCT = new KeHoachCT();
            PhongBanBussinessService phongBanBussinessService = new PhongBanBussinessService();

            keHoachCT.ListPhongBan = phongBanBussinessService.GetNguoiDungLanhDao();
            ViewBag.TuanLe         = this.GetListWeek();
            ViewBag.KeHoachCT      = keHoachCT.ListPhongBan;

            KeHoachCTBussinessService ketHoachCTBussinessService = new KeHoachCTBussinessService();
            JQueryDataTableParamModel param = new JQueryDataTableParamModel();

            param.CanBo = "'" + CurrentUser.Name + "'";

            if (lanhDao == null || string.IsNullOrEmpty(lanhDao[0]))
            {
                param.CanBo = StringExtensions.GetListPhongBanOrLanhDao(keHoachCT.ListPhongBan);
            }
            else
            {
                param.CanBo = StringExtensions.GetStringListUser(lanhDao);
            }
            param.StartDate = DateTimeExtensions.FirstDateOfWeek(DateTime.Now.Year, tuanLe, System.Globalization.CultureInfo.CurrentCulture);
            param.EndDate   = param.StartDate.AddDays(6);
            param.sSearch   = search;
            //Print day of week
            GetDayOfWeek(param.StartDate);
            List <KeHoachCongTacModel> listKeHoachCongTacModel = ketHoachCTBussinessService.GetKeHoachCongTac(param);

            return(View(listKeHoachCongTacModel));
        }
예제 #2
0
        //
        // GET: /CTCaNhan/
        public ActionResult Index()
        {
            KeHoachCT keHoachCT = new KeHoachCT();
            PhongBanBussinessService phongBanBussinessService = new PhongBanBussinessService();

            keHoachCT.ListPhongBan         = phongBanBussinessService.GetNguoiDungLanhDao();
            keHoachCT.ListPhongBanDistinct = phongBanBussinessService.GetNguoiDungDistinct(keHoachCT.ListPhongBan);
            ViewBag.TuanLe = this.GetListWeek();
            return(View(keHoachCT));
        }
예제 #3
0
        public ActionResult Index()
        {
            KeHoachCT keHoachCT = new KeHoachCT();
            PhongBanBussinessService phongBanBussinessService = new PhongBanBussinessService();

            keHoachCT.ListPhongBan = phongBanBussinessService.GetNguoiDungLanhDao();
            ViewBag.TuanLe         = this.GetListWeek();
            ViewBag.LanhDao        = keHoachCT.ListPhongBan;

            KeHoachCTBussinessService ketHoachCTBussinessService = new KeHoachCTBussinessService();
            JQueryDataTableParamModel param = new JQueryDataTableParamModel();

            param.CanBo = StringExtensions.GetVariableSql(CurrentUser.Name);

            param.CanBo     = StringExtensions.GetListPhongBanOrLanhDao(keHoachCT.ListPhongBan);
            param.StartDate = DateTimeExtensions.FirstDateOfWeek(DateTime.Now.Year, DateTimeExtensions.WeekNumber(DateTime.Today), System.Globalization.CultureInfo.CurrentCulture);
            param.EndDate   = param.StartDate.AddDays(6);
            //Print day of week
            GetDayOfWeek(param.StartDate);
            return(View(ketHoachCTBussinessService.GetKeHoachCongTac(param, "distinct")));
        }
예제 #4
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.GetNguoiDungLanhDao());
            }

            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));
        }