Ejemplo n.º 1
0
 public Users CheckSession()
 {
     string cookie = FormsAuthentication.FormsCookieName;
     HttpCookie httpcookie = HttpContext.Current.Request.Cookies[cookie];
     if (httpcookie == null) return null;
     FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(httpcookie.Value);
     if (ticket == null || ticket.Expired) return null;
     try
     {
         Users user = new UserService().GetUserFromTicket(ticket.UserData);
         return user;
     }
     catch
     {
         return null;
     }
 }
Ejemplo n.º 2
0
 public ArticleService()
 {
     _dataModel = new LisaKatherineEntities();
     _userService = new UserService();
 }
Ejemplo n.º 3
0
 public ArticleService(LisaKatherineEntities dataModel, UserService userService)
 {
     _dataModel = dataModel;
     _userService = userService;
 }