예제 #1
0
        public void UpdateUser(MarketManFM userFM)
        {
            MarketManDAO dao  = new MarketManDAO();
            MarketMan    user = dao.GetMarketManByID(userFM.ID);

            user.Email = userFM.Email;
            dao.UpdateMarketMan(user);
        }
예제 #2
0
        public MarketManPassFM GetMarketManPassFM(int ID)
        {
            MarketManDAO    dao        = new MarketManDAO();
            MarketMan       user       = dao.GetMarketManByID(ID);
            MarketManPassFM passwordFM = new MarketManPassFM(user);

            return(passwordFM);
        }
예제 #3
0
        public void UpdatePassword(MarketManPassFM passwordFM)
        {
            MarketManDAO dao  = new MarketManDAO();
            MarketMan    user = dao.GetMarketManByID(passwordFM.ID);

            user.Password = passwordFM.NewPassword;
            dao.UpdateMarketMan(user);
        }
예제 #4
0
        public MarketManFM GetUserFM(int ID)
        {
            MarketManDAO dao    = new MarketManDAO();
            MarketMan    user   = dao.GetMarketManByID(ID);
            MarketManFM  userFM = new MarketManFM(user);

            return(userFM);
        }
예제 #5
0
        public bool ConfirmEmailLength(MarketManRegisterFM userFM)
        {
            MarketManDAO dao = new MarketManDAO();

            if (userFM.Email != null && userFM.Email.Length > 5)
            {
                return(true);
            }
            return(false);
        }
예제 #6
0
        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);
        }
예제 #8
0
 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);
 }
예제 #9
0
        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);
        }
예제 #10
0
        public void DeleteMarketMan(int ID)
        {
            MarketManDAO dao = new MarketManDAO();

            dao.DeleteMarketMan(ID);
        }