Ejemplo n.º 1
0
 internal JobsBLL MapJob(Jobs Job)
 {
     try
     {
         JobsBLL JobBLL = null;
         if (Job != null)
         {
             JobBLL = new JobsBLL()
             {
                 JobID    = Job.JobID,
                 JobCode  = Job.JobCode,
                 JobName  = Job.JobName,
                 IsHidden = Job.IsHidden.HasValue ? Job.IsHidden : (bool?)null,
             };
             if (Job.JobsCategories != null)
             {
                 JobBLL.JobCategory = new JobsCategoriesBLL().MapJobCategory(Job.JobsCategories);
             }
         }
         return(JobBLL);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 2
0
        public virtual Result Update()
        {
            Result result = new Result();

            #region Check if JobCategory It has Promotion Record
            if (new PromotionsRecordsBLL().GetByJobCategory(this.JobCategoryID).Count > 0)
            {
                result            = new Result();
                result.Entity     = this;
                result.EnumMember = JobsCategoriesValidationEnum.RejectedBecauseOfItHasPromotionRecord.ToString();
                result.EnumType   = typeof(JobsCategoriesValidationEnum);
                return(result);
            }
            #endregion
            //--== Get Current Object from database to check if JobCategoryNo is Updated by user or not.
            JobsCategories JobCategoryObj = new JobsCategoriesDAL().GetByJobCategoryID(this.JobCategoryID);
            JobsCategories JobCategory    = new JobsCategories();
            JobCategory.JobCategoryID   = this.JobCategoryID;
            JobCategory.JobCategoryName = this.JobCategoryName;
            JobCategory.JobGroupID      = this.JobGroup.JobGroupID;
            if (this.MinQualification != null)
            {
                JobCategory.MinQualificationID = this.MinQualification.QualificationID;
            }
            if (this.MinQualificationDegree != null)
            {
                JobCategory.MinQualificationDegreeID = this.MinQualificationDegree.QualificationDegreeID;
            }
            if (this.MinGeneralSpecialization != null)
            {
                JobCategory.MinGeneralSpecializationID = this.MinGeneralSpecialization.GeneralSpecializationID;
            }
            JobCategory.LastUpdatedDate = DateTime.Now;
            JobCategory.LastUpdatedBy   = this.LoginIdentity.EmployeeCodeID;
            JobCategory.JobCategoryNo   = this.JobCategoryNo;
            this.JobCategoryID          = new JobsCategoriesDAL().Update(JobCategory);
            if (JobCategoryObj.JobCategoryNo != this.JobCategoryNo)
            {
                foreach (Jobs job in JobCategoryObj.Jobs)
                {
                    JobsBLL JobsBLL = new JobsBLL().MapJob(job);
                    JobsBLL.JobCode       = this.JobCategoryNo;
                    JobsBLL.LoginIdentity = this.LoginIdentity;
                    JobsBLL.Update();
                }
            }
            if (this.JobCategoryID != 0)
            {
                result.Entity     = this;
                result.EnumType   = typeof(LookupsValidationEnum);
                result.EnumMember = LookupsValidationEnum.Done.ToString();
            }
            return(result);
        }