public static void CreateUser(DTO.MealPlannerDTO mealPlannerDTO) { var db = new MealPlannerDbEntities(); var user = convertToEntity(mealPlannerDTO); db.Users.Add(user); db.SaveChanges(); }
public static List <DTO.MealPlannerDTO> convertToDTO(List <User> users) { var usersDTO = new List <DTO.MealPlannerDTO>(); foreach (var user in users) { var userDTO = new DTO.MealPlannerDTO(); userDTO.UserName = user.UserName; userDTO.Password = user.Password; //userDTO.Email = user.Email; usersDTO.Add(userDTO); } return(usersDTO); }
protected void CreateAccountButton_Click(object sender, EventArgs e) { if (!textBoxDataIsValid()) { return; } MealPlanner.DTO.MealPlannerDTO mealPlannerDTO = new DTO.MealPlannerDTO(); mealPlannerDTO.UserName = UserNameTextBox.Text; mealPlannerDTO.Email = EmailTextBox.Text; mealPlannerDTO.Password = PasswordTextBox.Text; Session["userName"] = mealPlannerDTO.UserName; Domain.MealPlannerManager.CreateUser(mealPlannerDTO); }
protected void signInButton_Click(object sender, EventArgs e) { MealPlanner.DTO.MealPlannerDTO mealPlannerDTO = new DTO.MealPlannerDTO(); mealPlannerDTO.UserName = UserNameSigninTextBox.Text; mealPlannerDTO.Password = PasswordSigninTextBox.Text; string result = ""; result = Domain.SignInManager.SignInResult(mealPlannerDTO); resultLabel.Text = result; }
public static void CreateUser(DTO.MealPlannerDTO mealPlannerDTO) { Persistence.MealPlannerRepository.CreateUser(mealPlannerDTO); }
public static string SignInResult(DTO.MealPlannerDTO mealPlannerDTO) { var userList = Persistence.SignInRepository.GetUser(); return(IsLoginRight(mealPlannerDTO, userList)); }