Ejemplo n.º 1
0
        /// <summary>
        ///     dto to Data Access Conversion
        /// </summary>
        /// <param name="employee">dto Employee</param>
        /// <returns>Data Access Employee</returns>
        public static Employee DtoToDataAccess(DtoEmployee employee)
        {
            var e = new Employee
            {
                id                     = employee.Id,
                name                   = employee.Name,
                surname                = employee.Surname,
                email                  = employee.Email,
                phoneNumber            = employee.PhoneNumber,
                icePhoneNumber         = employee.IcePhoneNumber,
                personalIdentityNumber = employee.PersonalIdentityNumber,
                identityCardNumber     = employee.IdentityCardNumber,
                city                   = employee.City,
                street                 = employee.Street,
                postalCode             = employee.PostalCode,
                houseNumber            = employee.HouseNumber,
                apartmentNumber        = employee.ApartmentNumber,
                description            = employee.Description,
                supervisorID           = employee.SupervisorId,
                positionID             = employee.Position.Id,
                password               = AuthenticationLogic.HashPassword(employee.Password, employee)
            };

            return(e);
        }
Ejemplo n.º 2
0
 public static Users DtoToDataAccess(DtoUser d)
 {
     return(new Users
     {
         id = d.Id,
         login = d.Login,
         cardId = d.CardId,
         password = AuthenticationLogic.HashPassword(d.Password, d.Login),
         averageScore = d.AverageScore,
         isAdmin = d.IsAdmin
     });
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     dto to Data Access Conversion
 /// </summary>
 /// <param name="customer">dto Customer</param>
 /// <returns>Data Access Customer</returns>
 public static Customer DtoToDataAccess(DtoCustomer customer)
 {
     return(new Customer
     {
         id = customer.Id,
         name = customer.Name,
         surname = customer.Surname,
         email = customer.Email,
         phoneNumber = customer.PhoneNumber,
         icePhoneNumber = customer.IcePhoneNumber,
         personalIdentityNumber = customer.PersonalIdentityNumber,
         identityCardNumber = customer.IdentityCardNumber,
         city = customer.City,
         street = customer.Street,
         postalCode = customer.PostalCode,
         houseNumber = customer.HouseNumber,
         apartmentNumber = customer.ApartmentNumber,
         password = AuthenticationLogic.HashPassword(customer.Password, customer)
     });
 }