Ejemplo n.º 1
0
        public ActionResult Create(Rec_JobVacancyModel model)
        {
         
            if (ModelState.IsValid)
            {
                var service = new RestServiceClient<Rec_JobVacancyModel>(UserLogin);
                service.SetCookies(this.Request.Cookies, _Hrm_Hre_Service);
                var result = service.Put(_Hrm_Hre_Service, "api/Rec_JobVacancy/", model);

                ViewBag.MsgInsert = "Insert success";
            }
            return View();
        }
Ejemplo n.º 2
0
 public Rec_JobVacancyModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Rec_JobVacancyModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetByIdUseStore<Rec_JobVacancyEntity>(id, ConstantSql.hrm_rec_sp_get_JobVacancyById, ref status);//note
     if (entity != null)
     {
         model = entity.CopyData<Rec_JobVacancyModel>();
         model.JobVacancyID = model.ID;
     }
     model.ActionStatus = status;
     return model;
 }
Ejemplo n.º 3
0
        public ActionResult ExportJobVacancyListByTemplate([DataSourceRequest] DataSourceRequest request, Rec_JobVacancySearchModel model)
        {
            //return GetListDataAndReturn<Rec_JobVacancyModel, Rec_JobVacancyEntity, Rec_JobVacancySearchModel>(request, model, ConstantSql.hrm_rec_sp_get_JobVacancy);

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Rec_JobVacancyModel();
            var services = new BaseService();
            var result = GetListData<Rec_JobVacancyModel, Rec_JobVacancyEntity, Rec_JobVacancySearchModel>(request, model, ConstantSql.hrm_rec_sp_get_JobVacancy, ref status);
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateStartFrom", Value = model.DateStartFrom == null ? DateTime.Now : model.DateStartFrom };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateStartTo", Value = model.DateStartTo == null ? DateTime.Now : model.DateStartTo };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            if (model.IsCreateTemplateForDynamicGrid)
            {
                obj = result;
                isDataTable = false;
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Rec_JobVacancyModel",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            if (model.ExportId != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportId, result, listHeaderInfo, model.ExportType);
                return Json(fullPath);
            }

            return Json(result.ToDataSourceResult(request));

        }