﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Documentation Question</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 07:02:25 GMT</lastBuildDate><ttl>20</ttl><item><title>Documentation Question</title><link>http://forum.strataframe.net/FindPost1110.aspx</link><description>I have (more or less) followed your example for doing a login thus:&lt;br&gt;
Private Shared Sub ShowLoginAndInitMainForm(ByVal e As ShowLoginAndInitFormEventArgs)&lt;br&gt;
    '-- ToDo: add any code to show a login form and authenticate the user&lt;br&gt;
    '   e.LoginSuccessful = ?&lt;br&gt;
    '-- Establish locals&lt;br&gt;
    Dim llAuthenticated As Boolean = False&lt;br&gt;
    Dim loLoginForm As New LoginForm()&lt;br&gt;
    Dim loUsers As New UsersBO()&lt;br&gt;
    &lt;br&gt;
    '-- Show the login form&lt;br&gt;
    If loLoginForm.ShowDialog = Windows.Forms.DialogResult.OK Then&lt;br&gt;
        '-- Check to see if the user entered the correct username and password&lt;br&gt;
        '-- Get the user from the database&lt;br&gt;
        loUsers.FillByUserName(loLoginForm.UserName)&lt;br&gt;
    &lt;br&gt;
        '-- Check the password&lt;br&gt;
        If (loUsers.Count &gt; 0) AndAlso _&lt;br&gt;
            (loUsers.user_password.Equals(loLoginForm.Password)) Then&lt;br&gt;
    &lt;br&gt;
            '-- The user authenticated&lt;br&gt;
            llAuthenticated = True&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
Having done that I want to set some properties of my main form (or pass the bo to the main form). I have no idea what the mainform is called or how to reference it.&lt;br&gt;
&lt;br&gt;
Going the other way, your example below (presumably in a form or a bo) makes reference to a Users object but it does not make it clear where that object comes from or how it becomes a property of Me (this). At this rate I may get something useful built in a year. Guess I'm just dense.&lt;br&gt;
&lt;br&gt;
Private Sub Customers_CheckSecurity( _&lt;br&gt;
		ByVal e As MicroFour.StrataFrame.Business.CheckSecurityEventArgs) _&lt;br&gt;
		Handles Customers.CheckSecurity&lt;br&gt;
		&lt;br&gt;
    '-- Check the requested action&lt;br&gt;
    Select Case e.ActionRequested&lt;br&gt;
        Case SecurityAction.AddRecord&lt;br&gt;
            '-- See if the user can perform the requested action&lt;br&gt;
            If Me.Users.user_authlevel &gt;= 3 Then&lt;br&gt;
                e.Allowed = True&lt;br&gt;
            Else&lt;br&gt;
                e.Allowed = False&lt;br&gt;
            End If&lt;br&gt;
            &lt;br&gt;
        Case SecurityAction.DeleteRecord&lt;br&gt;
            '-- See if the user can perform the requested action&lt;br&gt;
            If Me.Users.user_authlevel &gt;= 4 Then&lt;br&gt;
                e.Allowed = True&lt;br&gt;
            Else&lt;br&gt;
                e.Allowed = False&lt;br&gt;
            End If&lt;br&gt;
            &lt;br&gt;
        Case SecurityAction.EditRecord&lt;br&gt;
            '-- See if the user can perform the requested action&lt;br&gt;
            If Me.Users.user_authlevel &gt;= 3 Then&lt;br&gt;
                e.Allowed = True&lt;br&gt;
            Else&lt;br&gt;
                e.Allowed = False&lt;br&gt;
            End If&lt;br&gt;
            &lt;br&gt;
    End Select&lt;br&gt;
End Sub&lt;br&gt;</description><pubDate>Sun, 07 May 2006 13:03:35 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Documentation Question</title><link>http://forum.strataframe.net/FindPost1112.aspx</link><description>oh&lt;br&gt;
&lt;br&gt;
 Thanks</description><pubDate>Sun, 07 May 2006 13:03:35 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Documentation Question</title><link>http://forum.strataframe.net/FindPost1111.aspx</link><description>The Users business object is just some pseudo business object that was used in the sample.&amp;nbsp; It doesn't exist in the framework.&amp;nbsp; &lt;P&gt;The main form that will be displayed is the form that is set within the InitApplication() method where the call to "e.Forms.Add(GetType(MainFormType))" is made.&amp;nbsp; The "MainFormType" is the System.Type of the main form that will be shown.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within the ShowLoginAndInitMainForm() method, you won't have a reference to the main for, yet, but you can pass parameters to the main form's constructor through the event args of the method like this:&lt;/P&gt;&lt;P&gt;e.FormInitArgs.Add(Parameter1)&lt;BR&gt;e.FormInitArgs.Add(Parameter2)&lt;/P&gt;&lt;P&gt;Where Parameter1 and Parameter2 are passed to the main form's constructor like this:&lt;/P&gt;&lt;PRE&gt;public MyMainForm(string Parameter1, int Parameter2)&lt;/PRE&gt;&lt;PRE&gt;{&lt;/PRE&gt;&lt;PRE&gt;     // save off the parameters into private fields&lt;/PRE&gt;&lt;PRE&gt;}&lt;/PRE&gt;</description><pubDate>Sun, 07 May 2006 01:47:34 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>