public UserDto(Dal.Users user) { this.UserId = user.UserId; this.UserMail = user.UserMail; this.UserFirstName = user.UserFirstName; this.UserLastName = UserLastName; this.UserPassword = user.UserPassword; this.UserPhone = user.UserPhone; this.IsDriver = user.IsDriver; }
public static Dal.Users ToDal(Dto.UserDto user) { Dal.Users u = new Dal.Users { UserId = user.UserId, UserFirstName = user.UserFirstName, UserLastName = user.UserLastName, UserMail = user.UserMail, UserPassword = user.UserPassword, UserPhone = user.UserPhone, IsDriver = user.IsDriver }; return(u); }
public static Dto.user ToDtoUsers(Dal.Users e) { Dto.user en = new Dto.user(); en.UserId = e.UserId; en.RoleId = e.RoleId; en.FirstName = e.FirstName; en.LastName = e.LastName; en.Password = e.Password; en.Email = e.Email; en.Phone = e.Phone; en.Address = e.Address; en.NumOfHouse = e.NumOfHouse; en.Locality = e.Locality; en.BirthDate = e.BirthDate; en.Active = e.Active; return(en); }
public static int AddMother(Dto.MotherDto motherDto) { var user = new Dal.Users { UserId = motherDto.UserId, FirstName = motherDto.firstName, LastName = motherDto.lastName, Email = motherDto.email, Password = motherDto.password, Active = motherDto.Active, BirthDate = motherDto.BirthDate, Locality = motherDto.Locality, Address = motherDto.Address, NumOfHouse = motherDto.NumOfHouse, Phone = motherDto.Phone, RoleId = motherDto.RoleId }; //var userId = Dal.UserDal.AddUser(user); var mother = new Dal.Mother { UserId = user.UserId, Users = user, NumOfChildren = motherDto.NumOfChildren, }; //var nuser = Dal.UserDal.AddUser(converterEF.UsersConverters.ToDalUsers(motherDto.)); //var birth = Dal.BirthDal.AddBirth(converterEF.BirthConverters.ToDalBirth(motherDto.UserId)); var nBirth = new Dal.Birth { BirthId = motherDto.BirthId, UserId = motherDto.UserId, BirthDateOfBaby = motherDto.BirthDateOfBaby, BoyOrGirl = motherDto.BoyOrGirl, NumOfBabies = motherDto.NumOfBabies, }; var motherId = Dal.MotherDal.AddMother(mother, nBirth); return((int)motherId); }