Beispiel #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);
 }
        private void InsertEmployee(SmartCRMEntitiesModel db, EmployeeModel employeeModel)
        {
            Employee pocoEmployee = new Employee();
            MapHelper.Map(employeeModel, pocoEmployee);

            db.Add(pocoEmployee);
            db.FlushChanges();
            employeeModel.Id = pocoEmployee.Id;
        }
Beispiel #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);
 }
Beispiel #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);
 }