Пример #1
0
 public ActionResult ExportHDTJobList([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
 {
     return ExportAllAndReturn<Hre_HDTJobEntity, Hre_HDTJobModel, Hre_HDTJobSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_HDTJob);
 }
Пример #2
0
        public ActionResult GetHDTJobList([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
        {
            var actionServices = new ActionService(UserLogin);
            string status = string.Empty;
            List<object> lstObjSearch = new List<object>();
            lstObjSearch.Add(model.ProfileName);
            lstObjSearch.Add(model.CodeEmp);
            lstObjSearch.Add(model.HDTJobTypeID);
            lstObjSearch.Add(model.JobTitleID);
            lstObjSearch.Add(model.PositionID);
            lstObjSearch.Add(model.OrgStructureID);
            lstObjSearch.Add(model.DateFrom);
            lstObjSearch.Add(model.DateTo);
            lstObjSearch.Add(model.Price);
            lstObjSearch.Add(model.IsCreateTemplate);
            lstObjSearch.Add(model.ExportId);
            lstObjSearch.Add(model.ExportType);
            lstObjSearch.Add(1);
            lstObjSearch.Add(int.MaxValue - 1);
            var result = actionServices.GetData<Hre_HDTJobEntity>(lstObjSearch, ConstantSql.hrm_hr_sp_get_HDTJob, ref status);
            if (result.Count > 0)
            {
                var profileServices = new Hre_ProfileServices();
                var listResult = profileServices.getHDTJobByPrice(result, model.DateFrom, model.DateTo);
                return Json(listResult.ToDataSourceResult(request));
            }
            else
            {
                return null;
            }

        }
Пример #3
0
        public ActionResult ExportHDTJobListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = model.DateFrom == null ? DateTime.Now : model.DateFrom };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = model.DateTo == null ? DateTime.Now : model.DateTo };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_ProfileModel();
            var actionServices = new ActionService(UserLogin);
            List<object> lstObjSearch = new List<object>();
            lstObjSearch.Add(model.ProfileName);
            lstObjSearch.Add(model.CodeEmp);
            lstObjSearch.Add(model.HDTJobTypeID);
            lstObjSearch.Add(model.JobTitleID);
            lstObjSearch.Add(model.PositionID);
            lstObjSearch.Add(model.OrgStructureID);
            lstObjSearch.Add(model.DateFrom);
            lstObjSearch.Add(model.DateTo);
            lstObjSearch.Add(model.Price);
            lstObjSearch.Add(model.IsCreateTemplate);
            lstObjSearch.Add(model.ExportId);
            lstObjSearch.Add(model.ExportType);
            lstObjSearch.Add(1);
            lstObjSearch.Add(int.MaxValue - 1);
            var result = actionServices.GetData<Hre_HDTJobEntity>(lstObjSearch, ConstantSql.hrm_hr_sp_get_HDTJob, ref status);
            var profileServices = new Hre_ProfileServices();
            var listResult = profileServices.getHDTJobByPrice(result, model.DateFrom, model.DateTo).Translate<Hre_HDTJobModel>();
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_HDTJobModel(),
                    FileName = "Hre_HDTJob",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportId != Guid.Empty)
            {
                if (model.DateFrom != null && model.DateTo != null)
                {
                    var fullPath = ExportService.Export(model.ExportId, listResult, listHeaderInfo, model.ExportType);
                    return Json(fullPath);
                }
                else
                {
                    var fullPath = ExportService.Export(model.ExportId, listResult, null, model.ExportType);
                    return Json(fullPath);
                }

            }
            return Json(result.ToDataSourceResult(request));
        }
Пример #4
0
 public ActionResult ApprovedAllHDTJobWaiting([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
 {
     return GetListDataAndReturn<Cat_HDTJobTypeModel, Cat_HDTJobTypeEntity, Hre_HDTJobSearchModel>(request, model, ConstantSql.hrm_hr_sp_set_ApprovedAllHDTJob);
 }