Пример #1
0
        internal Data.Entities.Employee ToEntity(Data.Entities.Employee entity)
        {
            entity.FirstName = this.FirstName;
            entity.LastName  = this.LastName;

            return(entity);
        }
        internal Data.Entities.Employee ToEntity(Data.Entities.Employee entity, string username)
        {
            entity.FirstName  = this.FirstName;
            entity.Modified   = DateTime.Now;
            entity.ModifiedBy = username;

            return(entity);
        }
Пример #3
0
 public bool AddNewEmployee(Data.Entities.Employee e)
 {
     if (e.HireDate.Value.Year > e.BirthDay.Value.Year)
     {
         this._employeeRepository.Insert(e);
         return(true); // Insert successfull
     }
     else
     {
         return(false);
     }
 }
Пример #4
0
        internal Data.Entities.Employee ToEntity(Data.Entities.Employee entity)
        {
            entity.FirstName                    = this.FirstName;
            entity.LastName                     = this.LastName;
            entity.FullName                     = this.FirstName + " " + this.LastName;
            entity.OfficeEmail                  = this.FirstName.ToLower() + "." + this.LastName.ToLower() + "@moonlay.com";
            entity.CurrentAddress               = this.CurrentAddress;
            entity.PhoneNumber                  = this.PhoneNumber;
            entity.TelephoneNumber              = this.TelephoneNumber;
            entity.EmergencyContactName         = this.EmergencyContactName;
            entity.EmergencyContactNumber       = this.EmergencyContactNumber;
            entity.EmergencyContactRelationship = this.EmergencyContactRelationship;
            entity.PersonalEmail                = this.PersonalEmail;

            return(entity);
        }
 public EmployeeDto(Data.Entities.Employee employee)
 {
     ImageProfile           = employee.ImageUrl;
     Id                     = employee.Id;
     FullName               = employee.FullName;
     Gender                 = employee.Gender;
     CurrentAddress         = employee.CurrentAddress;
     PhoneNumber            = employee.PhoneNumber;
     EmergencyContactName   = employee.EmergencyContactName;
     EmergencyContactNumber = employee.EmergencyContactNumber;
     PersonalEmail          = employee.PersonalEmail;
     InitialName            = employee.InitialName;
     JoinDate               = employee.JoinDate;
     OfficeEmail            = employee.OfficeEmail;
     LineManager            = employee.LineManager;
     StatusWorker           = employee.StatusWorker;
 }
        //Image Profile


        internal Data.Entities.Employee ToEntity(Data.Entities.Employee entity)
        {
            entity.FirstName                    = this.FirstName;
            entity.LastName                     = this.LastName;
            entity.Username                     = this.Username;
            entity.Password                     = this.Password;
            entity.FullName                     = this.FirstName + " " + this.LastName;
            entity.InitialName                  = this.FirstName.Substring(0, 3);
            entity.KTPAddress                   = this.KTPAddress;
            entity.CurrentAddress               = this.CurrentAddress;
            entity.Gender                       = this.Gender;
            entity.MaritalStatus                = this.MaritalStatus;
            entity.PhoneNumber                  = this.PhoneNumber;
            entity.TelephoneNumber              = this.TelephoneNumber;
            entity.EmergencyContactName         = this.EmergencyContactName;
            entity.EmergencyContactNumber       = this.EmergencyContactNumber;
            entity.EmergencyContactRelationship = this.EmergencyContactRelationship;
            entity.BirthLocation                = this.BirthLocation;
            entity.LastEducation                = this.LastEducation;
            entity.PersonalEmail                = this.PersonalEmail;
            entity.OfficeEmail                  = this.FirstName.ToLower() + "." + this.LastName.ToLower() + "@moonlay.com";
            entity.BirthDate                    = this.BirthDate;
            entity.IdentityCardNumber           = this.IdentityCardNumber;
            entity.StatusWorker                 = this.StatusWorker;
            entity.LineManager                  = this.LineManager;
            entity.Grading                      = this.Grading;
            entity.ReasonLeaving                = this.ReasonLeaving;
            entity.SpecialNotes                 = this.SpecialNotes;
            entity.Salary                       = this.Salary;
            entity.NoSurat                      = this.NoSurat;
            entity.JoinDate                     = this.JoinDate;
            entity.PassProbation                = this.PassProbation;
            entity.TransferDate                 = this.TransferDate;
            entity.ResignationDate              = this.ResignationDate;
            entity.CashOutLeave                 = this.CashOutLeave;
            entity.NPWP                 = this.NPWP;
            entity.NPWPAddress          = this.NPWPAddress;
            entity.LeaveTotal           = this.LeaveTotal;
            entity.SickLeaveTotal       = this.SickLeaveTotal;
            entity.ComplimentLeaveTotal = this.ComplimentLeaveTotal;

            return(entity);
        }
        public void AddUser(Employee employee)
        {
            Registration registration = new Registration();

            if (registration.IsUserExists(employee.EmployeeId))
            {
                throw new Exception("User Already Exists");
            }
            else
            {
                Data.Entities.Employee emp = new Data.Entities.Employee()
                {
                    EmployeeId   = employee.EmployeeId,
                    EmployeeName = employee.EmployeeName,
                    Email        = employee.Email,
                    Password     = employee.Password,
                    Phone        = employee.Phone
                };
                registration.AddUser(emp);
            }
        }
Пример #8
0
        public Employee ValidateUser(Employee employee)
        {
            var login1 = new Data.Concretes.Login();

            Data.Entities.Employee employeeEntity = new Data.Entities.Employee
            {
                Email    = employee.Email,
                Password = employee.Password
            };

            var      result    = login1.ValidateUser(employeeEntity);
            Employee employee1 = new Employee()
            {
                Email        = result.Email,
                EmployeeId   = result.EmployeeId,
                EmployeeName = result.EmployeeName,
                Phone        = result.Phone
            };

            return(employee1);
        }
Пример #9
0
 public Models.Employee ToModel(Data.Entities.Employee employee)
 {
     return(Mapper.Map <Models.Employee>(employee));
 }
Пример #10
0
 public void DeleteEmployee(Data.Entities.Employee e)
 {
     this._employeeRepository.Delete(e);
 }
Пример #11
0
 public void UpdateEmployee(Data.Entities.Employee e)
 {
     this._employeeRepository.Update(e);
 }