C2025-011 PROMS – RO Update Admin Tool Memory Enhancements

The purpose of this upgrade is to improve the user experience when using the Admin tool to Update ROs. Currently for larger RO dbs (like Barakah) we can run up against memory constraints that do not allow all the ROs to be updated at one time. This is based upon some initial resource where some places were identified where we could improve memory usage.  Some of these should benefit PROMS as a whole while others will be specific to the RO Update option in Admin Tools.
This commit is contained in:
2025-02-04 13:23:21 -05:00
parent f2d330bd0e
commit 378653c536
254 changed files with 159727 additions and 163222 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -17,151 +17,143 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// AssignmentInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class AssignmentInfo : ReadOnlyBase<AssignmentInfo>
{
#region Business Methods
private int _aid;
[System.ComponentModel.DataObjectField(true, true)]
public int Aid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _aid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _gid;
}
}
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _rid;
}
}
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _folderid;
}
}
private string _startdate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _startdate;
}
}
private string _enddate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _enddate;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base AssignmentInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current AssignmentInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check AssignmentInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current AssignmentInfo</returns>
protected override object GetIdValue()
{
return _aid;
}
#endregion
#region Factory Methods
private AssignmentInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal AssignmentInfo(SafeDataReader dr)
/// <summary>
/// AssignmentInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class AssignmentInfo : ReadOnlyBase<AssignmentInfo>
{
try
{
_aid = dr.GetInt32("AID");
_gid = dr.GetInt32("GID");
_rid = dr.GetInt32("RID");
_folderid = dr.GetInt32("FolderID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("AssignmentInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _aid;
[System.ComponentModel.DataObjectField(true, true)]
public int Aid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _aid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _gid;
}
}
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _rid;
}
}
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _folderid;
}
}
private string _startdate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _startdate;
}
}
private string _enddate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _enddate;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base AssignmentInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current AssignmentInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check AssignmentInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current AssignmentInfo</returns>
protected override object GetIdValue()
{
return _aid;
}
#endregion
#region Factory Methods
private AssignmentInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal AssignmentInfo(SafeDataReader dr)
{
try
{
_aid = dr.GetInt32("AID");
_gid = dr.GetInt32("GID");
_rid = dr.GetInt32("RID");
_folderid = dr.GetInt32("FolderID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("AssignmentInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -17,428 +17,416 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// ConnectionFolder Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class ConnectionFolder : BusinessBase<ConnectionFolder>
{
#region Business Methods
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _folderid;
}
}
private int _parentid;
[System.ComponentModel.DataObjectField(true, true)]
public int Parentid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _parentid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (_parentid != value)
{
_parentid = value;
PropertyHasChanged();
}
}
}
private string _name=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _name;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_name != value)
{
_name = value;
PropertyHasChanged();
}
}
}
private string _title=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _title;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_title != value)
{
_title = value;
PropertyHasChanged();
}
}
}
private string _config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _config;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_config != value)
{
_config = value;
PropertyHasChanged();
}
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged=new byte[8];//timestamp
// TODO: Check ConnectionFolder.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current ConnectionFolder</returns>
protected override object GetIdValue()
{
return _folderid;
}
// TODO: Replace base ConnectionFolder.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current ConnectionFolder</returns>
//public override string ToString()
//{
// return base.ToString();
//}
#endregion
#region ValidationRules
protected override void AddBusinessRules()
{
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Name");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
#endregion
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Folderid, "<Role(s)>");
//AuthorizationRules.AllowRead(Parentid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Parentid, "<Role(s)>");
//AuthorizationRules.AllowRead(Name, "<Role(s)>");
//AuthorizationRules.AllowWrite(Name, "<Role(s)>");
//AuthorizationRules.AllowRead(Title, "<Role(s)>");
//AuthorizationRules.AllowWrite(Title, "<Role(s)>");
//AuthorizationRules.AllowRead(Config, "<Role(s)>");
//AuthorizationRules.AllowWrite(Config, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
internal static ConnectionFolder New(string name)
/// <summary>
/// ConnectionFolder Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class ConnectionFolder : BusinessBase<ConnectionFolder>
{
return new ConnectionFolder(name);
}
#region Business Methods
internal static ConnectionFolder Get(SafeDataReader dr)
{
return new ConnectionFolder(dr);
}
private ConnectionFolder()
{
MarkAsChild();
_parentid = ext.DefaultParentid;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _folderid;
}
}
private int _parentid;
[System.ComponentModel.DataObjectField(true, true)]
public int Parentid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _parentid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_parentid != value)
{
_parentid = value;
PropertyHasChanged();
}
}
}
private string _name = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _name;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_name != value)
{
_name = value;
PropertyHasChanged();
}
}
}
private string _title = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _title;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_title != value)
{
_title = value;
PropertyHasChanged();
}
}
}
private string _config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _config;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_config != value)
{
_config = value;
PropertyHasChanged();
}
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged = new byte[8];//timestamp
// TODO: Check ConnectionFolder.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current ConnectionFolder</returns>
protected override object GetIdValue()
{
return _folderid;
}
// TODO: Replace base ConnectionFolder.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current ConnectionFolder</returns>
//public override string ToString()
//{
// return base.ToString();
//}
private ConnectionFolder(string name)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_parentid = ext.DefaultParentid;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_name = name;
}
#endregion
#region ValidationRules
private ConnectionFolder(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
protected override void AddBusinessRules()
{
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Name");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
#endregion
#region Data Access Portal
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
private void Fetch(SafeDataReader dr)
{
try{
_folderid = dr.GetInt32("FolderID");
_parentid = dr.GetInt32("ParentID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
}
catch(Exception ex)
{
Database.LogException("ConnectionFolder",ex);
}
MarkOld();
}
#endregion
internal void Insert(Connection connection,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Folder.Add(cn, ref _folderid, _parentid, connection.Dbid, _name, _title, _config, _dts, _usrid);
MarkOld();
}
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Folderid, "<Role(s)>");
//AuthorizationRules.AllowRead(Parentid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Parentid, "<Role(s)>");
//AuthorizationRules.AllowRead(Name, "<Role(s)>");
//AuthorizationRules.AllowWrite(Name, "<Role(s)>");
//AuthorizationRules.AllowRead(Title, "<Role(s)>");
//AuthorizationRules.AllowWrite(Title, "<Role(s)>");
//AuthorizationRules.AllowRead(Config, "<Role(s)>");
//AuthorizationRules.AllowWrite(Config, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
internal void Update(Connection connection,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Folder.Update(cn, ref _folderid, _parentid, connection.Dbid, _name, _title, _config, _dts, _usrid, ref _lastchanged);
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
internal void DeleteSelf(Connection connection,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Folder.Remove(cn,_folderid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual int DefaultParentid
{
get { return 0; }
}
public virtual int DefaultDbid
{
get { return 0; }
}
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
// The follwing is a sample Extension File. You can use it to create ConnectionFolderExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
//namespace PatrialClass
//{
// public partial class ConnectionFolder
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual int DefaultParentid
// {
// get { return 0; }
// }
// public virtual int DefaultDbid
// {
// get { return 0; }
// }
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
} // Class
internal static ConnectionFolder New(string name)
{
return new ConnectionFolder(name);
}
internal static ConnectionFolder Get(SafeDataReader dr)
{
return new ConnectionFolder(dr);
}
private ConnectionFolder()
{
MarkAsChild();
_parentid = ext.DefaultParentid;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private ConnectionFolder(string name)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_parentid = ext.DefaultParentid;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_name = name;
}
private ConnectionFolder(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
#endregion
#region Data Access Portal
private void Fetch(SafeDataReader dr)
{
try
{
_folderid = dr.GetInt32("FolderID");
_parentid = dr.GetInt32("ParentID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
}
catch (Exception ex)
{
Database.LogException("ConnectionFolder", ex);
}
MarkOld();
}
internal void Insert(Connection connection, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Folder.Add(cn, ref _folderid, _parentid, connection.Dbid, _name, _title, _config, _dts, _usrid);
MarkOld();
}
internal void Update(Connection connection, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Folder.Update(cn, ref _folderid, _parentid, connection.Dbid, _name, _title, _config, _dts, _usrid, ref _lastchanged);
}
internal void DeleteSelf(Connection connection, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Folder.Remove(cn, _folderid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual int DefaultParentid
{
get { return 0; }
}
public virtual int DefaultDbid
{
get { return 0; }
}
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
// The follwing is a sample Extension File. You can use it to create ConnectionFolderExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
//namespace PatrialClass
//{
// public partial class ConnectionFolder
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual int DefaultParentid
// {
// get { return 0; }
// }
// public virtual int DefaultDbid
// {
// get { return 0; }
// }
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
} // Class
} // Namespace

View File

@@ -17,154 +17,146 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class ConnectionInfo : ReadOnlyBase<ConnectionInfo>
{
#region Business Methods
private int _dbid;
[System.ComponentModel.DataObjectField(true, true)]
public int Dbid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dbid;
}
}
private string _name=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _name;
}
}
private string _title=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _title;
}
}
private string _connectionstring=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string ConnectionString
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _connectionstring;
}
}
private int _servertype;
/// <summary>
/// 0 SQL Server
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int ServerType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _servertype;
}
}
private string _config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _config;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base ConnectionInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current ConnectionInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current ConnectionInfo</returns>
protected override object GetIdValue()
{
return _dbid;
}
#endregion
#region Factory Methods
private ConnectionInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal ConnectionInfo(SafeDataReader dr)
/// <summary>
/// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class ConnectionInfo : ReadOnlyBase<ConnectionInfo>
{
try
{
_dbid = dr.GetInt32("DBID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_connectionstring = dr.GetString("ConnectionString");
_servertype = dr.GetInt32("ServerType");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("ConnectionInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _dbid;
[System.ComponentModel.DataObjectField(true, true)]
public int Dbid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dbid;
}
}
private string _name = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _name;
}
}
private string _title = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _title;
}
}
private string _connectionstring = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string ConnectionString
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _connectionstring;
}
}
private int _servertype;
/// <summary>
/// 0 SQL Server
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int ServerType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _servertype;
}
}
private string _config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _config;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base ConnectionInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current ConnectionInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current ConnectionInfo</returns>
protected override object GetIdValue()
{
return _dbid;
}
#endregion
#region Factory Methods
private ConnectionInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal ConnectionInfo(SafeDataReader dr)
{
try
{
_dbid = dr.GetInt32("DBID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_connectionstring = dr.GetString("ConnectionString");
_servertype = dr.GetInt32("ServerType");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("ConnectionInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -17,151 +17,143 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// FolderInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class FolderInfo : ReadOnlyBase<FolderInfo>
{
#region Business Methods
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _folderid;
}
}
private int _parentid;
[System.ComponentModel.DataObjectField(true, true)]
public int Parentid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _parentid;
}
}
private int _dbid;
[System.ComponentModel.DataObjectField(true, true)]
public int Dbid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dbid;
}
}
private string _name=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _name;
}
}
private string _title=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _title;
}
}
private string _config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _config;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base FolderInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current FolderInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check FolderInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current FolderInfo</returns>
protected override object GetIdValue()
{
return _folderid;
}
#endregion
#region Factory Methods
private FolderInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal FolderInfo(SafeDataReader dr)
/// <summary>
/// FolderInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class FolderInfo : ReadOnlyBase<FolderInfo>
{
try
{
_folderid = dr.GetInt32("FolderID");
_parentid = dr.GetInt32("ParentID");
_dbid = dr.GetInt32("DBID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("FolderInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _folderid;
[System.ComponentModel.DataObjectField(true, true)]
public int Folderid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _folderid;
}
}
private int _parentid;
[System.ComponentModel.DataObjectField(true, true)]
public int Parentid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _parentid;
}
}
private int _dbid;
[System.ComponentModel.DataObjectField(true, true)]
public int Dbid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dbid;
}
}
private string _name = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _name;
}
}
private string _title = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _title;
}
}
private string _config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _config;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base FolderInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current FolderInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check FolderInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current FolderInfo</returns>
protected override object GetIdValue()
{
return _folderid;
}
#endregion
#region Factory Methods
private FolderInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal FolderInfo(SafeDataReader dr)
{
try
{
_folderid = dr.GetInt32("FolderID");
_parentid = dr.GetInt32("ParentID");
_dbid = dr.GetInt32("DBID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("FolderInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -17,127 +17,121 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// GroupInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class GroupInfo : ReadOnlyBase<GroupInfo>
{
#region Business Methods
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _gid;
}
}
private string _groupname=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string GroupName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _groupname;
}
}
private int _grouptype;
[System.ComponentModel.DataObjectField(true, true)]
public int GroupType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _grouptype;
}
}
private string _config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _config;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base GroupInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current GroupInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check GroupInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current GroupInfo</returns>
protected override object GetIdValue()
{
return _gid;
}
#endregion
#region Factory Methods
private GroupInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal GroupInfo(SafeDataReader dr)
/// <summary>
/// GroupInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class GroupInfo : ReadOnlyBase<GroupInfo>
{
try
{
_gid = dr.GetInt32("GID");
_groupname = dr.GetString("GroupName");
_grouptype = dr.GetInt32("GroupType");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("GroupInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _gid;
}
}
private string _groupname = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string GroupName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _groupname;
}
}
private int _grouptype;
[System.ComponentModel.DataObjectField(true, true)]
public int GroupType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _grouptype;
}
}
private string _config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _config;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base GroupInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current GroupInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check GroupInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current GroupInfo</returns>
protected override object GetIdValue()
{
return _gid;
}
#endregion
#region Factory Methods
private GroupInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal GroupInfo(SafeDataReader dr)
{
try
{
_gid = dr.GetInt32("GID");
_groupname = dr.GetString("GroupName");
_grouptype = dr.GetInt32("GroupType");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("GroupInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -17,139 +17,132 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// MembershipInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class MembershipInfo : ReadOnlyBase<MembershipInfo>
{
#region Business Methods
private int _ugid;
[System.ComponentModel.DataObjectField(true, true)]
public int Ugid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _ugid;
}
}
private int _uid;
[System.ComponentModel.DataObjectField(true, true)]
public int Uid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _uid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _gid;
}
}
private string _startdate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _startdate;
}
}
private string _enddate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _enddate;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base MembershipInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current MembershipInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check MembershipInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current MembershipInfo</returns>
protected override object GetIdValue()
{
return _ugid;
}
#endregion
#region Factory Methods
private MembershipInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal MembershipInfo(SafeDataReader dr)
/// <summary>
/// MembershipInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class MembershipInfo : ReadOnlyBase<MembershipInfo>
{
try
{
_ugid = dr.GetInt32("UGID");
_uid = dr.GetInt32("UID");
_gid = dr.GetInt32("GID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("MembershipInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _ugid;
[System.ComponentModel.DataObjectField(true, true)]
public int Ugid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _ugid;
}
}
private int _uid;
[System.ComponentModel.DataObjectField(true, true)]
public int Uid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _uid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _gid;
}
}
private string _startdate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _startdate;
}
}
private string _enddate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _enddate;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base MembershipInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current MembershipInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check MembershipInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current MembershipInfo</returns>
protected override object GetIdValue()
{
return _ugid;
}
#endregion
#region Factory Methods
private MembershipInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal MembershipInfo(SafeDataReader dr)
{
try
{
_ugid = dr.GetInt32("UGID");
_uid = dr.GetInt32("UID");
_gid = dr.GetInt32("GID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("MembershipInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -17,187 +17,177 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// PermissionInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class PermissionInfo : ReadOnlyBase<PermissionInfo>
{
#region Business Methods
private int _pid;
[System.ComponentModel.DataObjectField(true, true)]
public int Pid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _pid;
}
}
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _rid;
}
}
private int _permlevel;
/// <summary>
/// 0 - Security, 1 - System, 2 - RO, 3 - Procdures, 4 - Sections, 5 - Steps, 6 - Comments
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int PermLevel
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _permlevel;
}
}
private int _versiontype;
/// <summary>
/// 0 - Working Draft, 1 - Temporary Change, 2 Approved
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int VersionType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _versiontype;
}
}
private int _permvalue;
/// <summary>
/// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All)
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int PermValue
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _permvalue;
}
}
private int _permad;
/// <summary>
/// 0 - Allow, 1 - Deny
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int Permad
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _permad;
}
}
private string _startdate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _startdate;
}
}
private string _enddate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _enddate;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base PermissionInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current PermissionInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check PermissionInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current PermissionInfo</returns>
protected override object GetIdValue()
{
return _pid;
}
#endregion
#region Factory Methods
private PermissionInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal PermissionInfo(SafeDataReader dr)
/// <summary>
/// PermissionInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class PermissionInfo : ReadOnlyBase<PermissionInfo>
{
try
{
_pid = dr.GetInt32("PID");
_rid = dr.GetInt32("RID");
_permlevel = dr.GetInt32("PermLevel");
_versiontype = dr.GetInt32("VersionType");
_permvalue = dr.GetInt32("PermValue");
_permad = dr.GetInt32("PermAD");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("PermissionInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _pid;
[System.ComponentModel.DataObjectField(true, true)]
public int Pid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _pid;
}
}
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _rid;
}
}
private int _permlevel;
/// <summary>
/// 0 - Security, 1 - System, 2 - RO, 3 - Procdures, 4 - Sections, 5 - Steps, 6 - Comments
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int PermLevel
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _permlevel;
}
}
private int _versiontype;
/// <summary>
/// 0 - Working Draft, 1 - Temporary Change, 2 Approved
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int VersionType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _versiontype;
}
}
private int _permvalue;
/// <summary>
/// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All)
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int PermValue
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _permvalue;
}
}
private int _permad;
/// <summary>
/// 0 - Allow, 1 - Deny
/// </summary>
[System.ComponentModel.DataObjectField(true, true)]
public int Permad
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _permad;
}
}
private string _startdate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _startdate;
}
}
private string _enddate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _enddate;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base PermissionInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current PermissionInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check PermissionInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current PermissionInfo</returns>
protected override object GetIdValue()
{
return _pid;
}
#endregion
#region Factory Methods
private PermissionInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal PermissionInfo(SafeDataReader dr)
{
try
{
_pid = dr.GetInt32("PID");
_rid = dr.GetInt32("RID");
_permlevel = dr.GetInt32("PermLevel");
_versiontype = dr.GetInt32("VersionType");
_permvalue = dr.GetInt32("PermValue");
_permad = dr.GetInt32("PermAD");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("PermissionInfo", ex);
}
}
#endregion
} // Class
} // Namespace

