Exemple #1
0
        public HrEmployeeEntity Update(UserEntity UserEntity, Guid Id, HrEmployeeEntity HrEmployeeEntity)
        {
            HrEmployee HrEmployee = IMSContext.HrEmployees.Where(h => h.Id == Id).FirstOrDefault();

            HrEmployeeEntity.ToModel(HrEmployee);
            IMSContext.SaveChanges();
            return(HrEmployeeEntity);
        }
Exemple #2
0
        public HrEmployeeEntity Create(UserEntity UserEntity, HrEmployeeEntity HrEmployeeEntity)
        {
            HrEmployee HrEmployee = HrEmployeeEntity.ToModel();
            User       User       = new User()
            {
                Id = HrEmployee.Id, Username = HrEmployee.Name, Password = "******"
            };

            IMSContext.Users.Add(User);
            IMSContext.HrEmployees.Add(HrEmployee);
            IMSContext.SaveChanges();
            return(HrEmployeeEntity);
        }
Exemple #3
0
        public HrEmployeeEntity Create(UserEntity UserEntity, HrEmployeeEntity HrEmployeeEntity)
        {
            HrEmployee HrEmployee = HrEmployeeEntity.ToModel();
            User       user       = new User();

            user.Id       = HrEmployee.Id;
            user.Username = HrEmployeeEntity.Username;
            user.Password = "******";

            IMSContext.Users.Add(user);
            IMSContext.HrEmployees.Add(HrEmployee);
            IMSContext.SaveChanges();
            return(Get(UserEntity, HrEmployee.Id));
        }