Пример #1
0
 public static bool CreateNewUser(User User)
 {
     try
     {
         return false;
     }
     catch (Exception ex)
     {
         Logger.getInstance().log(ex.ToString());
         return false;
     }
 }
Пример #2
0
        public static bool Register(User User)
        {
            try
            {
                User.Role = RoleDAO.getRoleById(COM.CONST.ROLE.NORMALUSER);
                User.CreatedDate = DateTime.Now;

                return UserDAO.Add(User);
            }
            catch (Exception ex)
            {
                Logger.getInstance().log(ex.ToString());
                return false;
            }
        }
Пример #3
0
 public static bool Add(User user)
 {
     {
         using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             try
             {
                 session.SaveOrUpdate(user);
                 transaction.Commit();
                 return true;
             }
             catch (Exception e)
             {
                 Logger.getInstance().log(e.ToString());
                 return false;
             }
         }
     }
 }