Esempio n. 1
0
 public bool AddAccount(UserAccount useraccount)
 {
     try
     {
         using (var dbc = new UserSearchEntities())
         {
             dbc.UserAccounts.Add(useraccount);
             dbc.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally { }
 }
Esempio n. 2
0
        //public IEnumerable<spSearch_Result> Search(string letter)
        public IEnumerable <spSearch_Result> Search(Test test)
        {
            log.DebugFormat("AddUserService is active!");
            try
            {
                using (var dbc = new UserSearchEntities())
                {
                    string letter  = test.Letter;
                    var    allUser = dbc.spSearch(letter).ToList();
                    log.DebugFormat("Search(), user count: {0}", allUser.Count);

                    return(allUser);
                }
            }
            catch (Exception ex)
            {
                log.ErrorFormat("Search(): {0}", ex.Message);
                throw ex;
            }
            finally { }
        }