Пример #1
0
        public bool IsPermBannedUser(string id)
        {
            var ent     = new Checkin_Checkout_Entities();
            var tbValid = ent.tb_BannedUserTable.FirstOrDefault(s => s.CSU_ID == id && s.isPermBanned == true);

            return(tbValid != null);
        }
 public static tb_CSULabTechs tryLabTechSession(string ENAME)
 {
     //   try
     //   {
     if (ENAME.Length != 0)
     {
         var db = new Checkin_Checkout_Entities();
         var w  = db.tb_CSULabTechs.FirstOrDefault(lt => lt.ENAME == ENAME && !lt.DisabledDateTime.HasValue);
         if (w != null)
         {
             w.generateSession();
         }
         return(w);
     }
     // }
     //  catch { }
     return(null);
 }
 public static tb_CSULabTechs regenerateSessionFromCookies()
 {
     try
     {
         var cookieVal = System.Web.HttpContext.Current.Request.Cookies.Get("SecureSesh").Value;
         if (cookieVal.Length != 0)
         {
             var db = new Checkin_Checkout_Entities();
             var w  = db.tb_CSULabTechs.FirstOrDefault(lt => lt.ENAME == cookieVal && !lt.DisabledDateTime.HasValue);
             if (w != null)
             {
                 w.generateSession();
             }
             return(w);
         }
     }
     catch { }
     return(null);
 }