Ejemplo n.º 1
0
        public ActionResult CreateJobCategory(JobsCategoriesViewModel JobCategoryVM)
        {
            JobsCategoriesBLL JobsCategoriesBLL = new JobsCategoriesBLL()
            {
                JobGroup = new JobsGroupsBLL()
                {
                    JobGroupID = JobCategoryVM.JobGroupID
                },
                JobCategoryName = JobCategoryVM.JobCategoryName,
                JobCategoryNo   = JobCategoryVM.JobCategoryNo,
                LoginIdentity   = UserIdentity
            };

            //if (JobCategoryVM.GeneralSpecialization.GeneralSpecializationID != 0)
            //    JobsCategoriesBLL.MinGeneralSpecialization = JobCategoryVM.GeneralSpecialization;

            //if (JobCategoryVM.Qualification.QualificationID != 0)
            //    JobsCategoriesBLL.MinQualification = JobCategoryVM.Qualification;

            //if (JobCategoryVM.QualificationDegree.QualificationDegreeID != 0)
            //    JobsCategoriesBLL.MinQualificationDegree = JobCategoryVM.QualificationDegree;

            Result result = JobsCategoriesBLL.Add();

            if ((System.Type)result.EnumType == typeof(LookupsValidationEnum))
            {
                JobsCategoriesBLL JobEntity = (JobsCategoriesBLL)result.Entity;
                if (result.EnumMember == AllowanceValidationEnum.Done.ToString())
                {
                    JobCategoryVM.JobCategoryID = ((JobsCategoriesBLL)result.Entity).JobCategoryID;
                }
            }

            return(Json(new { JobCategoryID = JobCategoryVM.JobCategoryID }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteJobCategory(JobsCategoriesViewModel JobCategoryVM)
        {
            JobsCategoriesBLL jobCategoryBLL = new JobsCategoriesBLL();

            jobCategoryBLL.LoginIdentity = UserIdentity;
            jobCategoryBLL.Remove(JobCategoryVM.JobCategoryID.Value);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public JobsCategoriesViewModel GetJobsCategoryByJobCategoryID(int id)
        {
            JobsCategoriesViewModel JobsCategoriesVM = new JobsCategoriesViewModel();
            JobsCategoriesBLL       JobCategory      = new JobsCategoriesBLL().GetByJobCategoryID(id);

            if (JobCategory != null && JobCategory.JobCategoryID > 0)
            {
                JobsCategoriesVM.JobCategoryID   = JobCategory.JobCategoryID;
                JobsCategoriesVM.JobCategoryName = JobCategory.JobCategoryName;
                JobsCategoriesVM.JobGroup        = JobCategory.JobGroup;
                JobsCategoriesVM.JobGeneralGroup = JobCategory.JobGroup.JobGeneralGroup;
            }

            return(JobsCategoriesVM);
        }
Ejemplo n.º 4
0
        public ActionResult EditJobCategory(JobsCategoriesViewModel JobCategoryVM)
        {
            JobsCategoriesBLL JobsCategoriesBLL = new JobsCategoriesBLL();

            JobsCategoriesBLL.JobCategoryID = JobCategoryVM.JobCategoryID.Value;
            JobsCategoriesBLL.JobGroup      = new JobsGroupsBLL()
            {
                JobGroupID = JobCategoryVM.JobGroupID
            };
            JobsCategoriesBLL.JobCategoryName = JobCategoryVM.JobCategoryName;
            JobsCategoriesBLL.JobCategoryNo   = JobCategoryVM.JobCategoryNo;
            //if (JobCategoryVM.GeneralSpecialization.GeneralSpecializationID != 0)
            //    JobsCategoriesBLL.MinGeneralSpecialization = JobCategoryVM.GeneralSpecialization;

            //if (JobCategoryVM.Qualification.QualificationID != 0)
            //    JobsCategoriesBLL.MinQualification = JobCategoryVM.Qualification;

            //if (JobCategoryVM.QualificationDegree.QualificationDegreeID != 0)
            //    JobsCategoriesBLL.MinQualificationDegree = JobCategoryVM.QualificationDegree;
            JobsCategoriesBLL.LoginIdentity = UserIdentity;
            Result result = JobsCategoriesBLL.Update();


            if ((System.Type)result.EnumType == typeof(JobsCategoriesValidationEnum))
            {
                if (result.EnumMember == JobsCategoriesValidationEnum.RejectedBecauseOfItHasPromotionRecord.ToString())
                {
                    throw new CustomException(Resources.Globalization.ValidationJobCategoryHasPromotionRecordText);
                }
            }
            if ((System.Type)result.EnumType == typeof(LookupsValidationEnum))
            {
                JobsCategoriesBLL JobAllowanceEntity = (JobsCategoriesBLL)result.Entity;
                if (result.EnumMember == LookupsValidationEnum.Done.ToString())
                {
                    Session["JobCategoryID"] = ((JobsCategoriesBLL)result.Entity).JobCategoryID;
                }
            }

            return(View(this.GetByJobCategoryID(JobCategoryVM.JobCategoryID.Value)));
        }
Ejemplo n.º 5
0
        private JobsCategoriesViewModel GetByJobCategoryID(int id)
        {
            JobsCategoriesBLL JobCategoryBLL = new JobsCategoriesBLL();

            JobCategoryBLL = JobCategoryBLL.GetByJobCategoryID(id);
            JobsCategoriesViewModel JobCategoryVM = new JobsCategoriesViewModel();

            if (JobCategoryBLL != null)
            {
                JobCategoryVM.JobCategoryID         = JobCategoryBLL.JobCategoryID;
                JobCategoryVM.JobCategoryName       = JobCategoryBLL.JobCategoryName;
                JobCategoryVM.JobGroupID            = JobCategoryBLL.JobGroup.JobGroupID;
                JobCategoryVM.JobGroupName          = "" + JobCategoryBLL.JobGroup.JobGroupName;
                JobCategoryVM.JobGeneralGroup       = JobCategoryBLL.JobGroup.JobGeneralGroup;
                JobCategoryVM.GeneralSpecialization = JobCategoryBLL.MinGeneralSpecialization;
                JobCategoryVM.QualificationDegree   = JobCategoryBLL.MinQualificationDegree;
                JobCategoryVM.Qualification         = JobCategoryBLL.MinQualification;
                JobCategoryVM.JobCategoryNo         = JobCategoryBLL.JobCategoryNo;
            }
            return(JobCategoryVM);
        }
Ejemplo n.º 6
0
        //[CustomAuthorize]
        //public override ActionResult Index()
        //{
        //    return View();
        //}

        public JsonResult GetJobsCategories()
        {
            var data = new JobsCategoriesBLL()
            {
                Search   = Search,
                Order    = Order,
                OrderDir = OrderDir,
                StartRec = StartRec,
                PageSize = PageSize
            }.GetJobsCategories(out TotalRecordsOut, out RecFilterOut).Select(item => new
            {
                JobCategoryID             = item.JobCategoryID,
                JobCategoryName           = item.JobCategoryName,
                JobGroupID                = item.JobGroup.JobGroupID,
                JobGroupName              = item.JobGroup.JobGroupName,
                JobGeneralGroupID         = item.JobGroup.JobGeneralGroup.JobGeneralGroupID,
                JobGeneralGroupName       = item.JobGroup.JobGeneralGroup.JobGeneralGroupName,
                QualificationDegreeName   = item.MinQualificationDegree != null ? item.MinQualificationDegree.QualificationDegreeName : "",
                QualificationName         = item.MinQualification != null ? item.MinQualification.QualificationName : "",
                GeneralSpecializationName = item.MinGeneralSpecialization != null ? item.MinGeneralSpecialization.GeneralSpecializationName : ""
            });

            return(Json(new { draw = Convert.ToInt32(Draw), recordsTotal = TotalRecordsOut, recordsFiltered = RecFilterOut, data = data }, JsonRequestBehavior.AllowGet));
        }