public ActionResult Register(RegexUser model) { model.RegisterDate = DateTime.Now; bizRegexUser.Save(model); return Login(model.Name, model.Password); }
/// <summary> /// �����û�״̬ /// </summary> /// <param name="user">RegexUser ʵ��</param> /// <param name="ip">���ε�¼��IP��ַ</param> public void UpdateUserState(RegexUser user, string ip) { RegexUserStateInfo userStateInfo = dbAccess.ListBy(x => x.UserID == user.ID).FirstOrDefault(); if (userStateInfo == null) { userStateInfo = new RegexUserStateInfo(); userStateInfo.LastLoginTime = DateTime.Now; userStateInfo.LoginCount = 1; userStateInfo.UserID = user.ID; userStateInfo.LastIP = ip; Save(userStateInfo); } else { userStateInfo.LastIP = ip; userStateInfo.LastLoginTime = DateTime.Now; userStateInfo.LoginCount = ++userStateInfo.LoginCount; Update(userStateInfo); } }
void _Logger_EntryWritten(object sender, EntryWrittenEventArgs e) { if (CategoryNumber != -1 && e.Entry.CategoryNumber == CategoryNumber) { return; } if (RegexMessage != null) { if (!RegexMessage.IsMatch(e.Entry.Message)) { return; } } if (RegexUser != null) { if (!RegexUser.IsMatch(e.Entry.UserName)) { return; } } if ((GetErrors && e.Entry.EntryType.HasFlag(EventLogEntryType.Error)) || (GetWarnings && e.Entry.EntryType.HasFlag(EventLogEntryType.Warning)) || (GetInformations && e.Entry.EntryType.HasFlag(EventLogEntryType.Information)) || (GetSuccessAudits && e.Entry.EntryType.HasFlag(EventLogEntryType.SuccessAudit)) || (GetFailureAudits && e.Entry.EntryType.HasFlag(EventLogEntryType.FailureAudit)) ) { l.Add(new Log(e.Entry)); } // Lanzar el evento if (RaiseMode is DataInputEventListener) { DataInputEventListener ev = (DataInputEventListener)RaiseMode; ev.RaiseTrigger(e); } }