예제 #1
0
 public static void Map(Employee source, EmployeeModel destination)
 {
     Mapper.Map(source, destination);
     destination.Gender = (GenderType)source.Gender;
    // destination.Photo = source.Photo;
    // destination.PhotoImage = ImagesHelper.ByteArrayToImage(source.Photo);
 }
예제 #2
0
        private void InsertEmployee(SmartCRMEntitiesModel db, EmployeeModel employeeModel)
        {
            Employee pocoEmployee = new Employee();
            MapHelper.Map(employeeModel, pocoEmployee);

            db.Add(pocoEmployee);
            db.FlushChanges();
            employeeModel.Id = pocoEmployee.Id;
        }
예제 #3
0
 private void InsertAccount(SmartCRMEntitiesModel db, UserModel userModel, EmployeeModel employeeModel)
 {
     User pocoUser = new User();
     MapHelper.Map(userModel, pocoUser);
     Employee pocoEmployee = new Employee();
     MapHelper.Map(employeeModel, pocoEmployee);
     pocoUser.Employee = pocoEmployee;
     db.Add(pocoUser);
 }
예제 #4
0
 public static void Map(EmployeeModel source, Employee destination)
 {
     Mapper.Map(source, destination);
     destination.Gender = (short)source.Gender;
    // destination.Photo = source.Photo; //ImagesHelper.ImageToByteArray(source.PhotoImage);
 }