public User GetUserByEmail(string email) { try { return(uCtrl.GetUserByEmail(email)); } catch (Exception) { throw; } }
//Gets the user with 'email' public UserModel GetUserByEmail(string email) { try { return(userCtrl.GetUserByEmail(email)); } catch (Exception ex) { throw ex; } }
public bool NewUserSubscriber(string mail) { EmailSubscriber sub = new EmailSubscriber(); UserCtrl uc = new UserCtrl(); UserModel um = null; try { um = uc.GetUserByEmail(mail); if (um != null) { sub.userId = um.Id; } } catch (Exception ex) { throw ex; } sub.emailAddress = mail; sub.validationCode = GenerateValidationCode(); sub.addressValidated = false; sub.dateSubscribed = DateTime.Now; try { EmailSubscriber es = GetSubscriber(mail); if (es != null) { return(false); } context.EmailSubscribers.InsertOnSubmit(sub); context.SubmitChanges(); string linkExtention = sub.validationCode; SendValidateUserEmail(linkExtention, mail); return(true); } catch (Exception ex) { throw ex; } }