コード例 #1
0
 internal EmployeesExperiencesBLL MapEmployeeExperience(EmployeesExperiences EmployeeExperience)
 {
     try
     {
         EmployeesExperiencesBLL EmployeeExperienceBLL = null;
         if (EmployeeExperience != null)
         {
             EmployeeExperienceBLL = new EmployeesExperiencesBLL()
             {
                 EmployeeExperienceID = EmployeeExperience.EmployeeExperienceID,
                 TotalYears           = EmployeeExperience.TotalYears,
                 TotalMonths          = EmployeeExperience.TotalMonths,
                 TotalDays            = EmployeeExperience.TotalDays,
                 EmployeesCodes       = new EmployeesCodesBLL().MapEmployeeCode(EmployeeExperience.EmployeesCodes),
                 CreatedBy            = new EmployeesCodesBLL().MapEmployeeCode(EmployeeExperience.CreatedByNav),
                 CreatedDate          = EmployeeExperience.CreatedDate.Value
             };
         }
         return(EmployeeExperienceBLL);
     }
     catch
     {
         throw;
     }
 }
コード例 #2
0
        public virtual Result Update()
        {
            try
            {
                Result result = null;

                EmployeesExperiences EmployeeExperience = new EmployeesExperiences()
                {
                    EmployeeExperienceID = this.EmployeeExperienceID,
                    EmployeeCodeID       = this.EmployeesCodes.EmployeeCodeID,
                    TotalYears           = this.TotalYears,
                    TotalMonths          = this.TotalMonths,
                    TotalDays            = this.TotalDays,
                    LastUpdatedDate      = DateTime.Now,
                    LastUpdatedBy        = this.LoginIdentity.EmployeeCodeID
                };
                this.EmployeeExperienceID = new EmployeesExperiencesDAL().Update(EmployeeExperience);
                result = new Result()
                {
                    Entity     = this,
                    EnumType   = typeof(EmployeesExperiencesValidationEnum),
                    EnumMember = EmployeesExperiencesValidationEnum.Done.ToString(),
                };
                return(result);
            }
            catch
            {
                throw;
            }
        }
コード例 #3
0
        public int GetTotalDaysByEmployeeExperience(EmployeesExperiences EmployeesExperience)
        {
            int     TotalExperience    = 0;
            decimal totExpWithDecimals = 0;

            //EmployeesExperiences EmployeesExperience = new EmployeesExperiencesDAL().GetEmployeeExperiencesByEmployeeCodeID(EmployeeCodeID).FirstOrDefault();

            if (EmployeesExperience != null && EmployeesExperience.EmployeeExperienceID > 0)
            {
                totExpWithDecimals = Convert.ToDecimal((EmployeesExperience.TotalYears * DaysCountInUmAlquraYear)) + (EmployeesExperience.TotalMonths * DaysCountInUmAlquraMonth) + Convert.ToDecimal(EmployeesExperience.TotalDays);
                TotalExperience    = Convert.ToInt32(Math.Floor(totExpWithDecimals));
            }

            return(TotalExperience);
        }