public override void Validate(string userName, string password)
 {
     using (ColorettaDataContext context = new ColorettaDataContext())
     {
         User user = GetUser(userName, false);
         if (user.Password == password && (user.Deleted == null || user.Deleted.Value == user.Created))
         {
             try
             {
                 AccessLog log = new AccessLog { Username = userName, AccessPoint = "WCF Service", LoginTime = DateTime.Now, Origination = "Unknown", Success = true, AccessLogId = Guid.NewGuid() };
                 context.AccessLogs.InsertOnSubmit(log);
                 context.SubmitChanges();
             }
             catch (Exception)
             {
             }
         }
         else
         {
             AccessLog log = new AccessLog { Username = userName, AccessPoint = "WCF Service", LoginTime = DateTime.Now, Origination = "Unknown", Success = false, Duration = new DateTimeOffset(DateTime.Now, TimeSpan.FromMilliseconds(0)) };
             context.AccessLogs.InsertOnSubmit(log);
             context.SubmitChanges();
             throw new FaultException(new FaultReason("Unable to verify username and password information."));
         }
     }
 }
Exemplo n.º 2
0
		private void detach_AccessLogs(AccessLog entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
Exemplo n.º 3
0
		private void attach_AccessLogs(AccessLog entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
Exemplo n.º 4
0
 partial void DeleteAccessLog(AccessLog instance);
Exemplo n.º 5
0
 partial void UpdateAccessLog(AccessLog instance);
Exemplo n.º 6
0
 partial void InsertAccessLog(AccessLog instance);