View File

@@ -17,361 +17,353 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// PermissionRole Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class PermissionRole : BusinessBase<PermissionRole>
{
#region Business Methods
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _rid;
}
}
private string _name=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _name;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_name != value)
{
_name = value;
PropertyHasChanged();
}
}
}
private string _title=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _title;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_title != value)
{
_title = value;
PropertyHasChanged();
}
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged=new byte[8];//timestamp
// TODO: Check PermissionRole.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current PermissionRole</returns>
protected override object GetIdValue()
{
return _rid;
}
// TODO: Replace base PermissionRole.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current PermissionRole</returns>
//public override string ToString()
//{
// return base.ToString();
//}
#endregion
#region ValidationRules
protected override void AddBusinessRules()
{
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Name");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 50));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Title");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 250));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
#endregion
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Rid, "<Role(s)>");
//AuthorizationRules.AllowRead(Name, "<Role(s)>");
//AuthorizationRules.AllowWrite(Name, "<Role(s)>");
//AuthorizationRules.AllowRead(Title, "<Role(s)>");
//AuthorizationRules.AllowWrite(Title, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
internal static PermissionRole New(string name, string title)
/// <summary>
/// PermissionRole Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class PermissionRole : BusinessBase<PermissionRole>
{
return new PermissionRole(name, title);
}
#region Business Methods
internal static PermissionRole Get(SafeDataReader dr)
{
return new PermissionRole(dr);
}
private PermissionRole()
{
MarkAsChild();
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _rid;
}
}
private string _name = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _name;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_name != value)
{
_name = value;
PropertyHasChanged();
}
}
}
private string _title = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _title;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_title != value)
{
_title = value;
PropertyHasChanged();
}
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged = new byte[8];//timestamp
// TODO: Check PermissionRole.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current PermissionRole</returns>
protected override object GetIdValue()
{
return _rid;
}
// TODO: Replace base PermissionRole.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current PermissionRole</returns>
//public override string ToString()
//{
// return base.ToString();
//}
private PermissionRole(string name, string title)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_name = name;
_title = title;
}
#endregion
#region ValidationRules
private PermissionRole(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
protected override void AddBusinessRules()
{
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Name");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 50));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringRequired, "Title");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 250));
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
#endregion
#region Data Access Portal
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
private void Fetch(SafeDataReader dr)
{
try{
_rid = dr.GetInt32("RID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
}
catch(Exception ex)
{
Database.LogException("PermissionRole",ex);
}
MarkOld();
}
#endregion
internal void Insert(Permission permission,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Role.Add(cn, ref _rid, _name, _title, _dts, _usrid);
MarkOld();
}
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Rid, "<Role(s)>");
//AuthorizationRules.AllowRead(Name, "<Role(s)>");
//AuthorizationRules.AllowWrite(Name, "<Role(s)>");
//AuthorizationRules.AllowRead(Title, "<Role(s)>");
//AuthorizationRules.AllowWrite(Title, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
internal void Update(Permission permission,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Role.Update(cn, ref _rid, _name, _title, _dts, _usrid, ref _lastchanged);
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
internal void DeleteSelf(Permission permission,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Role.Remove(cn,_rid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
// The follwing is a sample Extension File. You can use it to create PermissionRoleExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
//namespace PatrialClass
//{
// public partial class PermissionRole
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
} // Class
internal static PermissionRole New(string name, string title)
{
return new PermissionRole(name, title);
}
internal static PermissionRole Get(SafeDataReader dr)
{
return new PermissionRole(dr);
}
private PermissionRole()
{
MarkAsChild();
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private PermissionRole(string name, string title)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_name = name;
_title = title;
}
private PermissionRole(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
#endregion
#region Data Access Portal
private void Fetch(SafeDataReader dr)
{
try
{
_rid = dr.GetInt32("RID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
}
catch (Exception ex)
{
Database.LogException("PermissionRole", ex);
}
MarkOld();
}
internal void Insert(Permission permission, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Role.Add(cn, ref _rid, _name, _title, _dts, _usrid);
MarkOld();
}
internal void Update(Permission permission, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Role.Update(cn, ref _rid, _name, _title, _dts, _usrid, ref _lastchanged);
}
internal void DeleteSelf(Permission permission, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Role.Remove(cn, _rid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
// The follwing is a sample Extension File. You can use it to create PermissionRoleExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
//namespace PatrialClass
//{
// public partial class PermissionRole
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -17,115 +17,110 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// RoleInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class RoleInfo : ReadOnlyBase<RoleInfo>
{
#region Business Methods
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _rid;
}
}
private string _name=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _name;
}
}
private string _title=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _title;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base RoleInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current RoleInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check RoleInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current RoleInfo</returns>
protected override object GetIdValue()
{
return _rid;
}
#endregion
#region Factory Methods
private RoleInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal RoleInfo(SafeDataReader dr)
/// <summary>
/// RoleInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class RoleInfo : ReadOnlyBase<RoleInfo>
{
try
{
_rid = dr.GetInt32("RID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("RoleInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _rid;
[System.ComponentModel.DataObjectField(true, true)]
public int Rid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _rid;
}
}
private string _name = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _name;
}
}
private string _title = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Title
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _title;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base RoleInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current RoleInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check RoleInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current RoleInfo</returns>
protected override object GetIdValue()
{
return _rid;
}
#endregion
#region Factory Methods
private RoleInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal RoleInfo(SafeDataReader dr)
{
try
{
_rid = dr.GetInt32("RID");
_name = dr.GetString("Name");
_title = dr.GetString("Title");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("RoleInfo", ex);
}
}
#endregion
} // Class
} // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -17,223 +17,209 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// UserInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class UserInfo : ReadOnlyBase<UserInfo>
{
#region Business Methods
private int _uid;
[System.ComponentModel.DataObjectField(true, true)]
public int Uid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _uid;
}
}
private string _userid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Userid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _userid;
}
}
private string _firstname=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string FirstName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _firstname;
}
}
private string _middlename=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string MiddleName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _middlename;
}
}
private string _lastname=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string LastName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _lastname;
}
}
private string _suffix=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Suffix
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _suffix;
}
}
private string _courtesytitle=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string CourtesyTitle
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _courtesytitle;
}
}
private string _phonenumber=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string PhoneNumber
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _phonenumber;
}
}
private string _cfgname=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string CfgName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _cfgname;
}
}
private string _userlogin=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string UserLogin
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _userlogin;
}
}
private string _username=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string UserName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _username;
}
}
private string _config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _config;
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
}
// TODO: Replace base UserInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current UserInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check UserInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current UserInfo</returns>
protected override object GetIdValue()
{
return _uid;
}
#endregion
#region Factory Methods
private UserInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal UserInfo(SafeDataReader dr)
/// <summary>
/// UserInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class UserInfo : ReadOnlyBase<UserInfo>
{
try
{
_uid = dr.GetInt32("UID");
_userid = dr.GetString("UserID");
_firstname = dr.GetString("FirstName");
_middlename = dr.GetString("MiddleName");
_lastname = dr.GetString("LastName");
_suffix = dr.GetString("Suffix");
_courtesytitle = dr.GetString("CourtesyTitle");
_phonenumber = dr.GetString("PhoneNumber");
_cfgname = dr.GetString("CFGName");
_userlogin = dr.GetString("UserLogin");
_username = dr.GetString("UserName");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch(Exception ex)
{
Database.LogException("UserInfo",ex);
}
}
#region Business Methods
#endregion
} // Class
private int _uid;
[System.ComponentModel.DataObjectField(true, true)]
public int Uid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _uid;
}
}
private string _userid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Userid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _userid;
}
}
private string _firstname = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string FirstName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _firstname;
}
}
private string _middlename = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string MiddleName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _middlename;
}
}
private string _lastname = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string LastName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _lastname;
}
}
private string _suffix = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Suffix
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _suffix;
}
}
private string _courtesytitle = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string CourtesyTitle
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _courtesytitle;
}
}
private string _phonenumber = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string PhoneNumber
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _phonenumber;
}
}
private string _cfgname = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string CfgName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _cfgname;
}
}
private string _userlogin = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string UserLogin
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _userlogin;
}
}
private string _username = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string UserName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _username;
}
}
private string _config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _config;
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
}
// TODO: Replace base UserInfo.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current UserInfo</returns>
//public override string ToString()
//{
// return base.ToString();
//}
// TODO: Check UserInfo.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current UserInfo</returns>
protected override object GetIdValue()
{
return _uid;
}
#endregion
#region Factory Methods
private UserInfo()
{ /* require use of factory methods */ }
#endregion
#region Data Access Portal
internal UserInfo(SafeDataReader dr)
{
try
{
_uid = dr.GetInt32("UID");
_userid = dr.GetString("UserID");
_firstname = dr.GetString("FirstName");
_middlename = dr.GetString("MiddleName");
_lastname = dr.GetString("LastName");
_suffix = dr.GetString("Suffix");
_courtesytitle = dr.GetString("CourtesyTitle");
_phonenumber = dr.GetString("PhoneNumber");
_cfgname = dr.GetString("CFGName");
_userlogin = dr.GetString("UserLogin");
_username = dr.GetString("UserName");
_config = dr.GetString("Config");
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
}
catch (Exception ex)
{
Database.LogException("UserInfo", ex);
}
}
#endregion
} // Class
} // Namespace

