Example #1
0
        public static void registernew(String uname, String upass)
        {
            using (publishEntities context = new publishEntities())
            {
                register obj = new register();
                obj.username = uname;
                obj.password = upass;


                context.registers.Add(obj);

                context.SaveChanges();
            }
        }
Example #2
0
 public static bool userlogin(String uname, String password)
 {
     using (publishEntities context = new publishEntities())
     {
         register obj = (register)context.registers.Where(x => x.username == uname).Where(x => x.password == password).FirstOrDefault();
         if (obj == null)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }