Esempio n. 1
0
 public static void GetMapMapUser(string Username)
 {
     using (HmindMapEntities db = new HmindMapEntities())
     {
         var a = db.Users.Find(Username).MapUsers.ToList();
     }
 }
Esempio n. 2
0
 public static List <MapUser> GetMapUsers(string Username)
 {
     using (HmindMapEntities db = new HmindMapEntities())
     {
         return(db.Users.Find(Username).MapUsers.ToList());
     }
 }
Esempio n. 3
0
 public static void DeletedMap(string mapname)
 {
     using (HmindMapEntities db = new HmindMapEntities())
     {
         db.MapUsers.Remove(db.MapUsers.Find(mapname));
         db.SaveChanges();
     }
 }
Esempio n. 4
0
        public static User GetUser(string username)
        {
            User user = null;

            using (HmindMapEntities db = new HmindMapEntities())
            {
                user = db.Users.Find(username);
            }
            return(user);
        }
Esempio n. 5
0
        public static List <MapUser> GetMapUsers()
        {
            List <MapUser> a = null;

            using (HmindMapEntities db = new HmindMapEntities())
            {
                if (CurrentUser != null)
                {
                    a = db.Users.Find(CurrentUser).MapUsers.ToList();
                }
            }
            return(a);
        }
Esempio n. 6
0
        public static bool CanSignIn(string user, string Pass)
        {
            bool a = false;

            using (HmindMapEntities db = new HmindMapEntities())
            {
                User u = db.Users.Find(user);
                if (u != null && u.Pass == Pass)
                {
                    a = true;
                }
            }
            return(a);
        }
Esempio n. 7
0
 public static void SaveIndatabase(string Username, string filename, string path)
 {
     using (HmindMapEntities db = new HmindMapEntities())
     {
         string a = "";
         using (StreamReader reader = new StreamReader(path, Encoding.UTF8))
         {
             a = reader.ReadToEnd();
         }
         MapUser map = new MapUser()
         {
             MapName = filename, Content = a, Username = Username
         };
         db.MapUsers.AddOrUpdate(map);
         db.SaveChanges();
     }
 }
Esempio n. 8
0
        public static bool AddUser(User user)
        {
            bool a = false;

            using (HmindMapEntities db = new HmindMapEntities())
            {
                try
                {
                    db.Users.Add(user);
                    db.SaveChanges();
                    a = true;
                }
                catch
                {
                    a = false;
                }
            }
            return(a);
        }