View File

@@ -17,496 +17,481 @@ using Csla.Data;
namespace Volian.Object.Library
{
/// <summary>
/// UserMembership Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class UserMembership : BusinessBase<UserMembership>
{
#region Business Methods
private int _ugid;
[System.ComponentModel.DataObjectField(true, true)]
public int Ugid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _ugid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _gid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (_gid != value)
{
_gid = value;
PropertyHasChanged();
}
}
}
private string _startdate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _startdate;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
_startdate = value;
try
{
DateTime tmp = SmartDate.StringToDate(value);
if (_startdate != tmp.ToShortDateString())
{
_startdate = tmp.ToShortDateString();
// TODO: Any Cross Property Validation
}
}
catch
{
}
PropertyHasChanged();
}
}
private string _enddate=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _enddate;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
_enddate = value;
try
{
DateTime tmp = SmartDate.StringToDate(value);
if (_enddate != tmp.ToShortDateString())
{
_enddate = tmp.ToShortDateString();
// TODO: Any Cross Property Validation
}
}
catch
{
}
PropertyHasChanged();
}
}
private DateTime _dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
CanWriteProperty(true);
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged=new byte[8];//timestamp
private string _group_groupname=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_GroupName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _group_groupname;
}
}
private int _group_grouptype;
[System.ComponentModel.DataObjectField(true, true)]
public int Group_GroupType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _group_grouptype;
}
}
private string _group_config=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _group_config;
}
}
private DateTime _group_dts=new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Group_Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _group_dts;
}
}
private string _group_usrid=string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _group_usrid;
}
}
// TODO: Check UserMembership.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current UserMembership</returns>
protected override object GetIdValue()
{
return _ugid;
}
// TODO: Replace base UserMembership.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current UserMembership</returns>
//public override string ToString()
//{
// return base.ToString();
//}
#endregion
#region ValidationRules
protected override void AddBusinessRules()
{
ValidationRules.AddRule(StartDateValid, "StartDate");
ValidationRules.AddRule(EndDateValid, "EndDate");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
private bool StartDateValid(object target, Csla.Validation.RuleArgs e)
{
try
{
DateTime tmp = SmartDate.StringToDate(_startdate);
}
catch
{
e.Description="Invalid Date";
return false;
}
return true;
}
private bool EndDateValid(object target, Csla.Validation.RuleArgs e)
{
try
{
DateTime tmp = SmartDate.StringToDate(_enddate);
}
catch
{
e.Description="Invalid Date";
return false;
}
return true;
}
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
#endregion
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Ugid, "<Role(s)>");
//AuthorizationRules.AllowRead(Gid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Gid, "<Role(s)>");
//AuthorizationRules.AllowRead(StartDate, "<Role(s)>");
//AuthorizationRules.AllowWrite(StartDate, "<Role(s)>");
//AuthorizationRules.AllowRead(EndDate, "<Role(s)>");
//AuthorizationRules.AllowWrite(EndDate, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
internal static UserMembership New(int gid)
/// <summary>
/// UserMembership Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
public partial class UserMembership : BusinessBase<UserMembership>
{
return new UserMembership(Volian.Object.Library.Group.Get(gid));
}
#region Business Methods
internal static UserMembership Get(SafeDataReader dr)
{
return new UserMembership(dr);
}
private UserMembership()
{
MarkAsChild();
_startdate = ext.DefaultStartDate;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private int _ugid;
[System.ComponentModel.DataObjectField(true, true)]
public int Ugid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _ugid;
}
}
private int _gid;
[System.ComponentModel.DataObjectField(true, true)]
public int Gid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _gid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_gid != value)
{
_gid = value;
PropertyHasChanged();
}
}
}
private string _startdate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string StartDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _startdate;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
_startdate = value;
try
{
DateTime tmp = SmartDate.StringToDate(value);
if (_startdate != tmp.ToShortDateString())
{
_startdate = tmp.ToShortDateString();
// TODO: Any Cross Property Validation
}
}
catch
{
}
PropertyHasChanged();
}
}
private string _enddate = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string EndDate
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _enddate;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
_enddate = value;
try
{
DateTime tmp = SmartDate.StringToDate(value);
if (_enddate != tmp.ToShortDateString())
{
_enddate = tmp.ToShortDateString();
// TODO: Any Cross Property Validation
}
}
catch
{
}
PropertyHasChanged();
}
}
private DateTime _dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _dts;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_dts != value)
{
_dts = value;
PropertyHasChanged();
}
}
}
private string _usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _usrid;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (value == null) value = string.Empty;
if (_usrid != value)
{
_usrid = value;
PropertyHasChanged();
}
}
}
private byte[] _lastchanged = new byte[8];//timestamp
private string _group_groupname = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_GroupName
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _group_groupname;
}
}
private int _group_grouptype;
[System.ComponentModel.DataObjectField(true, true)]
public int Group_GroupType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _group_grouptype;
}
}
private string _group_config = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _group_config;
}
}
private DateTime _group_dts = new DateTime();
[System.ComponentModel.DataObjectField(true, true)]
public DateTime Group_Dts
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _group_dts;
}
}
private string _group_usrid = string.Empty;
[System.ComponentModel.DataObjectField(true, true)]
public string Group_Usrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _group_usrid;
}
}
// TODO: Check UserMembership.GetIdValue to assure that the ID returned is unique
/// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary>
/// <returns>A Unique ID for the current UserMembership</returns>
protected override object GetIdValue()
{
return _ugid;
}
// TODO: Replace base UserMembership.ToString function as necessary
/// <summary>
/// Overrides Base ToString
/// </summary>
/// <returns>A string representation of current UserMembership</returns>
//public override string ToString()
//{
// return base.ToString();
//}
private UserMembership(Group group)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_startdate = ext.DefaultStartDate;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_gid = group.Gid;
_group_groupname = group.GroupName;
_group_grouptype = group.GroupType;
_group_config = group.Config;
_group_dts = group.Dts;
_group_usrid = group.Usrid;
}
#endregion
#region ValidationRules
private UserMembership(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
protected override void AddBusinessRules()
{
ValidationRules.AddRule(StartDateValid, "StartDate");
ValidationRules.AddRule(EndDateValid, "EndDate");
ValidationRules.AddRule(
Csla.Validation.CommonRules.StringMaxLength,
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Usrid", 100));
// TODO: Add other validation rules
}
#endregion
#region Data Access Portal
private bool StartDateValid(object target, Csla.Validation.RuleArgs e)
{
try
{
DateTime tmp = SmartDate.StringToDate(_startdate);
}
catch
{
e.Description = "Invalid Date";
return false;
}
return true;
}
private bool EndDateValid(object target, Csla.Validation.RuleArgs e)
{
try
{
DateTime tmp = SmartDate.StringToDate(_enddate);
}
catch
{
e.Description = "Invalid Date";
return false;
}
return true;
}
// Sample data comparison validation rule
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//{
// if (_started > _ended)
// {
// e.Description = "Start date can't be after end date";
// return false;
// }
// else
// return true;
//}
private void Fetch(SafeDataReader dr)
{
try{
_ugid = dr.GetInt32("UGID");
_gid = dr.GetInt32("GID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
_group_groupname = dr.GetString("Groups_GroupName");
_group_grouptype = dr.GetInt32("Groups_GroupType");
_group_config = dr.GetString("Groups_Config");
_group_dts = dr.GetDateTime("Groups_DTS");
_group_usrid = dr.GetString("Groups_UsrID");
}
catch(Exception ex)
{
Database.LogException("UserMembership",ex);
}
MarkOld();
}
#endregion
internal void Insert(User user,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Membership.Add(cn, ref _ugid, user.Uid, _gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid);
MarkOld();
}
#region Authorization Rules
protected override void AddAuthorizationRules()
{
//TODO: Who can read/write which fields
//AuthorizationRules.AllowRead(Ugid, "<Role(s)>");
//AuthorizationRules.AllowRead(Gid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Gid, "<Role(s)>");
//AuthorizationRules.AllowRead(StartDate, "<Role(s)>");
//AuthorizationRules.AllowWrite(StartDate, "<Role(s)>");
//AuthorizationRules.AllowRead(EndDate, "<Role(s)>");
//AuthorizationRules.AllowWrite(EndDate, "<Role(s)>");
//AuthorizationRules.AllowRead(Dts, "<Role(s)>");
//AuthorizationRules.AllowWrite(Dts, "<Role(s)>");
//AuthorizationRules.AllowRead(Usrid, "<Role(s)>");
//AuthorizationRules.AllowWrite(Usrid, "<Role(s)>");
}
internal void Update(User user,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged=Membership.Update(cn, ref _ugid, user.Uid, _gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged);
MarkClean();
}
public static bool CanAddObject()
{
// TODO: Can Add Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
internal void DeleteSelf(User user,SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Membership.Remove(cn,_ugid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual string DefaultStartDate
{
get { return DateTime.Now.ToShortDateString(); }
}
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
public static bool CanGetObject()
{
// TODO: CanGet Authorization
return true;
}
// The follwing is a sample Extension File. You can use it to create UserMembershipExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
public static bool CanDeleteObject()
{
// TODO: CanDelete Authorization
//bool result = false;
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
//return result;
return true;
}
//namespace PatrialClass
//{
// public partial class UserMembership
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual SmartDate DefaultStartDate
// {
// get { return DateTime.Now.ToShortDateString(); }
// }
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
public static bool CanEditObject()
{
// TODO: CanEdit Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager");
return true;
}
#endregion
#region Factory Methods
} // Class
internal static UserMembership New(int gid)
{
return new UserMembership(Volian.Object.Library.Group.Get(gid));
}
internal static UserMembership Get(SafeDataReader dr)
{
return new UserMembership(dr);
}
private UserMembership()
{
MarkAsChild();
_startdate = ext.DefaultStartDate;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
}
private UserMembership(Group group)
{
MarkAsChild();
// TODO: Add any initialization & defaults
_startdate = ext.DefaultStartDate;
_dts = ext.DefaultDts;
_usrid = ext.DefaultUsrid;
_gid = group.Gid;
_group_groupname = group.GroupName;
_group_grouptype = group.GroupType;
_group_config = group.Config;
_group_dts = group.Dts;
_group_usrid = group.Usrid;
}
private UserMembership(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
#endregion
#region Data Access Portal
private void Fetch(SafeDataReader dr)
{
try
{
_ugid = dr.GetInt32("UGID");
_gid = dr.GetInt32("GID");
_startdate = dr.GetSmartDate("StartDate").Text;
_enddate = dr.GetSmartDate("EndDate").Text;
_dts = dr.GetDateTime("DTS");
_usrid = dr.GetString("UsrID");
dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8);
_group_groupname = dr.GetString("Groups_GroupName");
_group_grouptype = dr.GetInt32("Groups_GroupType");
_group_config = dr.GetString("Groups_Config");
_group_dts = dr.GetDateTime("Groups_DTS");
_group_usrid = dr.GetString("Groups_UsrID");
}
catch (Exception ex)
{
Database.LogException("UserMembership", ex);
}
MarkOld();
}
internal void Insert(User user, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Membership.Add(cn, ref _ugid, user.Uid, _gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid);
MarkOld();
}
internal void Update(User user, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
_lastchanged = Membership.Update(cn, ref _ugid, user.Uid, _gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged);
MarkClean();
}
internal void DeleteSelf(User user, SqlConnection cn)
{
// if we're not dirty then don't update the database
if (!this.IsDirty) return;
// if we're new then don't update the database
if (this.IsNew) return;
Membership.Remove(cn, _ugid);
MarkNew();
}
#endregion
// Standard Default Code
// #region extension
Extension ext = new Extension();
[Serializable()]
partial class Extension : extensionBase
{
}
[Serializable()]
class extensionBase
{
// Default Values
public virtual string DefaultStartDate
{
get { return DateTime.Now.ToShortDateString(); }
}
public virtual DateTime DefaultDts
{
get { return DateTime.Now; }
}
public virtual string DefaultUsrid
{
get { return Environment.UserName.ToUpper(); }
}
// Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{
// Needs to be overriden to add new authorization rules
}
// Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{
// Needs to be overriden to add new validation rules
}
}
//#endregion
// The follwing is a sample Extension File. You can use it to create UserMembershipExt.cs
//using System;
//using System.Collections.Generic;
//using System.Text;
//using Csla;
//namespace PatrialClass
//{
// public partial class UserMembership
// {
// partial class Extension : extensionBase
// {
// TODO: Override automatic defaults
// public virtual SmartDate DefaultStartDate
// {
// get { return DateTime.Now.ToShortDateString(); }
// }
// public virtual DateTime DefaultDts
// {
// get { return DateTime.Now; }
// }
// public virtual string DefaultUsrid
// {
// get { return Environment.UserName.ToUpper(); }
// }
// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
// {
// //rules.AllowRead(Dbid, "<Role(s)>");
// }
// public new void AddValidationRules(Csla.Validation.ValidationRules rules)
// {
// rules.AddRule(
// Csla.Validation.CommonRules.StringMaxLength,
// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100));
// }
// }
// }
//}
} // Class
} // Namespace