Beispiel #1
0
 public Rec_JobVacancyModel Post([Bind]Rec_JobVacancyModel model)
 {
    
     #region Validate
     string message = string.Empty;
     var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData<Rec_JobVacancyModel>(model, "Rec_JobVacancy", ref message);
     if (!checkValidate)
     {
         model.ActionStatus = message;
         return model;
     }
     if(model != null && model.DateEnd != null && model.DateStart != null)
     {
         checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData<Rec_JobVacancyModel>(model, "Rec_JobVacancyCheckDate", ref message);
         if (!checkValidate)
         {
             model.ActionStatus = message;
             return model;
         }
     }
     #endregion
     if (model.ID != Guid.Empty)
     {
         var service1=new Rec_JobVacancyServices();
         model.JobConditionIDs = service1.GetJobConditionIDs(model.ID);
         
     }
     ActionService service = new ActionService(UserLogin);
     var rs= service.UpdateOrCreate<Rec_JobVacancyEntity, Rec_JobVacancyModel>(model);
     if (rs.ID != Guid.Empty)
         rs.JobVacancyID = rs.ID;
     return rs;
 }
Beispiel #2
0
        public ActionResult GetJobVacancyByID(string JobVacancyID)
        {
            string status = string.Empty;
            var profileID = Guid.Empty;
            if (JobVacancyID.IndexOf(',') > 0)
            {
                return null;
            }
            if (!string.IsNullOrEmpty(JobVacancyID))
            {
                profileID = Common.ConvertToGuid(JobVacancyID);
            }

            var profileServices = new Rec_JobVacancyServices();
            ActionService service = new ActionService(UserLogin);
            var jobVacancy = profileServices.GetData<Rec_JobVacancyEntity>(profileID, ConstantSql.hrm_rec_sp_get_JobVacancyId, UserLogin, ref status).FirstOrDefault();

            if (jobVacancy != null)
            {
                return Json(jobVacancy, JsonRequestBehavior.AllowGet);
            }
            return null;
        }
Beispiel #3
0
        public ActionResult GetReportJobVacancy([DataSourceRequest] DataSourceRequest request, Rec_ReportJobVacancySearchModel model)
        {
            #region Validate
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateStart", Value = model.DateStart };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateEnd", Value = model.DateEnd };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Rec_ReportJobVacancySearchModel>(model, "Rec_ReportJobVacancySearch", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            #endregion

            var JobVacancyServices = new Rec_JobVacancyServices();
            List<object> listObj = new List<object>();

            listObj.Add(model.OrgStructureID);
            listObj.Add(model.DateStart);
            listObj.Add(model.DateEnd);
            listObj.Add(model.RankID);
            listObj.Add(model.Type);
            string status = string.Empty;
            var result = JobVacancyServices.GetData<Rec_JobVacancyEntity>(listObj, ConstantSql.hrm_rec_sp_get_ReportJobVacancy, UserLogin, ref status).ToList().Translate<Rec_JobVacancyModel>();
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Rec_JobVacancyModel(),
                    FileName = "Rec_ReportJobVacancy",
                    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));
        }
Beispiel #4
0
 public ActionResult GetJobConditionIDs(Guid JobVacancyID)
 {
     var service = new Rec_JobVacancyServices();
     string ConditionIDs = ConditionIDs = service.GetJobConditionIDs(JobVacancyID);
     // kiểm tra nếu json thì rỗng thì trả về chữ "null" để nhận dạng trong ajax để tránh ko vào success
     if (ConditionIDs == null)
         ConditionIDs = "null";
     return Json(ConditionIDs, JsonRequestBehavior.AllowGet);
 }
Beispiel #5
0
 public ActionResult DeleteJobCavancy(Guid JobVacancyID, string ConditionIDs)
 {
     var service = new Rec_JobVacancyServices();
     ConditionIDs = service.DeleteJobCavancy(JobVacancyID, ConditionIDs);
     return Json(ConditionIDs, JsonRequestBehavior.AllowGet);
 }
Beispiel #6
0
 public ActionResult AddConditionIntoVacancy(Guid JobVacancyID, string ConditionIDs)
 {
     var service = new Rec_JobVacancyServices();
     string str = service.AddConditionIntoVacancy(JobVacancyID, ConditionIDs);
     return Json(str, JsonRequestBehavior.AllowGet);
 }