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.")); } } }
private void detach_AccessLogs(AccessLog entity) { this.SendPropertyChanging(); entity.User = null; }
private void attach_AccessLogs(AccessLog entity) { this.SendPropertyChanging(); entity.User = this; }
partial void DeleteAccessLog(AccessLog instance);
partial void UpdateAccessLog(AccessLog instance);
partial void InsertAccessLog(AccessLog instance);