Example #1
0
 public IEnumerable <typelist> getType(string key)
 {
     using (var context = new bbdrytw1_msp_materialsEntities())
     {
         var result = from t in context.typelist
                      select t;
         result = result.Where(t => t.list.Equals(key));
         return(result.ToList());
     }
 }
Example #2
0
 public Boolean checkLogin(int id, string password)
 {
     using (var context = new bbdrytw1_msp_materialsEntities())
     {
         var query = (from user in context.user
                      where user.ID == id &&
                      user.Password == password
                      select user).FirstOrDefault();
         if (query == null)
         {
             return(false);
         }
         else
         {
             Account.SetUserInfo(query.ID, query.Name, query.Type);
             return(true);
         }
     }
 }