Click here to Skip to main content
15,905,238 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is this an acceptable practice? Pin
Dan Neely14-Apr-14 7:15
Dan Neely14-Apr-14 7:15 
AnswerRe: Is this an acceptable practice? Pin
Gates VP14-Apr-14 5:37
Gates VP14-Apr-14 5:37 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 6:04
Colborne_Greg14-Apr-14 6:04 
GeneralRe: Is this an acceptable practice? Pin
Gates VP14-Apr-14 7:51
Gates VP14-Apr-14 7:51 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 7:55
Colborne_Greg14-Apr-14 7:55 
GeneralRe: Is this an acceptable practice? Pin
Gates VP14-Apr-14 9:01
Gates VP14-Apr-14 9:01 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 9:33
Colborne_Greg14-Apr-14 9:33 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 9:45
Colborne_Greg14-Apr-14 9:45 
The reason indeed why I posted the acceptability is to hear what you think.

I am way out to left field my own practices are just for myself as I am the owner of my software company.
This is the whole thing, I already know how off standard this is.

Namespace Sinks
    <System.Runtime.Serialization.DataContract(IsReference:=True)>
    Public MustInherit Class Base
        Inherits Validate
        Implements iInterface

        <System.Runtime.Serialization.DataMember>
        Private mLastUpdated As DateTime, _
                mLastUpdatedBy As String, _
                mClearanceRequired As Int64, _
                mClearanceIsRequired As Boolean

        Public Sub New()
            MyBase.New()
        End Sub
        Public Sub New(Clearance As Int64)
            MyBase.New()
            ClearanceRequired = Clearance
        End Sub

        Public Property LastUpdated As DateTime Implements iInterface.LastUpdated
            Get
                Return mLastUpdated
            End Get
            Set(value As DateTime)
                mLastUpdated = value
            End Set
        End Property
        Public Property LastUpdatedBy As String Implements iInterface.LastUpdatedBy
            Get
                Return mLastUpdatedBy
            End Get
            Set(value As String)
                mLastUpdatedBy = value
            End Set
        End Property
        Public Property ClearanceIsRequired As Boolean Implements iInterface.ClearanceIsRequired
            Get
                Return mClearanceIsRequired
            End Get
            Set(value As Boolean)
                mClearanceIsRequired = value
            End Set
        End Property
        Public Property ClearanceRequired As Long Implements iInterface.ClearanceRequired
            Get
                Return mClearanceRequired
            End Get
            Set(value As Long)
                mClearanceIsRequired = True
                mClearanceRequired = value
            End Set
        End Property

        Public Overloads ReadOnly Property Value(User As Directory.iUser) As Object Implements iInterface.Value
            Get
                Select Case True
                    Case User.Deny : Throw New Exception("User Denied!")
                    Case ClearanceIsRequired And User.ClearanceReadLevel < ClearanceRequired : Throw New Exception("User clearance is lower then required!")
                    Case Else : Return MyBase.Value
                End Select
            End Get
        End Property
        Public Overloads WriteOnly Property Value(UpdatedDate As Date, LastUpdatedBy As String) As Object Implements iInterface.Value
            Set(value As Object)
                Me.LastUpdated = UpdatedDate
                Me.LastUpdatedBy = LastUpdatedBy
                MyBase.Value = value
            End Set
        End Property

        Public Overloads WriteOnly Property Value(UpdatedDate As Date, LastUpdatedBy As Directory.iUser) As Object Implements iInterface.Value
            Set(value As Object)
                If Me.LastUpdated = Nothing Then Me.LastUpdated = Me.Created

                Select Case True
                    Case ClearanceIsRequired
                        LastUpdatedBy.Authorize _
                        (
                            OriginalDate:=Me.LastUpdated,
                            ChangeDate:=UpdatedDate,
                            ClearanceLevel:=Me.ClearanceRequired
                        )
                    Case Else
                        LastUpdatedBy.Authorize _
                        (
                            OriginalDate:=Me.LastUpdated,
                            ChangeDate:=UpdatedDate
                        )
                End Select

                Me.Value(UpdatedDate, LastUpdatedBy.Name) = value
            End Set
        End Property
    End Class
End Namespace


modified 14-Apr-14 16:05pm.

GeneralRe: Is this an acceptable practice? Pin
Member 929572315-Apr-14 2:54
Member 929572315-Apr-14 2:54 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg15-Apr-14 4:24
Colborne_Greg15-Apr-14 4:24 
GeneralRe: Is this an acceptable practice? Pin
Dave Kreskowiak14-Apr-14 9:15
mveDave Kreskowiak14-Apr-14 9:15 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 9:31
Colborne_Greg14-Apr-14 9:31 
GeneralRe: Is this an acceptable practice? Pin
Fabio Franco14-Apr-14 6:15
professionalFabio Franco14-Apr-14 6:15 
GeneralRe: Is this an acceptable practice? Pin
Gates VP14-Apr-14 7:42
Gates VP14-Apr-14 7:42 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 7:49
Colborne_Greg14-Apr-14 7:49 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 7:48
Colborne_Greg14-Apr-14 7:48 
GeneralRe: Is this an acceptable practice? Pin
dg6yhw1114-Apr-14 6:41
dg6yhw1114-Apr-14 6:41 
GeneralRe: Is this an acceptable practice? Pin
Colborne_Greg14-Apr-14 7:39
Colborne_Greg14-Apr-14 7:39 
Generalneed help from people from the lounge Pin
Vasily Tserekh12-Apr-14 11:43
Vasily Tserekh12-Apr-14 11:43 
GeneralRe: need help from people from the lounge Pin
DaveAuld12-Apr-14 12:18
professionalDaveAuld12-Apr-14 12:18 
GeneralRe: need help from people from the lounge Pin
BillWoodruff12-Apr-14 16:40
professionalBillWoodruff12-Apr-14 16:40 
GeneralRe: need help from people from the lounge Pin
Vasily Tserekh12-Apr-14 19:04
Vasily Tserekh12-Apr-14 19:04 
GeneralRe: need help from people from the lounge Pin
JimmyRopes12-Apr-14 23:02
professionalJimmyRopes12-Apr-14 23:02 
QuestionRe: need help from people from the lounge Pin
CHill6013-Apr-14 4:31
mveCHill6013-Apr-14 4:31 
GeneralRe: need help from people from the lounge Pin
S u n s h i n e13-Apr-14 4:46
S u n s h i n e13-Apr-14 4:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.