示例#1
0
 public void postLoginData(LoginData.Login LoginRecord)
 {
     if (null == LoginRecord.AuthenticationRequest.Parameters ||
         LoginRecord.AuthenticationRequest.Parameters.IsIncludedInLoginData)
     {
         CswTableUpdate LoginData      = _CswNbtResources.makeCswTableUpdate("Login Data Insert", "login_data");
         DataTable      LoginDataTable = LoginData.getTable();
         DataRow        LoginRow       = LoginDataTable.NewRow();
         LoginRow["username"]         = LoginRecord.Username;
         LoginRow["ipaddress"]        = LoginRecord.IPAddress;
         LoginRow["logindate"]        = LoginRecord.LoginDate;
         LoginRow["loginstatus"]      = LoginRecord.LoginStatus;
         LoginRow["failurereason"]    = LoginRecord.FailureReason;
         LoginRow["failedlogincount"] = LoginRecord.FailedLoginCount;
         LoginDataTable.Rows.Add(LoginRow);
         LoginData.update(LoginDataTable);
     }
 }
示例#2
0
        public LoginData getLoginData(LoginData.LoginDataRequest Request)
        {
            DataTable LoginTable = _getLoginRecords(Request);

            foreach (DataRow LoginDataRow in LoginTable.Rows)
            {
                LoginData.Login LoginRecord = new LoginData.Login
                {
                    Username         = LoginDataRow["username"].ToString(),
                    IPAddress        = LoginDataRow["ipaddress"].ToString(),
                    LoginDate        = LoginDataRow["logindate"].ToString(),
                    LoginStatus      = LoginDataRow["loginstatus"].ToString(),
                    FailureReason    = LoginDataRow["failurereason"].ToString(),
                    FailedLoginCount = CswConvert.ToInt32(LoginDataRow["failedlogincount"])
                };
                Data.Logins.Add(LoginRecord);
            }

            return(Data);
        }