public void UpdateUser(MarketManFM userFM) { MarketManDAO dao = new MarketManDAO(); MarketMan user = dao.GetMarketManByID(userFM.ID); user.Email = userFM.Email; dao.UpdateMarketMan(user); }
public MarketManPassFM GetMarketManPassFM(int ID) { MarketManDAO dao = new MarketManDAO(); MarketMan user = dao.GetMarketManByID(ID); MarketManPassFM passwordFM = new MarketManPassFM(user); return(passwordFM); }
public void UpdatePassword(MarketManPassFM passwordFM) { MarketManDAO dao = new MarketManDAO(); MarketMan user = dao.GetMarketManByID(passwordFM.ID); user.Password = passwordFM.NewPassword; dao.UpdateMarketMan(user); }
public MarketManFM GetUserFM(int ID) { MarketManDAO dao = new MarketManDAO(); MarketMan user = dao.GetMarketManByID(ID); MarketManFM userFM = new MarketManFM(user); return(userFM); }
public bool ConfirmEmailLength(MarketManRegisterFM userFM) { MarketManDAO dao = new MarketManDAO(); if (userFM.Email != null && userFM.Email.Length > 5) { return(true); } return(false); }
public bool IsValidUser(MarketManRegisterFM userFM) { MarketManDAO dao = new MarketManDAO(); if (dao.GetMarketManByEmail(userFM.Email) == null) { return(true); } return(false); }
public MarketManLoginVM MarketManLogin(MarketManLoginFM login) { MarketManLoginVM userVM = null; MarketManDAO dao = new MarketManDAO(); MarketMan user = dao.GetMarketManByEmail(login.Email); if (user != null && user.Password == login.Password) { userVM = new MarketManLoginVM(); userVM.Email = user.Email; userVM.ID = user.ID; } return(userVM); }
public bool CreateUser(MarketManRegisterFM userFM) { if (IsValidUser(userFM)) { //email temp pass to user MarketManDAO dao = new MarketManDAO(); MarketMan user = new MarketMan(); user.Email = userFM.Email; user.Password = userFM.Password; dao.CreateMarketMan(user); return(true); } return(false); }
public MarketMansVM GetMarketMans() { MarketManDAO dao = new MarketManDAO(); List <MarketMan> users = dao.GetAllMarketMans(); MarketMansVM usersVM = new MarketMansVM(); foreach (MarketMan user in users) { MarketManVM userVM = new MarketManVM(); userVM.ID = user.ID; userVM.Email = user.Email; usersVM.MarketingManagers.Add(userVM); } return(usersVM); }
public void DeleteMarketMan(int ID) { MarketManDAO dao = new MarketManDAO(); dao.DeleteMarketMan(ID); }