コード例 #1
0
 public Rec_RecruitmentCampaignModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Rec_RecruitmentCampaignModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetByIdUseStore<Rec_RecruitmentCampaignEntity>(id, ConstantSql.hrm_rec_sp_get_RecruitmentCampaignById, ref status);//note
     if (entity != null)
     {
         model = entity.CopyData<Rec_RecruitmentCampaignModel>();
     }
     model.ActionStatus = status;
     return model;
 }
コード例 #2
0
        public ActionResult Create(Rec_RecruitmentCampaignModel model)
        {

            if (ModelState.IsValid)
            {
                var service = new RestServiceClient<Rec_RecruitmentCampaignModel>(UserLogin);
                service.SetCookies(this.Request.Cookies, _Hrm_Hre_Service);
                var result = service.Put(_Hrm_Hre_Service, "api/Rec_RecruitmentCampaign/", model);

                ViewBag.MsgInsert = "Insert success";
            }
            return View();
        }
コード例 #3
0
ファイル: Rec_GetDataController.cs プロジェクト: dtafe/vnr
        public ActionResult ExportRecruitmentCampaignListByTemplate([DataSourceRequest] DataSourceRequest request, Rec_RecruitmentCampaignSearchModel model)
        {
            string status = string.Empty;
            var isDataTable = false;
            object obj = new Rec_RecruitmentCampaignModel();
            var services = new BaseService();
            var result = GetListData<Rec_RecruitmentCampaignModel, Rec_RecruitmentCampaignEntity, Rec_RecruitmentCampaignSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_RecruitmentCampaign, ref status);
            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_RecruitmentCampaignModel",
                    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, null, model.ExportType);
                return Json(fullPath);
            }

            return Json(result.ToDataSourceResult(request));

        }