Пример #1
0
        //public List<GeneralSpecializationsBLL> GetByQualificationID(int QualificationID)
        //{
        //    return GetGeneralSpecializations().Where(x => x.Qualification.QualificationID.Equals(QualificationID)).ToList();
        //}
        public List <GeneralSpecializationsBLL> GetByQualificationID(int QualificationID)
        {
            List <GeneralSpecializations>    GeneralSpecializationList     = new GeneralSpecializationsDAL().GetByQualificationID(QualificationID);
            List <GeneralSpecializationsBLL> GeneralSpecializationsBLLList = new List <GeneralSpecializationsBLL>();

            foreach (var GeneralSpecialization in GeneralSpecializationList)
            {
                GeneralSpecializationsBLLList.Add(this.MapGeneralSpecialization(GeneralSpecialization));
            }
            return(GeneralSpecializationsBLLList);
        }
Пример #2
0
        public virtual Result Update()
        {
            try
            {
                Result result = null;

                #region Validation for GeneralSpecializationID EmployeeQualifications
                EmployeesQualificationsBLL EmployeeQualificationBLL = new EmployeesQualificationsBLL().GetByGeneralSpecializationID(this.GeneralSpecializationID);
                if (EmployeeQualificationBLL != null)
                {
                    if (EmployeeQualificationBLL.Qualification.QualificationID != this.Qualification.QualificationID)
                    {
                        result            = new Result();
                        result.Entity     = null;
                        result.EnumType   = typeof(GeneralSpecializationsValidationEnum);
                        result.EnumMember = GeneralSpecializationsValidationEnum.RejectedBecauseOfThisGeneralSpecializationExistsInEmployeesQualifications.ToString();
                        return(result);
                    }
                }
                #endregion

                #region Validation for GeneralSpecializationID JobsCategoriesQualifications
                JobsCategoriesQualificationsBLL JobsCategoriesQualificationsBLL = new JobsCategoriesQualificationsBLL().GetByGeneralSpecializationID(this.GeneralSpecializationID);
                if (JobsCategoriesQualificationsBLL != null)
                {
                    if (JobsCategoriesQualificationsBLL.Qualification.QualificationID != this.Qualification.QualificationID)
                    {
                        result            = new Result();
                        result.Entity     = null;
                        result.EnumType   = typeof(GeneralSpecializationsValidationEnum);
                        result.EnumMember = GeneralSpecializationsValidationEnum.RejectedBecauseOfThisGeneralSpecializationExistsInJobsCategoriesQualifications.ToString();
                        return(result);
                    }
                }
                #endregion

                GeneralSpecializations GeneralSpecialization = new GeneralSpecializations();
                GeneralSpecialization.GeneralSpecializationID   = this.GeneralSpecializationID;
                GeneralSpecialization.GeneralSpecializationName = this.GeneralSpecializationName;
                GeneralSpecialization.QualificationID           = this.Qualification.QualificationID;
                GeneralSpecialization.DirectPoints    = this.DirectPoints;
                GeneralSpecialization.IndirectPoints  = this.IndirectPoints;
                GeneralSpecialization.LastUpdatedDate = DateTime.Now;
                GeneralSpecialization.LastUpdatedBy   = this.LoginIdentity.EmployeeCodeID;

                int UpdateResult = new GeneralSpecializationsDAL().Update(GeneralSpecialization);
                if (UpdateResult != 0)
                {
                    result            = new Result();
                    result.Entity     = this;
                    result.EnumType   = typeof(GeneralSpecializationsValidationEnum);
                    result.EnumMember = GeneralSpecializationsValidationEnum.Done.ToString();
                }

                return(result);
            }
            catch
            {
                throw;
            }
        }