/// <summary>
 /// [Quoc.Do] - Lấy dữ liệu CandidateHistory(Hre_CandidateHistory) theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Hre_CandidateHistoryModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Hre_CandidateHistoryModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetData<Hre_CandidateHistoryEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_CandidateHistoryById, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Hre_CandidateHistoryModel>();
     }
     model.ActionStatus = status;
     return model;
 }
Beispiel #2
0
        //ToLE
        public ActionResult ExportRecCandidateHistoryListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_ProfileCandidateHistorySearchModel model)
        {
            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_CandidateHistoryModel();
            var result = GetListData<Hre_CandidateHistoryModel, Hre_CandidateHistoryEntity, Hre_ProfileCandidateHistorySearchModel>(request, model, ConstantSql.hrm_hr_sp_get_RecCandidateHistory, ref status);
            if (model.IsCreateTemplateForDynamicGrid)
                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 = "Hre_CandidateHistoryModel",
                    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));
        }
        public ActionResult Create(Hre_CandidateHistoryModel model)
        {

            if (ModelState.IsValid)
            {
                var service = new RestServiceClient<Hre_CandidateHistoryModel>(UserLogin);
                service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
                var result = service.Put(_hrm_Hr_Service, "api/Hre_CandidateHistory/", model);
                ViewBag.MsgInsert = "Insert success";
            }
            return View();
        }
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_CandidateHistoryModel CandidateHistory)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Hre_CandidateHistoryModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_CandidateHistory/", CandidateHistory);
         ViewBag.MsgUpdate = "Update success";
     }
     return View();
 }