From 46feeed669544b02674be07fc9bf0ffdc44e8940 Mon Sep 17 00:00:00 2001 From: mschill Date: Wed, 26 Aug 2026 10:14:05 -0400 Subject: [PATCH] Move to old repo --- .../myfile/Extension/ItemExt.cs | 2093 ----------------- PROMS/VEPROMS_Security/SimpleTest/App.config | 71 - PROMS/VEPROMS_Security/SimpleTest/Program.cs | 20 - .../SimpleTest/Properties/AssemblyInfo.cs | 33 - .../Volian.Object.Library.User.datasource | 10 - .../Properties/Resources.Designer.cs | 63 - .../SimpleTest/Properties/Resources.resx | 117 - .../Properties/Settings.Designer.cs | 26 - .../SimpleTest/Properties/Settings.settings | 7 - .../SimpleTest/SimpleTest.csproj | 105 - .../SimpleTest/frmMain.Designer.cs | 104 - PROMS/VEPROMS_Security/SimpleTest/frmMain.cs | 59 - .../VEPROMS_Security/SimpleTest/frmMain.resx | 123 - .../SimpleTest/frmUser.Designer.cs | 479 ---- PROMS/VEPROMS_Security/SimpleTest/frmUser.cs | 108 - .../VEPROMS_Security/SimpleTest/frmUser.resx | 162 -- PROMS/VEPROMS_Security/VEPROMS_Security.sln | 72 - .../Volian.Object.Library/Assignment.cs | 764 ------ .../Volian.Object.Library/AssignmentInfo.cs | 159 -- .../AssignmentInfoList.cs | 78 - .../Volian.Object.Library/Connection.cs | 764 ------ .../Volian.Object.Library/ConnectionFolder.cs | 432 ---- .../ConnectionFolders.cs | 85 - .../Volian.Object.Library/ConnectionInfo.cs | 162 -- .../ConnectionInfoList.cs | 78 - .../Volian.Object.Library/Database.cs | 83 - .../Volian.Object.Library/Folder.cs | 768 ------ .../Volian.Object.Library/FolderAssignment.cs | 567 ----- .../FolderAssignments.cs | 145 -- .../Volian.Object.Library/FolderInfo.cs | 159 -- .../Volian.Object.Library/FolderInfoList.cs | 78 - .../Volian.Object.Library/Group.cs | 715 ------ .../Volian.Object.Library/GroupAssignment.cs | 591 ----- .../Volian.Object.Library/GroupAssignments.cs | 145 -- .../Volian.Object.Library/GroupInfo.cs | 137 -- .../Volian.Object.Library/GroupInfoList.cs | 78 - .../Volian.Object.Library/GroupMembership.cs | 592 ----- .../GroupMembershipExt.cs | 15 - .../Volian.Object.Library/GroupMemberships.cs | 145 -- .../Volian.Object.Library/Membership.cs | 738 ------ .../Volian.Object.Library/MembershipInfo.cs | 148 -- .../MembershipInfoList.cs | 78 - .../Volian.Object.Library/Permission.cs | 837 ------- .../Volian.Object.Library/PermissionExt.cs | 91 - .../Volian.Object.Library/PermissionInfo.cs | 193 -- .../PermissionInfoList.cs | 78 - .../Volian.Object.Library/PermissionRole.cs | 369 --- .../Volian.Object.Library/PermissionRoles.cs | 85 - .../Properties/AssemblyInfo.cs | 35 - .../Volian.Object.Library/Role.cs | 691 ------ .../Volian.Object.Library/RoleAssignment.cs | 603 ----- .../Volian.Object.Library/RoleAssignments.cs | 145 -- .../Volian.Object.Library/RoleInfo.cs | 126 - .../Volian.Object.Library/RoleInfoList.cs | 78 - .../Volian.Object.Library/RolePermissinExt.cs | 39 - .../Volian.Object.Library/RolePermission.cs | 525 ----- .../RolePermissionExt.cs | 54 - .../Volian.Object.Library/RolePermissions.cs | 85 - .../Volian.Object.Library/User.cs | 944 -------- .../Volian.Object.Library/UserExt.cs | 15 - .../Volian.Object.Library/UserInfo.cs | 225 -- .../Volian.Object.Library/UserInfoList.cs | 78 - .../Volian.Object.Library/UserInfoListExt.cs | 17 - .../Volian.Object.Library/UserMembership.cs | 497 ---- .../Volian.Object.Library/UserMemberships.cs | 145 -- .../Volian.Object.Library.csproj | 102 - .../Volian.Object.Library/vlnValueKey.cs | 30 - PROMS/VEPROMS_Security/WinApp/App.config | 138 -- PROMS/VEPROMS_Security/WinApp/App.config test | 71 - .../VEPROMS_Security/WinApp/FolderTreeNode.cs | 86 - PROMS/VEPROMS_Security/WinApp/Program.cs | 20 - .../WinApp/Properties/AssemblyInfo.cs | 33 - .../Volian.Object.Library.Group.datasource | 10 - ...Object.Library.GroupAssignments.datasource | 10 - ...an.Object.Library.GroupInfoList.datasource | 10 - ...olian.Object.Library.Membership.datasource | 10 - ...ject.Library.MembershipInfoList.datasource | 10 - ...olian.Object.Library.PermLookup.datasource | 10 - .../Volian.Object.Library.Role.datasource | 10 - ...ian.Object.Library.RoleInfoList.datasource | 10 - .../Volian.Object.Library.User.datasource | 10 - ...ian.Object.Library.UserInfoList.datasource | 10 - .../WinApp/Properties/Resources.Designer.cs | 71 - .../WinApp/Properties/Resources.resx | 117 - .../WinApp/Properties/Settings.Designer.cs | 30 - .../WinApp/Properties/Settings.settings | 7 - PROMS/VEPROMS_Security/WinApp/WinApp.csproj | 164 -- .../WinApp/frmAssignmentSelect.Designer.cs | 172 -- .../WinApp/frmAssignmentSelect.cs | 109 - .../WinApp/frmAssignmentSelect.resx | 123 - .../WinApp/frmGroupSelect.Designer.cs | 117 - .../VEPROMS_Security/WinApp/frmGroupSelect.cs | 37 - .../WinApp/frmGroupSelect.resx | 123 - .../WinApp/frmGroups.Designer.cs | 523 ---- PROMS/VEPROMS_Security/WinApp/frmGroups.cs | 200 -- PROMS/VEPROMS_Security/WinApp/frmGroups.resx | 153 -- .../WinApp/frmMembership.Designer.cs | 317 --- .../VEPROMS_Security/WinApp/frmMembership.cs | 137 -- .../WinApp/frmMembership.resx | 156 -- .../WinApp/frmRoles.Designer.cs | 555 ----- PROMS/VEPROMS_Security/WinApp/frmRoles.cs | 211 -- PROMS/VEPROMS_Security/WinApp/frmRoles.resx | 153 -- .../WinApp/frmUser.Designer.cs | 574 ----- PROMS/VEPROMS_Security/WinApp/frmUser.cs | 216 -- PROMS/VEPROMS_Security/WinApp/frmUser.resx | 174 -- .../WinApp/frmUserSelect.Designer.cs | 117 - .../VEPROMS_Security/WinApp/frmUserSelect.cs | 37 - .../WinApp/frmUserSelect.resx | 123 - 108 files changed, 22607 deletions(-) delete mode 100644 PROMS/VEPROMS.CSLA.Library/myfile/Extension/ItemExt.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/App.config delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Program.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/AssemblyInfo.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/DataSources/Volian.Object.Library.User.datasource delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.resx delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.settings delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/SimpleTest.csproj delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmMain.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmMain.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmMain.resx delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmUser.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmUser.cs delete mode 100644 PROMS/VEPROMS_Security/SimpleTest/frmUser.resx delete mode 100644 PROMS/VEPROMS_Security/VEPROMS_Security.sln delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Assignment.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Connection.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolder.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolders.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Database.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Folder.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignment.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignments.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Group.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignment.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignments.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembership.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembershipExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/GroupMemberships.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Membership.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Permission.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/PermissionExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRole.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRoles.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Properties/AssemblyInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Role.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignment.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignments.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissinExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RolePermission.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissionExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissions.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/User.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserInfo.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoList.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoListExt.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserMembership.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/UserMemberships.cs delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/Volian.Object.Library.csproj delete mode 100644 PROMS/VEPROMS_Security/Volian.Object.Library/vlnValueKey.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/App.config delete mode 100644 PROMS/VEPROMS_Security/WinApp/App.config test delete mode 100644 PROMS/VEPROMS_Security/WinApp/FolderTreeNode.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/Program.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/AssemblyInfo.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Group.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupAssignments.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupInfoList.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Membership.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.MembershipInfoList.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.PermLookup.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Role.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.RoleInfoList.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.User.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.UserInfoList.datasource delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/Resources.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/Resources.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/Settings.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/Properties/Settings.settings delete mode 100644 PROMS/VEPROMS_Security/WinApp/WinApp.csproj delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroupSelect.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroupSelect.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroupSelect.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroups.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroups.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmGroups.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmMembership.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmMembership.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmMembership.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmRoles.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmRoles.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmRoles.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUser.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUser.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUser.resx delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUserSelect.Designer.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUserSelect.cs delete mode 100644 PROMS/VEPROMS_Security/WinApp/frmUserSelect.resx diff --git a/PROMS/VEPROMS.CSLA.Library/myfile/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/myfile/Extension/ItemExt.cs deleted file mode 100644 index 23ce25ec..00000000 --- a/PROMS/VEPROMS.CSLA.Library/myfile/Extension/ItemExt.cs +++ /dev/null @@ -1,2093 +0,0 @@ -#define ItemWithContent - -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using System.Data; -using System.Data.SqlClient; -using System.Xml; -using System.Drawing; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - #region Item - public partial class Item : IVEDrillDown - { - public static void ShowAllocated(string title) - { - Console.WriteLine("{0} - {1} Items in the dictionary", title, _CacheByPrimaryKey.Count); - foreach (List itmlst in _CacheByPrimaryKey.Values) - foreach(Item itm in itmlst) - Console.WriteLine("Item {0} UniqueID {1}", itm.ItemID, itm.MyItemUnique); - Console.WriteLine("- - - - - -"); - } - - public override string ToString() - { - return string.Format("{0} {1}", MyContent.Number, MyContent.Text).Trim(); - } - // TODO: Move to ItemInfo Extension - - #region IVEDrillDown - public System.Collections.IList GetChildren() - { - return this.MyContent.ContentParts; - } - public bool HasChildren - { - get { return this.MyContent.ContentPartCount > 0; } - } - public Item MyProcedure - { - get - { - // Walk up active parents until the parent is not an item - Item tmp = this; - while (tmp.ActiveParent.GetType() != typeof(DocVersion)) tmp = (Item)tmp.ActiveParent; - return tmp; - } - } private IVEDrillDown _ActiveParent = null; - public IVEDrillDown ActiveParent - { - get - { - if (_ActiveParent == null) - { - if (MyPrevious != null) - _ActiveParent = _MyPrevious.ActiveParent; - else - { - if (ItemDocVersionCount > 0) - _ActiveParent = this.ItemDocVersions[0].MyDocVersion; - else - { - if (this.ItemParts == null || this.ItemPartCount == 0) - _ActiveParent = this; - else - _ActiveParent = this.ItemParts[0].MyContent.ContentItems[0].MyItem; - } - } - } - return _ActiveParent == this ? null : _ActiveParent; - } - } - private Format _ActiveFormat = null;// Added to cache ActiveFormat - public Format ActiveFormat - { - get - { - if (_ActiveFormat == null) - _ActiveFormat = (LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat); - return _ActiveFormat; - } - set - { - _ActiveFormat = null; // Reset - } - } - public Format LocalFormat - { - get { return MyContent.MyFormat; } - } - public ConfigDynamicTypeDescriptor MyConfig - { - get { return null; } - } - #endregion - public void MoveItem(IVEDrillDownReadOnly pInfo, int index) - { - bool wasfirstchild = false; - ItemInfo parentInfo = pInfo as ItemInfo; - DocVersionInfo parentInfoDV = pInfo as DocVersionInfo; - IList children = null; - E_FromType partType = 0; // this is needed later to determine sub-group type. - if (parentInfo != null) - { - // this may have subgroups, need to use part type to get children list... - ItemInfo thisinfo = ItemInfo.Get(ItemID); - partType = thisinfo.FirstSibling.ItemParts[0].PartType; - children = (IList)parentInfo.Lookup((int)partType); - } - else - children = (IList)parentInfoDV.GetChildren(); - int numChild = children.Count; - - if (this.MyPrevious == null) wasfirstchild = true; - Item origNextItem = null; - - // First, remove from this item from its list. To do this, get the current item's next point and redirect it's myprevious - // to this item's previous... - if (NextItems != null && NextItems.Count > 0) - { - origNextItem = NextItems.Items[0]; - origNextItem.MyPrevious = this.MyPrevious; - this.Save(); - } - - // check to see if the item is being moved into the middle of some items. newPreviousItem is the item defined - // by index-1, i.e. inserting below newPreviousItem. - ItemInfo newPreviousInfo = (index == 0) ? null : children[index - 1]; - ItemInfo newNextInfo = (index == children.Count) ? null : children[index]; - - // Adjust the new next proc to be me. - if (newNextInfo != null) - { - using (Item newNextItem = newNextInfo.Get()) - { - newNextItem.MyPrevious = this; - newNextItem.Save().Dispose(); - } - } - - // adjust the previous node, i.e. may either be at same level or, if first in list, adjust the parent... - // if 'newPreviousItem' isn't null, then adding to the middle of the list. - if (newPreviousInfo != null) - { - using (Item newPreviousItem = newPreviousInfo.Get()) - { - MyPrevious = newPreviousItem; - Save(); - } - } - // newPreviousInfo == null if moving into first child, and wasfirstchild == true if moving out of first child. - // This will require adjusting the DocVersion to point to the correct first child if a procedure is moved. - if (newPreviousInfo == null || wasfirstchild) - { - if (parentInfo != null) // Moving Item within procedure, i.e. moving a section or step - { - using (Item parentItem = parentInfo.Get()) - { - // moving first child out... reset parent to point to the original next item - if (wasfirstchild) - parentItem.MyContent.ContentParts[(int)partType].MyItem = origNextItem; - else - parentItem.MyContent.ContentParts[(int)partType].MyItem = this; - parentItem.Save().Dispose(); - } - } - else if (parentInfoDV != null) // Moving Item (Procedure) within DocVersion - { - using (DocVersion parentItemDV = parentInfoDV.Get()) - { - ItemInfo firstinfo = parentInfoDV.FirstChild(); - parentItemDV.MyItem = wasfirstchild?parentInfoDV.Procedures[1].Get():this; - parentItemDV.Save().Dispose(); - if (!wasfirstchild && firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - firstchild.MyPrevious = this; - firstchild.Save().Dispose(); - } - } - } - } - if (!wasfirstchild) - { - this.MyPrevious = null; - this.Save(); - } - if (origNextItem != null) origNextItem.Dispose(); - if (parentInfo != null) - parentInfo.MyContent.RefreshContentParts(); - if (parentInfoDV != null) - parentInfoDV.ResetProcedures(); - } - - } - protected static int MakeNewItem(IVEDrillDownReadOnly parentInfoDD, ItemInfo previousInfo, string number, string title, int type, E_FromType partType) - { - int newitemid = 0; - if (parentInfoDD == null) - parentInfoDD = previousInfo.ActiveParent; - ItemInfo parentInfo = parentInfoDD as ItemInfo; - DocVersionInfo parentInfoDV = parentInfoDD as DocVersionInfo; - using (Content cont = Content.New(number, title, type, null, null)) - { - using (Item fromitem = previousInfo == null ? null : previousInfo.Get()) - { - ItemInfo nextInfo = null; // Check to see if the item is being inserted in the middle of some items. - if (previousInfo != null && previousInfo.NextItems != null && previousInfo.NextItems.Count > 0) - nextInfo = previousInfo.NextItems[0]; - using (Item itm = Item.MakeItem(fromitem, cont)) - { - newitemid = itm.ItemID; - if (nextInfo != null) - { - using (Item nextItem = nextInfo.Get()) - { - nextItem.MyPrevious = itm;// Aim the next item back at the new item. - nextItem.Save().Dispose(); - } - } - if (fromitem == null) - { - if (parentInfo != null) // Adding Item to Procedure, Section or Step - { - using (Item parentItem = parentInfo.Get()) - { - ItemInfo firstinfo = parentInfo.FirstChild(partType); - if (firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - parentItem.MyContent.ContentParts[(int)partType].MyItem = itm;// First update the parent to point to the new first child - parentItem.Save().Dispose(); - firstchild.MyPrevious = itm;// Aim the old first child to point to the new first child. - firstchild.Save().Dispose(); - } - } - else - { - parentItem.MyContent.ContentParts.Add((int)partType, itm);// update the parent to point to the new first child - parentItem.Save().Dispose(); - } - } - } - if (parentInfoDV != null) // Adding Item (Procedure) to DocVersion - { - using (DocVersion parentItemDV = parentInfoDV.Get()) - { - ItemInfo firstinfo = parentInfoDV.FirstChild(); - parentItemDV.MyItem = itm;// First update the parent to point to the new first child - parentItemDV.Save().Dispose(); - if (firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - firstchild.MyPrevious = itm;// Aim the old first child to point to the new first child. - firstchild.Save().Dispose(); - } - } - } - } - - } - } - } - } - if (parentInfo != null) - parentInfo.MyContent.RefreshContentParts(); - if (parentInfoDV != null) - parentInfoDV.ResetProcedures(); - return newitemid; - } - } - #endregion - #region ItemInfo - public partial class ItemInfo:IVEDrillDownReadOnly - { - protected void ExtensionRefreshFields(Item tmp) - { - _ActiveParent = null; - } - #region LoadAtOnce2 - public static ItemInfo GetItemAndChildren2(int? itemID) - { - try - { - ItemInfo tmp = DataPortal.Fetch(new ItemAndChildrenCriteria2(itemID)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetItemAndChildren2", ex); - } - } - // Criteria to get Item and children - [Serializable()] - private class ItemAndChildrenCriteria2 - { - public ItemAndChildrenCriteria2(int? itemID) - { - _ItemID = itemID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - // Data Portal to Get Item and Children - private void DataPortal_Fetch(ItemAndChildrenCriteria2 criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - SpinThroughChildren(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - RemoveFromCache(this); - } - private void SpinThroughChildren() - { - if(MyContent.ContentPartCount > 0) - foreach(PartInfo partInfo in MyContent.ContentParts) - foreach (ItemInfo itemInfo in partInfo.MyItems) - itemInfo.SpinThroughChildren(); - } - #endregion - #region LoadAtOnce - // Method to Get Item and children - public static ItemInfo GetItemAndChildren(int? itemID,int? parentID) - { - try - { - ItemInfo tmp = DataPortal.Fetch(new ItemAndChildrenCriteria(itemID,parentID)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - // Criteria to get Item and children - [Serializable()] - private class ItemAndChildrenCriteria - { - public ItemAndChildrenCriteria(int? itemID, int? parentID) - { - _ItemID = itemID; - _ParentID = parentID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int? _ParentID; - public int? ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - // Data Portal to Get Item and Children - private void DataPortal_Fetch(ItemAndChildrenCriteria criteria) - { - //ItemInfo tmp = null; - Dictionary lookup = new Dictionary(); ; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_ListItemAndChildren"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - if (dr.GetInt32("Level")==0) - { - //tmp = itemInfo; - ReadData(dr); - AddContent(dr); - lookup[this.ItemID] = this; - } - else - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - case 2: - itemInfo = new StepInfo(dr); - break; - } - // Load Children - itemInfo.AddContent(dr); - ItemInfo parent = lookup[dr.GetInt32("ParentID")]; - itemInfo._ActiveParent = parent; - itemInfo._ActiveSection = (itemInfo.IsSection ? itemInfo : parent._ActiveSection); - parent.AddPart(dr, itemInfo); - lookup.Add(itemInfo.ItemID, itemInfo); - } - } - //Console.WriteLine("I'm here {0}",this.MyContent.ContentPartCount); - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - } - private void AddPart(SafeDataReader dr, ItemInfo itemInfo) - { - // Either a new PartInfo or an existing PartInfo - if (dr.IsDBNull(dr.GetOrdinal("PreviousID"))) - { - //PartInfo prt = new PartInfo(dr, itemInfo); - _MyContent.AddPart(dr, itemInfo); - } - else - { - foreach (PartInfo pi in MyContent.ContentParts) - { - if (dr.GetInt32("FromType") == (int)pi.PartType) - { - if (pi._MyItems == null) - pi._MyItems = new ItemInfoList(itemInfo); - else - pi.MyItems.AddItem(itemInfo); - } - } - } - } - #endregion - public bool IsCautionStructure - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Caution)); - } - } - public bool IsNoteStructure - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Note)); - } - } - - public bool IsCautionStructureFirstSib - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Caution)); - } - } - public bool IsNoteStructureFirstSib - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Note)); - } - } - - public bool IsType(string type) - { - int stepType = ((int)MyContent.Type) % 10000; - StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList; - StepData sd = sdlist[stepType]; - // TODO: RHM20071115 while (sd.Index != 0) - // TODO: RHM20071115 { - // TODO: RHM20071115 if (sd.Type == type) return true; - // TODO: RHM20071115 sd = sdlist[sd.ParentType]; - // TODO: RHM20071115 } - return false; - } - public bool IsCaution - { - get - { - return IsType("CAUTION"); - } - } - public bool IsNote - { - get - { - return IsType("NOTE"); - } - } - public bool IsTable - { - get - { - return IsType("TABLE"); - } - } - public bool IsFigure - { - get - { - return IsType("FIGURE"); - } - } - public bool IsOr - { - get - { - return IsType("OR"); - } - } - public bool IsAnd - { - get - { - return IsType("AND"); - } - } - public bool IsEquipmentList - { - get - { - return IsType("EQUIPMENTLIST"); - } - } - public bool IsTitle - { - get - { - return IsType("TITLE"); - } - } - public bool IsAccPages - { - get - { - return IsType("ACCPAGES"); - } - } - public bool IsParagraph - { - get - { - return IsType("PARAGRAPH"); - } - } - public bool IsDefault - { - get - { - return IsType("DEFAULT"); - } - } - public bool IsContAcSequential - { - get - { - return IsType("CONTACSEQUENTIAL"); - } - } - public bool IsHigh - { - get - { - // check to see if ActiveParent is a section, if so it is a high level step - if (MyContent.Type / 10000 != 2) return false; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - if ((parent.MyContent.Type / 10000) == 1) - return true; - return false; - } - } - public bool IsSequential - { - get - { - if (((MyContent.Type / 10000) == 2) && ((((int)MyContent.Type) % 10000) == 1)) return true; - return false; - } - } - public bool IsRNO - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.RNO)); - } - } - public bool IsInRNO - { - get - { - if (IsHigh) return false; - if (IsRNO) return true; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - return parent.IsInRNO; - } - } - public int RNOLevel - { - get - { - return ((IsProcedure || IsSection || IsHigh)?0:(IsRNO?1:0)+((ItemInfo)ActiveParent).RNOLevel); - } - } - public int Columns - { - get - { - // check config value on my section, if null/default use Pmode of active format - SectionInfo si = SectionInfo.Get(ActiveSection.ItemID); //ActiveSection as SectionInfo; - if (si != null) - { - if (si.SectionConfig.Section_ColumnMode != SectionConfig.SectionColumnMode.Default) - return (int)si.SectionConfig.Section_ColumnMode; - } - return ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PMode ?? 2; - } - } - /// - /// FormatStepType - Maps to step type in format file. All types map directly from step type in content - /// to step type in format except rno. The '39' is the RNO index in the format file. Note that we - /// could loop through the format's stepdata to find rnotype if we want this to be more flexible? - /// - public int FormatStepType - { - get - { - if (IsRNO) return 40; - else return (((int)MyContent.Type) % 10000); - } - } - /// - /// - /// - public StepData FormatStepData - { - get - { - if (IsRNO) return ActiveFormat.PlantFormat.FormatData.StepDataList[40]; - int typ = (int)MyContent.Type - 20000; - foreach (StepData sd in ActiveFormat.PlantFormat.FormatData.StepDataList) - { - if (sd.Index == typ) return sd; - } - return null; - } - } - public ItemInfo FirstSibling - { - get - { - ItemInfo temp = this; - while (temp.MyPrevious != null) temp = temp.MyPrevious; - return temp; - } - } - public ItemInfo LastSibling - { - get - { - ItemInfo temp = this; - while (temp.NextItems != null) temp = temp.NextItems[0]; - return temp; - } - } - public ItemInfo LastChild(E_FromType partType) - { - ItemInfoList myitems = Lookup((int)partType); - if (myitems !=null) return myitems[myitems.Count-1]; - return null; - } - public ItemInfo FirstChild(E_FromType partType) - { - ItemInfoList myitems = Lookup((int)partType); - if (myitems != null) return myitems[0]; - return null; - } - public bool IsSubStep - { - get - { - ItemInfo temp = FirstSibling; - return ((temp.ItemPartCount > 0) && (temp.ItemParts[0].PartType == E_FromType.Step)); - } - } - public bool IsInSubStep - { - get - { - if (IsHigh) return false; - if (IsSubStep) return true; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - return parent.IsInSubStep; - } - } - public bool IsInFirstLevelSubStep - { - get - { - ItemInfo temp = FirstSibling; - if(temp.ActiveParent.GetType() == typeof(VEPROMS.CSLA.Library.DocVersionInfo))return false; - while (((ItemInfo)temp.ActiveParent).IsHigh == false) temp = ((ItemInfo)temp.ActiveParent).FirstSibling; - return temp.IsSubStep; - } - } - public bool IsStepSection - { - get - { - if (MyContent.Type == 10000) return true; - return false; - } - } - public bool IsSection - { - get - { - if ((MyContent.Type / 10000) == 1) return true; - return false; - } - } - public bool IsDefaultSection - { - get - { - // check to see if ActiveParent is a section, if so it is a high level step - if (MyContent.Type / 10000 != 1) return false; - // get procedure section and then - ItemInfo parent = (ItemInfo)ActiveParent; - if (!parent.IsProcedure) return false; - ProcedureConfig pc = (ProcedureConfig)parent.MyConfig; - int sectstartid = -1; - string ss = pc == null ? null : pc.SectionStart; - if (ss != null) sectstartid = System.Convert.ToInt32(ss); - else return false; - if (ItemID == sectstartid) return true; - return false; - } - } - public bool IsProcedure - { - get - { - if ((MyContent.Type / 10000) == 0) return true; - return false; - } - } - public bool IsStep - { - get - { - if ((MyContent.Type / 10000) == 2) return true; - return false; - } - } - private E_FromType ItemType - { - get - { - if (MyContent.Type == 0) return E_FromType.Procedure; - if (MyContent.Type < 20000) return E_FromType.Section; - return E_FromType.Step; - } - } - public Item GetByType() - { - Item tmp = null; - switch (ItemType) - { - case E_FromType.Procedure: - tmp = Procedure.Get(_ItemID); - break; - //case E_FromType.Section: - // itemInfo = new Section(dr); - // break; - //default: - // itemInfo = new Step(dr); - // break; - } - return tmp; - } - private int? _Ordinal; - public int Ordinal - { - get - { - if (_Ordinal == null) - { - if (MyPrevious != null) - _Ordinal = MyPrevious.Ordinal + 1; - else - _Ordinal = 1; - } - return (int) _Ordinal; - } - } - public string CslaType - { get { return this.GetType().FullName; } } - public override string ToString() - { - //Item editable = Item.GetExistingByPrimaryKey(_ItemID); - //return string.Format("{0}{1} {2}", (editable == null ? "" : (editable.IsDirty ? "* " : "")), - // (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : MyContent.Number), MyContent.Text); - ContentInfo cont = MyContent; - string number = cont.Number; - if (cont.Type >= 20000) number = Ordinal.ToString() + "."; - return string.Format("{0} {1}", number, cont.Text).Trim(); - //return string.Format("{0} {1}", cont.Number, cont.Text); - //return "Now is the time for all good men to come to the aid of their country!"; - } - //public string ToString(string str,System.IFormatProvider ifp) - //{ - // return ToString(); - //} - public string nz(string str, string def) - { - return (str == null ? def : str); - } - internal string _SearchDVPath; - public string SearchDVPath - { - get { return _SearchDVPath; } - } - internal string _SearchPath; - public string SearchPath - { - get { return _SearchPath; } - } - public string ShortSearchPath - { - get { return Regex.Replace(_SearchPath, "\x11.*?\x07", "\x07"); } - } - internal int _SearchAnnotationID; - public int SearchAnnotationID - { - get { return _SearchAnnotationID; } - } - internal string _SearchAnnotationText; - public string SearchAnnotationText - { - get { return _SearchAnnotationText; } - } - internal string _SearchAnnotationType; - public string SearchAnnotationType - { - get { return _SearchAnnotationType; } - } - public string DisplayText - { - get { return ConvertToDisplayText(MyContent.Text); } - } - public static string ConvertToDisplayText(string txt) - { - string retval = txt; - retval = StripRtfFormatting(retval); - retval = StripLinks(retval); - retval = ReplaceSpecialCharacters(retval); - return retval; - } - private static string StripRtfFormatting(string rtf) - { - string retval = rtf; - retval = Regex.Replace(retval, @"\\b0 ?", ""); - retval = Regex.Replace(retval, @"\\b ?", ""); - retval = Regex.Replace(retval, @"\\ul0 ?", ""); - retval = Regex.Replace(retval, @"\\ul ?", ""); - retval = Regex.Replace(retval, @"\\i0 ?", ""); - retval = Regex.Replace(retval, @"\\i ?", ""); - retval = Regex.Replace(retval, @"\\super ?", ""); - retval = Regex.Replace(retval, @"\\sub ?", ""); - retval = Regex.Replace(retval, @"\\nosupersub ?", ""); - return retval; - } - private static string StripLinks(string rtf) - { - string retval = rtf; - retval = Regex.Replace(retval, @"\\v.*?\\v0", ""); - retval = retval.Replace("\u252C", "");// Unicode 9516 Transition - retval = retval.Replace("\u2566", "");// Unicode 9574 Transition - retval = retval.Replace("\u0015", "");// Unicode 21 RO - return retval; - } - private static string ReplaceSpecialCharacter(Match m) - { - StringBuilder sb = new StringBuilder(); - int i = int.Parse(m.ToString().Substring(2,m.ToString().Length-3)); - sb.Append((char)i); - return sb.ToString(); - } - private static string ReplaceSpecialHexCharacter(Match m) - { - StringBuilder sb = new StringBuilder(); - int i = int.Parse(m.ToString().Substring(2), System.Globalization.NumberStyles.HexNumber); - sb.Append((char)i); - return sb.ToString(); - } - private static string ReplaceSpecialCharacters(string rtf) - { - string retval = rtf; - retval = retval.Replace("`", "\u00BA");// Degree - retval = Regex.Replace(retval, @"\\u[0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter)); - retval = Regex.Replace(retval, @"\\'[0-9A-Fa-f][0-9A-Fa-f]", new MatchEvaluator(ReplaceSpecialHexCharacter)); - return retval; - } - public string Path - { - get - { - string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : (nz(MyContent.Number,"")==""? MyContent.Text: MyContent.Number)); - ItemInfo parent = this; - while (parent.MyPrevious != null) parent = parent.MyPrevious; - if (parent.ItemPartCount == 0) - return number + ", " + MyContent.Text; - else - { - PartInfo partInfo = parent.ItemParts[0]; - return partInfo.MyContent.ContentItems.Items[0].Path + " " + ((E_FromType)partInfo.FromType).ToString() + " " + number; - } - } - } - public ContentInfo ParentContent - { - get - { - string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : (nz(MyContent.Number, "") == "" ? MyContent.Text : MyContent.Number)); - ItemInfo parent = this; - while (parent.MyPrevious != null) parent = parent.MyPrevious; - if (parent.ItemPartCount == 0) - return null; - else - { - return parent.ItemParts[0].MyContent; - } - } - } - public ItemInfo MyParent - { - get - { - //if (ItemDocVersionCount > 0) return ItemDocVersions[0]; Need to create one interface to support Folders, DocVersions and Items - ContentInfo parentContent = ParentContent; - if (parentContent == null || parentContent.ContentItemCount == 0) return null; - return parentContent.ContentItems[0]; - } - } - private ItemInfoList Lookup(int fromType, ref ItemInfoList itemInfoList) - { - if (itemInfoList == null) - itemInfoList = Lookup(fromType); - return itemInfoList; - } - internal ItemInfoList Lookup(int fromType) - { - ItemInfoList itemInfoList = null; - if (MyContent.ContentPartCount != 0) - foreach (PartInfo partInfo in MyContent.ContentParts) - if (partInfo.FromType == fromType) - { - itemInfoList = partInfo._MyItems = ItemInfoList.GetList(partInfo.ItemID, partInfo.FromType); - return itemInfoList; - } - return null; - } - public static void ResetParts(int itemID) - { - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo itm in _CacheByPrimaryKey[key]) - itm.ResetParts(); - } - public void ResetParts() - { - _Procedures = null; - _Sections = null; - _Cautions = null; - _Notes = null; - _RNOs = null; - _Steps = null; - _Tables = null; - } - private ItemInfoList _Procedures; - public ItemInfoList Procedures - { get { return Lookup(1,ref _Procedures); } } - private ItemInfoList _Sections; - public ItemInfoList Sections - { get { return Lookup(2,ref _Sections); } } - private ItemInfoList _Cautions; - public ItemInfoList Cautions - { get { return Lookup(3,ref _Cautions); } } - private ItemInfoList _Notes; - public ItemInfoList Notes - { get { return Lookup(4,ref _Notes); } } - private ItemInfoList _RNOs; - public ItemInfoList RNOs - { get { return Lookup(5,ref _RNOs); } } - private ItemInfoList _Steps; - public ItemInfoList Steps - { get { return Lookup(6,ref _Steps); } } - private ItemInfoList _Tables; - public ItemInfoList Tables - { get { return Lookup(7,ref _Tables); } } - //public XmlDocument ToXml() - //{ - // XmlDocument retval = new XmlDocument(); - // retval.LoadXml(""); - // return ToXml(retval.DocumentElement); - //} - //public void AddList(XmlNode xn,string name, ItemInfoList itemInfoList) - //{ - // if (itemInfoList != null) - // { - // XmlNode nd = xn.OwnerDocument.CreateElement(name); - // xn.AppendChild(nd); - // itemInfoList.ToXml(xn); - // } - //} - //public XmlDocument ToXml(XmlNode xn) - //{ - // XmlNode nd = MyContent.ToXml(xn); - // // Now add the children - // AddList(nd, "Procedures", Procedures); - // AddList(nd, "Sections", Sections); - // AddList(nd, "Cautions", Cautions); - // AddList(nd, "Notes", Notes); - // AddList(nd, "RNOs", RNOs); - // AddList(nd, "Steps", SubItems); - // AddList(nd, "Tables", Tables); - // return xn.OwnerDocument; - //} - public string TabToolTip - { - get - { - if (MyContent.MyEntry == null) - return MyContent.Number + " - " + MyContent.Text; - string toolTip = MyProcedure.TabToolTip + "\r\n"; - if (MyContent.Number != "") - toolTip += MyContent.Number + " - " + MyContent.Text; - else - toolTip += MyContent.Text; - DocumentInfo myDocument = MyContent.MyEntry.MyDocument; - if (myDocument.LibTitle != "") - { - toolTip += string.Format("\r\n(Library Document - {0})", myDocument.LibTitle); - toolTip += myDocument.LibraryDocumentUsage; - } - return toolTip; - } - } - public string TabTitle - { - get - { - if (MyContent.MyEntry == null) - return MyContent.Number; - if (MyContent.Number != "") - return MyContent.Number; - if (MyContent.Text.Length <= 10) - return MyContent.Text; - return MyContent.Text.Split(" ,.;:-_".ToCharArray())[0] + "..."; - } - } - #region IVEReadOnlyItem - PartInfoList _PartInfoList; - public System.Collections.IList GetChildren() - { - _PartInfoList = this.MyContent.ContentParts; - if (_PartInfoList.Count == 1 && ( _PartInfoList[0].ToString() == "Sections" || _PartInfoList[0].ToString() == "Steps")) - return _PartInfoList[0].GetChildren(); - return _PartInfoList; - } - public System.Collections.IList GetChildren(bool allParts) - { - _PartInfoList = this.MyContent.ContentParts; - if (allParts) - { - if (_PartInfoList.Count == 1 && (_PartInfoList[0].ToString() == "Sections" || _PartInfoList[0].ToString() == "Steps")) - return _PartInfoList[0].GetChildren(); - return _PartInfoList; - } - else // Steps and Sections only - { - for(int i = 0;i<_PartInfoList.Count;i++) - if(_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps") - return _PartInfoList[i].GetChildren(); - return null; - } - } - //public bool ChildrenAreLoaded - //{ - // get { return _PartInfoList == null; } - //} - public bool HasChildren - { - get { return this.MyContent.ContentPartCount > 0; } - } - public bool HasWordContent - { - get { return this.MyContent.MyEntry != null; } - } - public bool HasStepContent - { - get - { - if (MyContent.ContentPartCount == 0) return false; - if (MyContent.ContentPartCount == 1 && MyContent.ContentParts[0].PartType == E_FromType.Section) return false; - return true; - } - } - - public ItemInfo MyProcedure - { - get - { - // Walk up active parents until the parent is not an item - ItemInfo tmp = this; - while (tmp.ActiveParent != null && tmp.ActiveParent.GetType() != typeof(DocVersionInfo)) - tmp = (ItemInfo)tmp.ActiveParent; - return tmp; - } - } - private IVEDrillDownReadOnly _ActiveParent = null; - public IVEDrillDownReadOnly MyActiveParent { get { return _ActiveParent; } } - public IVEDrillDownReadOnly ActiveParent - { - get - { - //if (_ActiveParent == this)_ActiveParent = null; - if (_ActiveParent == null) - { - if (MyPrevious != null) - _ActiveParent = _MyPrevious.ActiveParent; - else - { - if (this.ItemDocVersions != null && this.ItemDocVersions.Count > 0) - _ActiveParent = this.ItemDocVersions[0]; - else - { - ContentInfo parentContent = ParentContent; - if (parentContent == null || parentContent.ContentItemCount == 0) - _ActiveParent = this; - else - _ActiveParent = parentContent.ContentItems[0]; - } - } - } - return _ActiveParent==this ? null : _ActiveParent; - } - internal set - //set - { - _ActiveParent = value; - } - } - private ItemInfo _ActiveSection = null; - public ItemInfo MyActiveSection { get { return _ActiveSection; } } - public ItemInfo ActiveSection - { - get - { - if (_ActiveSection == null) - { - if (IsSection) - _ActiveSection = this; - else - { - ItemInfo parent = ActiveParent as ItemInfo; - if (parent != null) - _ActiveSection = parent.ActiveSection; - else - _ActiveSection = this; - } - } - return _ActiveSection.IsSection ? _ActiveSection : null; - } - set - { - _ActiveSection = value; - } - } - private FormatInfo _ActiveFormat = null; - public FormatInfo ActiveFormat - { - get - { - if (_ActiveFormat == null) - _ActiveFormat = (LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat); - return _ActiveFormat; - } - //get { return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; } - } - public FormatInfo LocalFormat - { - get { return MyContent.MyFormat; } - } - private ConfigDynamicTypeDescriptor _MyConfig=null; - public ConfigDynamicTypeDescriptor MyConfig - { - get - { - if (_MyConfig == null) - { - switch (MyContent.Type / 10000) - { - case 0: - _MyConfig = new ProcedureConfig(MyContent.Config); - break; - case 1: - _MyConfig = new SectionConfig(MyContent.Config); - break; - case 2: - _MyConfig = new StepConfig(MyContent.Config); - break; - } - } - return _MyConfig; - } - set - { - if (_MyConfig == null) return; - // MyContent.Config = value; - } - } - //public bool HasStandardSteps() - //{ return MyContent.ContentItemCount > 1; } - public Color ForeColor - { get { return (HasBrokenRules != null ? Color.Red : (MyContent.ContentItemCount > 1 ? Color.Blue : Color.Black)); } } - public Color BackColor - { get { return (ItemAnnotationCount > 0 ? Color.Yellow : Color.White); } } - #endregion - internal ItemInfo(SafeDataReader dr, bool forItem) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - AddContent(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.Constructor", ex); - throw new DbCslaException("ItemInfo.Constructor", ex); - } - } - internal void AddContent(SafeDataReader dr) - { - _MyContent = new ContentInfo(dr, true); - } - } - #endregion ItemInfo - #region ItemInfoList - public partial class ItemInfoList - { - //public void ToXml(XmlNode xn) - //{ - // foreach (ItemInfo itemInfo in this) - // { - // itemInfo.ToXml(xn); - // } - //} - internal ItemInfoList(ItemInfo itemInfo) - { - AddItem(itemInfo); - } - public static ItemInfoList GetList(int? itemID,int type) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListCriteria(itemID,type)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); -#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList - ContentInfoList.GetList(itemID); // Performance - Load All Content -#endif - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListCriteria - { - public ItemListCriteria(int? itemID,int type) - { - _ItemID = itemID; - _Type = type; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int _Type; - public int Type - { - get { return _Type; } - set { _Type = value; } - } - } - private void DataPortal_Fetch(ItemListCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; -#if ItemWithContent - cm.CommandText = "vesp_ListItemsAndContent"; -#else - cm.CommandText = "vesp_ListItems"; -#endif - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - switch ((E_FromType)criteria.Type) - { - case E_FromType.Procedure: - itemInfo = new ProcedureInfo(dr); - break; - case E_FromType.Section: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void AddItem(ItemInfo itemInfo) - { - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - #region Text Search - public static ItemInfoList GetListFromTextSearch(string docVersionList, string stepTypeList, string searchString, bool caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _SearchString; - public string SearchString - { - get { return _SearchString; } - set { _SearchString = value; } - } - private bool _CaseSensitive; - public bool CaseSensitive - { - get { return _CaseSensitive; } - set { _CaseSensitive = value; } - } - private ItemSearchIncludeLinks _IncludeLinks; - public ItemSearchIncludeLinks IncludeLinks - { - get { return _IncludeLinks; } - set { _IncludeLinks = value; } - } - private bool _IncludeRtfFormatting; - public bool IncludeRtfFormatting - { - get { return _IncludeRtfFormatting; } - set { _IncludeRtfFormatting = value; } - } - private bool _IncludeSpecialCharacters; - public bool IncludeSpecialCharacters - { - get { return _IncludeSpecialCharacters; } - set { _IncludeSpecialCharacters = value; } - } - public ItemListSearchCriteria(string docVersionList, string stepTypeList, string searchString, - bool caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _SearchString = searchString; - _CaseSensitive = caseSensitive; - _IncludeLinks = includeLinks; - _IncludeRtfFormatting = includeRtfFormatting; - _IncludeSpecialCharacters = includeSpecialCharacters; - } - } - private void DataPortal_Fetch(ItemListSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchItemAndChildren"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@SearchString", criteria.SearchString); - cm.Parameters.AddWithValue("@CaseSensitive", criteria.CaseSensitive ? 1 : 0); - cm.Parameters.AddWithValue("@IncludeLinks", (int) criteria.IncludeLinks); - cm.Parameters.AddWithValue("@IncludeRtfFormatting", criteria.IncludeRtfFormatting ? 1 : 0); - cm.Parameters.AddWithValue("@IncludeSpecialCharacters", criteria.IncludeSpecialCharacters ? 1 : 0); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region RO Search - public static ItemInfoList GetListFromROSearch(string docVersionList, string stepTypeList, string roSearchString) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListROSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _ROSearchString; - public string ROSearchString - { - get { return _ROSearchString; } - set { _ROSearchString = value; } - } - public ItemListROSearchCriteria(string docVersionList, string stepTypeList, string roSearchString) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _ROSearchString = roSearchString; - } - } - private void DataPortal_Fetch(ItemListROSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchROItemAndChildren"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@ROSearchString", criteria.ROSearchString); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region Annotation Search - public static ItemInfoList GetListFromAnnotationSearch(string docVersionList, string stepTypeList, string annotationTypeList, string searchString, bool caseSensitive) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListAnnotationSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _AnnotationTypeList; - public string AnnotationTypeList - { - get { return _AnnotationTypeList; } - set { _AnnotationTypeList = value; } - } - private string _SearchString; - public string SearchString - { - get { return _SearchString; } - set { _SearchString = value; } - } - private bool _CaseSensitive; - public bool CaseSensitive - { - get { return _CaseSensitive; } - set { _CaseSensitive = value; } - } - public ItemListAnnotationSearchCriteria(string docVersionList, string stepTypeList, string annotationTypeList, string searchString, bool caseSensitive) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _AnnotationTypeList = annotationTypeList; - _SearchString = searchString; - _CaseSensitive = caseSensitive; - } - } - private void DataPortal_Fetch(ItemListAnnotationSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchAnnotationItemAndChildren"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@AnnotationTypeList", criteria.AnnotationTypeList); - cm.Parameters.AddWithValue("@SearchString", criteria.SearchString); - cm.Parameters.AddWithValue("@CaseSensitive", criteria.CaseSensitive ? 1 : 0); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - itemInfo._SearchAnnotationID = dr.GetInt32("SearchAnnotationID"); - itemInfo._SearchAnnotationText = dr.GetString("SearchText"); - itemInfo._SearchAnnotationType = dr.GetString("AnnotationType"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } - #endregion - #region ProcedureInfo - [Serializable()] - public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly - { - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } -#if ItemWithContent - public ProcedureInfo(SafeDataReader dr) : base(dr, true) { } -#else - public ProcedureInfo(SafeDataReader dr) : base(dr) { } -#endif - private ProcedureInfo() : base() { ;} - public new static ProcedureInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - ProcedureInfo tmp = GetCachedByPrimaryKey(itemID) as ProcedureInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveProcedure(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Procedure Get() - { - return (Procedure) (_Editable = Procedure.Get(ItemID)); - } - #region ProcedureConfig - [NonSerialized] - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { get { return (_ProcedureConfig != null ? _ProcedureConfig : _ProcedureConfig = new ProcedureConfig(this)); } } - #endregion - public new ConfigDynamicTypeDescriptor MyConfig - { - get { return ProcedureConfig ; } - } - } - #endregion - #region Procedure - [Serializable()] - public partial class Procedure : Item - { - public new static Procedure Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Item itm = GetCachedByPrimaryKey(itemID); - Procedure tmp = itm as Procedure; - //Procedure tmp = (Procedure)GetExistingByPrimaryKey(itemID); - if (tmp == null) - { - if (itm != null) Console.WriteLine("type = {0}", itm.GetType().Name); - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public new Procedure Save() - { - return (Procedure)base.Save(); - } - public static Procedure MakeProcedure(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string procNumber, string procTitle, int procType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, procNumber, procTitle, procType, E_FromType.Procedure); - return Procedure.Get(newitemid); - } - #region ProcedureConfig - [NonSerialized] - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { - get - { - if (_ProcedureConfig == null) - { - _ProcedureConfig = new ProcedureConfig(this); - _ProcedureConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_ProcedureConfig_PropertyChanged); - } - return _ProcedureConfig; - } - } - private void _ProcedureConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - MyContent.Config = _ProcedureConfig.ToString(); - } - #endregion - } - #endregion - #region SectionInfo - [Serializable()] - public partial class SectionInfo : ItemInfo, IVEDrillDownReadOnly - { - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } -#if ItemWithContent - public SectionInfo(SafeDataReader dr) : base(dr, true) { } -#else - public SectionInfo(SafeDataReader dr) : base(dr) { } -#endif - private SectionInfo() : base() { ;} - public new static SectionInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - SectionInfo tmp = GetCachedByPrimaryKey(itemID) as SectionInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveSection(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Section Get() - { - return (Section)(_Editable = Section.Get(ItemID)); - } - - #region SectionConfig - [NonSerialized] - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { get { return (_SectionConfig != null ? _SectionConfig : _SectionConfig = new SectionConfig(this)); } } - #endregion - public new ConfigDynamicTypeDescriptor MyConfig - { - get { return SectionConfig; } - } - } - #endregion - #region Section - [Serializable()] - public partial class Section : Item - { - public new static Section Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Section tmp = GetCachedByPrimaryKey(itemID) as Section; - if (tmp == null) - { - tmp = DataPortal.Fetch
(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public new Section Save() - { - return (Section)base.Save(); - } - public static Section MakeSection(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string sectNumber, string sectTitle, int sectType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, sectNumber, sectTitle, sectType, E_FromType.Section); - return Section.Get(newitemid); - } - #region SectionConfig - [NonSerialized] - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { - get - { - if (_SectionConfig == null) - { - _SectionConfig = new SectionConfig(this); - _SectionConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_SectionConfig_PropertyChanged); - } - return _SectionConfig; - } - } - private void _SectionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - MyContent.Config = _SectionConfig.ToString(); - } - #endregion - } - #endregion - #region StepInfo - [Serializable()] - public partial class StepInfo : ItemInfo - { - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } - //public override string ToString() - //{ - // return "Step " + base.ToString(); - //} -#if ItemWithContent - public StepInfo(SafeDataReader dr) : base(dr, true) { } -#else - public StepInfo(SafeDataReader dr) : base(dr) { } -#endif - private StepInfo() : base() { ;} - public new static StepInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - StepInfo tmp = GetCachedByPrimaryKey(itemID) as StepInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveStep(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Step Get() - { - return (Step)(_Editable = Step.Get(ItemID)); - } - //public E_FromType FromType - //{ get { return E_FromType.Step; } } - } - - #endregion - #region Step - [Serializable()] - public partial class Step : Item - { - public new static Step Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Step tmp = (Step)GetCachedByPrimaryKey(itemID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - // TODO :MakeCaution; - // TODO :MakeNote; - // TODO :MakeRNO; - // TODO :MakeSection; - // TODO :MakeSubStep; - // TODO :MakeTable; - public static Step MakeStep(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string stepNumber, string stepTitle, int stepType, E_FromType fromType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, stepNumber, stepTitle, stepType, fromType); - return Step.Get(newitemid); - } - //#region StepConfig - //[NonSerialized] - //private StepConfig _StepConfig; - //public StepConfig StepConfig - //{ - // get - // { - // if (_StepConfig == null) - // { - // _StepConfig = new StepConfig(this); - // _StepConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_StepConfig_PropertyChanged); - // } - // return _SectionConfig; - // } - //} - //private void _StepConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - //{ - // MyContent.Config = _StepConfig.ToString(); - //} - //#endregion - } - #endregion - public enum ItemSearchIncludeLinks - { - Nothing = 0, - Value = 1, - Everything =2 - } -} diff --git a/PROMS/VEPROMS_Security/SimpleTest/App.config b/PROMS/VEPROMS_Security/SimpleTest/App.config deleted file mode 100644 index b8bd5b03..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/App.config +++ /dev/null @@ -1,71 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/VEPROMS_Security/SimpleTest/Program.cs b/PROMS/VEPROMS_Security/SimpleTest/Program.cs deleted file mode 100644 index 9cced968..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace SimpleTest -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new frmMain()); - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/AssemblyInfo.cs b/PROMS/VEPROMS_Security/SimpleTest/Properties/AssemblyInfo.cs deleted file mode 100644 index fd145fa3..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises, Inc.")] -[assembly: AssemblyProduct("SimpleTest")] -[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("297cf552-63cf-447f-af61-a2301a8d2e93")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/DataSources/Volian.Object.Library.User.datasource b/PROMS/VEPROMS_Security/SimpleTest/Properties/DataSources/Volian.Object.Library.User.datasource deleted file mode 100644 index f58b89de..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/DataSources/Volian.Object.Library.User.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.User, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.Designer.cs b/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.Designer.cs deleted file mode 100644 index 3ab2950b..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SimpleTest.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimpleTest.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.resx b/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.Designer.cs b/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.Designer.cs deleted file mode 100644 index 7b4f6cf1..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SimpleTest.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.settings b/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/PROMS/VEPROMS_Security/SimpleTest/SimpleTest.csproj b/PROMS/VEPROMS_Security/SimpleTest/SimpleTest.csproj deleted file mode 100644 index f6643c8c..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/SimpleTest.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {4D60F98F-D018-4447-B123-E3BDDE9C60F8} - WinExe - Properties - SimpleTest - SimpleTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\VEPROMS.CSLA.Library\bin\Debug\Csla.dll - - - False - ..\..\..\Log4Net\log4net-1.2.10\bin\net\2.0\release\log4net.dll - - - - - - - - - - - Form - - - frmMain.cs - - - Form - - - frmUser.cs - - - - - Designer - frmMain.cs - - - Designer - frmUser.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {592B86E9-D488-452B-B89B-2BB037793FE3} - Volian.Object.Library - - - - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmMain.Designer.cs b/PROMS/VEPROMS_Security/SimpleTest/frmMain.Designer.cs deleted file mode 100644 index 551095dc..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmMain.Designer.cs +++ /dev/null @@ -1,104 +0,0 @@ -namespace SimpleTest -{ - partial class frmMain - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.users1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.users2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.users1ToolStripMenuItem, - this.users2ToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(804, 26); - this.menuStrip1.TabIndex = 1; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(40, 22); - this.fileToolStripMenuItem.Text = "&File"; - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - // - // users1ToolStripMenuItem - // - this.users1ToolStripMenuItem.Name = "users1ToolStripMenuItem"; - this.users1ToolStripMenuItem.Size = new System.Drawing.Size(70, 22); - this.users1ToolStripMenuItem.Text = "Users 1"; - // - // users2ToolStripMenuItem - // - this.users2ToolStripMenuItem.Name = "users2ToolStripMenuItem"; - this.users2ToolStripMenuItem.Size = new System.Drawing.Size(70, 22); - this.users2ToolStripMenuItem.Text = "Users 2"; - // - // frmMain - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(804, 511); - this.Controls.Add(this.menuStrip1); - this.IsMdiContainer = true; - this.MainMenuStrip = this.menuStrip1; - this.Name = "frmMain"; - this.Text = "VE-PROMS Security"; - this.Load += new System.EventHandler(this.frmMain_Load); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem users1ToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem users2ToolStripMenuItem; - } -} - diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmMain.cs b/PROMS/VEPROMS_Security/SimpleTest/frmMain.cs deleted file mode 100644 index eeb5f43a..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmMain.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using Csla; -using Volian.Object.Library; - -[assembly: log4net.Config.XmlConfigurator(Watch = true)] - -namespace SimpleTest -{ - public partial class frmMain : Form - { - public frmMain() - { - InitializeComponent(); - } - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private void frmMain_Load(object sender, EventArgs e) - { - // Lets setup the menu - foreach (UserInfo ui in UserInfoList.Get()) - { - users1ToolStripMenuItem.DropDownItems.Add(new vlnMenuItem(ui,this)); - users2ToolStripMenuItem.DropDownItems.Add(new vlnMenuItem(ui,this)); - } - } - private class vlnMenuItem:ToolStripMenuItem - { - private UserInfo _userInfo; - public UserInfo UserInfo - { - get { return _userInfo; } - } - private Form _form; - public Form Form - { - get { return _form; } - } - public vlnMenuItem(UserInfo userInfo,Form form): base(userInfo.FullName) - { - _userInfo = userInfo; - _form = form; - base.Click += new EventHandler(mi_Click); - } - void mi_Click(object sender, EventArgs e) - { - // Open a User Form - vlnMenuItem mi = (vlnMenuItem)sender; - frmUser u = new frmUser(mi.UserInfo.Uid); - u.MdiParent = _form; - u.Show(); - } - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmMain.resx b/PROMS/VEPROMS_Security/SimpleTest/frmMain.resx deleted file mode 100644 index 541af56e..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmMain.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmUser.Designer.cs b/PROMS/VEPROMS_Security/SimpleTest/frmUser.Designer.cs deleted file mode 100644 index c7f86a0b..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmUser.Designer.cs +++ /dev/null @@ -1,479 +0,0 @@ -namespace SimpleTest -{ - partial class frmUser - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.Label cfgNameLabel; - System.Windows.Forms.Label courtesyTitleLabel; - System.Windows.Forms.Label firstNameLabel; - System.Windows.Forms.Label lastNameLabel; - System.Windows.Forms.Label middleNameLabel; - System.Windows.Forms.Label phoneNumberLabel; - System.Windows.Forms.Label suffixLabel; - System.Windows.Forms.Label uidLabel; - System.Windows.Forms.Label useridLabel; - System.Windows.Forms.Label userLoginLabel; - System.Windows.Forms.Label userNameLabel; - System.Windows.Forms.Label configLabel; - this.userBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.configTextBox = new System.Windows.Forms.TextBox(); - this.cfgNameTextBox = new System.Windows.Forms.TextBox(); - this.courtesyTitleTextBox = new System.Windows.Forms.TextBox(); - this.firstNameTextBox = new System.Windows.Forms.TextBox(); - this.lastNameTextBox = new System.Windows.Forms.TextBox(); - this.middleNameTextBox = new System.Windows.Forms.TextBox(); - this.phoneNumberTextBox = new System.Windows.Forms.TextBox(); - this.suffixTextBox = new System.Windows.Forms.TextBox(); - this.useridTextBox = new System.Windows.Forms.TextBox(); - this.userLoginTextBox = new System.Windows.Forms.TextBox(); - this.userNameTextBox = new System.Windows.Forms.TextBox(); - this.uidTextBox = new System.Windows.Forms.TextBox(); - this.userMembershipsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.userMembershipsDataGridView = new System.Windows.Forms.DataGridView(); - this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.panel2 = new System.Windows.Forms.Panel(); - cfgNameLabel = new System.Windows.Forms.Label(); - courtesyTitleLabel = new System.Windows.Forms.Label(); - firstNameLabel = new System.Windows.Forms.Label(); - lastNameLabel = new System.Windows.Forms.Label(); - middleNameLabel = new System.Windows.Forms.Label(); - phoneNumberLabel = new System.Windows.Forms.Label(); - suffixLabel = new System.Windows.Forms.Label(); - uidLabel = new System.Windows.Forms.Label(); - useridLabel = new System.Windows.Forms.Label(); - userLoginLabel = new System.Windows.Forms.Label(); - userNameLabel = new System.Windows.Forms.Label(); - configLabel = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.userBindingSource)).BeginInit(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsDataGridView)).BeginInit(); - this.SuspendLayout(); - // - // cfgNameLabel - // - cfgNameLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - cfgNameLabel.AutoSize = true; - cfgNameLabel.Location = new System.Drawing.Point(418, 69); - cfgNameLabel.Name = "cfgNameLabel"; - cfgNameLabel.Size = new System.Drawing.Size(74, 17); - cfgNameLabel.TabIndex = 29; - cfgNameLabel.Text = "Cfg Name:"; - // - // courtesyTitleLabel - // - courtesyTitleLabel.AutoSize = true; - courtesyTitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - courtesyTitleLabel.Location = new System.Drawing.Point(52, 37); - courtesyTitleLabel.Name = "courtesyTitleLabel"; - courtesyTitleLabel.Size = new System.Drawing.Size(35, 17); - courtesyTitleLabel.TabIndex = 31; - courtesyTitleLabel.Text = "Title"; - // - // firstNameLabel - // - firstNameLabel.AutoSize = true; - firstNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - firstNameLabel.Location = new System.Drawing.Point(94, 37); - firstNameLabel.Name = "firstNameLabel"; - firstNameLabel.Size = new System.Drawing.Size(35, 17); - firstNameLabel.TabIndex = 33; - firstNameLabel.Text = "First"; - // - // lastNameLabel - // - lastNameLabel.AutoSize = true; - lastNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - lastNameLabel.Location = new System.Drawing.Point(258, 37); - lastNameLabel.Name = "lastNameLabel"; - lastNameLabel.Size = new System.Drawing.Size(35, 17); - lastNameLabel.TabIndex = 35; - lastNameLabel.Text = "Last"; - // - // middleNameLabel - // - middleNameLabel.AutoSize = true; - middleNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - middleNameLabel.Location = new System.Drawing.Point(173, 37); - middleNameLabel.Name = "middleNameLabel"; - middleNameLabel.Size = new System.Drawing.Size(49, 17); - middleNameLabel.TabIndex = 37; - middleNameLabel.Text = "Middle"; - // - // phoneNumberLabel - // - phoneNumberLabel.AutoSize = true; - phoneNumberLabel.Location = new System.Drawing.Point(10, 57); - phoneNumberLabel.Name = "phoneNumberLabel"; - phoneNumberLabel.Size = new System.Drawing.Size(53, 17); - phoneNumberLabel.TabIndex = 39; - phoneNumberLabel.Text = "Phone:"; - // - // suffixLabel - // - suffixLabel.AutoSize = true; - suffixLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - suffixLabel.Location = new System.Drawing.Point(353, 36); - suffixLabel.Name = "suffixLabel"; - suffixLabel.Size = new System.Drawing.Size(42, 17); - suffixLabel.TabIndex = 41; - suffixLabel.Text = "Suffix"; - // - // uidLabel - // - uidLabel.AutoSize = true; - uidLabel.Location = new System.Drawing.Point(13, 17); - uidLabel.Name = "uidLabel"; - uidLabel.Size = new System.Drawing.Size(49, 17); - uidLabel.TabIndex = 43; - uidLabel.Text = "Name:"; - // - // useridLabel - // - useridLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - useridLabel.AutoSize = true; - useridLabel.Location = new System.Drawing.Point(420, 99); - useridLabel.Name = "useridLabel"; - useridLabel.Size = new System.Drawing.Size(53, 17); - useridLabel.TabIndex = 44; - useridLabel.Text = "Userid:"; - // - // userLoginLabel - // - userLoginLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - userLoginLabel.AutoSize = true; - userLoginLabel.Location = new System.Drawing.Point(420, 127); - userLoginLabel.Name = "userLoginLabel"; - userLoginLabel.Size = new System.Drawing.Size(81, 17); - userLoginLabel.TabIndex = 46; - userLoginLabel.Text = "User Login:"; - // - // userNameLabel - // - userNameLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - userNameLabel.AutoSize = true; - userNameLabel.Location = new System.Drawing.Point(418, 41); - userNameLabel.Name = "userNameLabel"; - userNameLabel.Size = new System.Drawing.Size(83, 17); - userNameLabel.TabIndex = 48; - userNameLabel.Text = "User Name:"; - // - // configLabel - // - configLabel.AutoSize = true; - configLabel.Location = new System.Drawing.Point(13, 88); - configLabel.Name = "configLabel"; - configLabel.Size = new System.Drawing.Size(52, 17); - configLabel.TabIndex = 50; - configLabel.Text = "Config:"; - // - // userBindingSource - // - this.userBindingSource.DataSource = typeof(Volian.Object.Library.User); - // - // panel1 - // - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.btnSave); - this.panel1.Controls.Add(configLabel); - this.panel1.Controls.Add(this.configTextBox); - this.panel1.Controls.Add(cfgNameLabel); - this.panel1.Controls.Add(this.cfgNameTextBox); - this.panel1.Controls.Add(courtesyTitleLabel); - this.panel1.Controls.Add(this.courtesyTitleTextBox); - this.panel1.Controls.Add(firstNameLabel); - this.panel1.Controls.Add(this.firstNameTextBox); - this.panel1.Controls.Add(lastNameLabel); - this.panel1.Controls.Add(this.lastNameTextBox); - this.panel1.Controls.Add(middleNameLabel); - this.panel1.Controls.Add(this.middleNameTextBox); - this.panel1.Controls.Add(phoneNumberLabel); - this.panel1.Controls.Add(this.phoneNumberTextBox); - this.panel1.Controls.Add(suffixLabel); - this.panel1.Controls.Add(this.suffixTextBox); - this.panel1.Controls.Add(uidLabel); - this.panel1.Controls.Add(useridLabel); - this.panel1.Controls.Add(this.useridTextBox); - this.panel1.Controls.Add(userLoginLabel); - this.panel1.Controls.Add(this.userLoginTextBox); - this.panel1.Controls.Add(userNameLabel); - this.panel1.Controls.Add(this.userNameTextBox); - this.panel1.Controls.Add(this.uidTextBox); - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(721, 158); - this.panel1.TabIndex = 29; - // - // btnCancel - // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.Location = new System.Drawing.Point(634, 38); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 53; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.Location = new System.Drawing.Point(634, 10); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 52; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // configTextBox - // - this.configTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Config", true)); - this.configTextBox.Location = new System.Drawing.Point(71, 85); - this.configTextBox.Multiline = true; - this.configTextBox.Name = "configTextBox"; - this.configTextBox.Size = new System.Drawing.Size(335, 65); - this.configTextBox.TabIndex = 51; - // - // cfgNameTextBox - // - this.cfgNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cfgNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "CfgName", true)); - this.cfgNameTextBox.Location = new System.Drawing.Point(507, 66); - this.cfgNameTextBox.Name = "cfgNameTextBox"; - this.cfgNameTextBox.Size = new System.Drawing.Size(83, 22); - this.cfgNameTextBox.TabIndex = 30; - // - // courtesyTitleTextBox - // - this.courtesyTitleTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "CourtesyTitle", true)); - this.courtesyTitleTextBox.Location = new System.Drawing.Point(55, 12); - this.courtesyTitleTextBox.Name = "courtesyTitleTextBox"; - this.courtesyTitleTextBox.Size = new System.Drawing.Size(36, 22); - this.courtesyTitleTextBox.TabIndex = 32; - // - // firstNameTextBox - // - this.firstNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "FirstName", true)); - this.firstNameTextBox.Location = new System.Drawing.Point(97, 12); - this.firstNameTextBox.Name = "firstNameTextBox"; - this.firstNameTextBox.Size = new System.Drawing.Size(73, 22); - this.firstNameTextBox.TabIndex = 34; - // - // lastNameTextBox - // - this.lastNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "LastName", true)); - this.lastNameTextBox.Location = new System.Drawing.Point(261, 12); - this.lastNameTextBox.Name = "lastNameTextBox"; - this.lastNameTextBox.Size = new System.Drawing.Size(89, 22); - this.lastNameTextBox.TabIndex = 36; - // - // middleNameTextBox - // - this.middleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "MiddleName", true)); - this.middleNameTextBox.Location = new System.Drawing.Point(176, 12); - this.middleNameTextBox.Name = "middleNameTextBox"; - this.middleNameTextBox.Size = new System.Drawing.Size(79, 22); - this.middleNameTextBox.TabIndex = 38; - // - // phoneNumberTextBox - // - this.phoneNumberTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "PhoneNumber", true)); - this.phoneNumberTextBox.Location = new System.Drawing.Point(71, 57); - this.phoneNumberTextBox.Name = "phoneNumberTextBox"; - this.phoneNumberTextBox.Size = new System.Drawing.Size(145, 22); - this.phoneNumberTextBox.TabIndex = 40; - // - // suffixTextBox - // - this.suffixTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Suffix", true)); - this.suffixTextBox.Location = new System.Drawing.Point(356, 11); - this.suffixTextBox.Name = "suffixTextBox"; - this.suffixTextBox.Size = new System.Drawing.Size(50, 22); - this.suffixTextBox.TabIndex = 42; - // - // useridTextBox - // - this.useridTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.useridTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Userid", true)); - this.useridTextBox.Location = new System.Drawing.Point(507, 94); - this.useridTextBox.Name = "useridTextBox"; - this.useridTextBox.Size = new System.Drawing.Size(83, 22); - this.useridTextBox.TabIndex = 45; - // - // userLoginTextBox - // - this.userLoginTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.userLoginTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "UserLogin", true)); - this.userLoginTextBox.Location = new System.Drawing.Point(507, 124); - this.userLoginTextBox.Name = "userLoginTextBox"; - this.userLoginTextBox.Size = new System.Drawing.Size(83, 22); - this.userLoginTextBox.TabIndex = 47; - // - // userNameTextBox - // - this.userNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.userNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "UserName", true)); - this.userNameTextBox.Location = new System.Drawing.Point(507, 36); - this.userNameTextBox.Name = "userNameTextBox"; - this.userNameTextBox.Size = new System.Drawing.Size(83, 22); - this.userNameTextBox.TabIndex = 49; - // - // uidTextBox - // - this.uidTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.uidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Uid", true)); - this.uidTextBox.Enabled = false; - this.uidTextBox.Location = new System.Drawing.Point(547, 11); - this.uidTextBox.Name = "uidTextBox"; - this.uidTextBox.Size = new System.Drawing.Size(40, 22); - this.uidTextBox.TabIndex = 23; - // - // userMembershipsBindingSource - // - this.userMembershipsBindingSource.AllowNew = false; - this.userMembershipsBindingSource.DataMember = "UserMemberships"; - this.userMembershipsBindingSource.DataSource = this.userBindingSource; - // - // userMembershipsDataGridView - // - this.userMembershipsDataGridView.AutoGenerateColumns = false; - this.userMembershipsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dataGridViewTextBoxColumn3, - this.dataGridViewTextBoxColumn11, - this.dataGridViewTextBoxColumn7, - this.dataGridViewTextBoxColumn5, - this.dataGridViewTextBoxColumn6}); - this.userMembershipsDataGridView.DataSource = this.userMembershipsBindingSource; - this.userMembershipsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.userMembershipsDataGridView.Location = new System.Drawing.Point(0, 196); - this.userMembershipsDataGridView.Name = "userMembershipsDataGridView"; - this.userMembershipsDataGridView.RowTemplate.Height = 24; - this.userMembershipsDataGridView.Size = new System.Drawing.Size(721, 223); - this.userMembershipsDataGridView.TabIndex = 29; - // - // dataGridViewTextBoxColumn3 - // - this.dataGridViewTextBoxColumn3.DataPropertyName = "Ugid"; - this.dataGridViewTextBoxColumn3.HeaderText = "Ugid"; - this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; - this.dataGridViewTextBoxColumn3.ReadOnly = true; - this.dataGridViewTextBoxColumn3.Visible = false; - // - // dataGridViewTextBoxColumn11 - // - this.dataGridViewTextBoxColumn11.DataPropertyName = "Gid"; - this.dataGridViewTextBoxColumn11.HeaderText = "Gid"; - this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; - this.dataGridViewTextBoxColumn11.Visible = false; - // - // dataGridViewTextBoxColumn7 - // - this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dataGridViewTextBoxColumn7.DataPropertyName = "Group_GroupName"; - this.dataGridViewTextBoxColumn7.HeaderText = "Group"; - this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; - this.dataGridViewTextBoxColumn7.ReadOnly = true; - // - // dataGridViewTextBoxColumn5 - // - this.dataGridViewTextBoxColumn5.DataPropertyName = "StartDate"; - this.dataGridViewTextBoxColumn5.HeaderText = "Start"; - this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; - // - // dataGridViewTextBoxColumn6 - // - this.dataGridViewTextBoxColumn6.DataPropertyName = "EndDate"; - this.dataGridViewTextBoxColumn6.HeaderText = "End"; - this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; - // - // panel2 - // - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(0, 158); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(721, 38); - this.panel2.TabIndex = 30; - // - // frmUser - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(721, 419); - this.Controls.Add(this.userMembershipsDataGridView); - this.Controls.Add(this.panel2); - this.Controls.Add(this.panel1); - this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "FullName", true)); - this.Name = "frmUser"; - this.Text = "frmUser"; - ((System.ComponentModel.ISupportInitialize)(this.userBindingSource)).EndInit(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsDataGridView)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.BindingSource userBindingSource; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.TextBox cfgNameTextBox; - private System.Windows.Forms.TextBox courtesyTitleTextBox; - private System.Windows.Forms.TextBox firstNameTextBox; - private System.Windows.Forms.TextBox lastNameTextBox; - private System.Windows.Forms.TextBox middleNameTextBox; - private System.Windows.Forms.TextBox phoneNumberTextBox; - private System.Windows.Forms.TextBox suffixTextBox; - private System.Windows.Forms.TextBox useridTextBox; - private System.Windows.Forms.TextBox userLoginTextBox; - private System.Windows.Forms.TextBox userNameTextBox; - private System.Windows.Forms.TextBox uidTextBox; - private System.Windows.Forms.TextBox configTextBox; - private System.Windows.Forms.BindingSource userMembershipsBindingSource; - private System.Windows.Forms.DataGridView userMembershipsDataGridView; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmUser.cs b/PROMS/VEPROMS_Security/SimpleTest/frmUser.cs deleted file mode 100644 index 5270ab88..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmUser.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using Csla; -using Volian.Object.Library; - -namespace SimpleTest -{ - public partial class frmUser : Form - { - User _user; - public User User - { - get { return _user; } - } - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public frmUser(int uid) - { - InitializeComponent(); - _user = User.Get(uid); - _user.BeginEdit(); - //_user.PropertyChanged += new PropertyChangedEventHandler(_user_PropertyChanged); - //_user.UserMemberships.ListChanged += new ListChangedEventHandler(UserMemberships_ListChanged); - userBindingSource.DataSource = _user; - } - - void UserMemberships_ListChanged(object sender, ListChangedEventArgs e) - { - LogDirtyStatus("List Changed - " + e.ListChangedType.ToString()); - } - - void _user_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - LogDirtyStatus("Property Changed - " + e.PropertyName); - } - private void LogDirtyStatus(string s) - { - log.InfoFormat("--------{0}-------",s); - log.InfoFormat("IsDirty = {0}",_user.IsDirty); - foreach(UserMembership um in _user.UserMemberships){ - log.InfoFormat("{0} IsDirty = {1}",um.Group_GroupName,um.IsDirty); - } - } - private void Save(bool rebind) - { - this.userBindingSource.RaiseListChangedEvents = false; - this.userMembershipsBindingSource.RaiseListChangedEvents = false; - // do the save - this.userBindingSource.EndEdit(); - this.userMembershipsBindingSource.EndEdit(); - try - { - User temp = _user.Clone(); - _user = temp.Save(); - _user.BeginEdit(); - if (rebind) - { - // rebind the UI - this.userBindingSource.DataSource = null; - this.userMembershipsBindingSource.DataSource = this.userBindingSource; - this.userBindingSource.DataSource = _user; -// ApplyAuthorizationRules(); - } - } - catch (Csla.DataPortalException ex) - { - MessageBox.Show(ex.BusinessException.ToString(), - "Error saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), - "Error Saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - finally - { - this.userBindingSource.RaiseListChangedEvents = true; - this.userMembershipsBindingSource.RaiseListChangedEvents = true; - this.userBindingSource.ResetBindings(false); - this.userMembershipsBindingSource.ResetBindings(false); - } - } - - private void btnSave_Click(object sender, EventArgs e) - { - LogDirtyStatus("Before Save"); - Save(true); - LogDirtyStatus("After Save"); - } - - private void btnCancel_Click(object sender, EventArgs e) - { - LogDirtyStatus("Before Cancel"); - userBindingSource.RaiseListChangedEvents=false; - userBindingSource.CancelEdit(); - userBindingSource.RaiseListChangedEvents = true; -// _user.CancelEdit(); - _user.BeginEdit(); - LogDirtyStatus("After Cancel"); - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/SimpleTest/frmUser.resx b/PROMS/VEPROMS_Security/SimpleTest/frmUser.resx deleted file mode 100644 index 06032f6e..00000000 --- a/PROMS/VEPROMS_Security/SimpleTest/frmUser.resx +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - 17, 17 - - - 187, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/VEPROMS_Security.sln b/PROMS/VEPROMS_Security/VEPROMS_Security.sln deleted file mode 100644 index 49994fb7..00000000 --- a/PROMS/VEPROMS_Security/VEPROMS_Security.sln +++ /dev/null @@ -1,72 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Object.Library", "Volian.Object.Library\Volian.Object.Library.csproj", "{592B86E9-D488-452B-B89B-2BB037793FE3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinApp", "WinApp\WinApp.csproj", "{9912ADA4-5934-4C1D-AF2E-CA8031EBA338}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleTest", "SimpleTest\SimpleTest.csproj", "{4D60F98F-D018-4447-B123-E3BDDE9C60F8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEPROMS.CSLA.Library", "..\VEPROMS.CSLA.Library\VEPROMS.CSLA.Library.csproj", "{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 1 - SccProjectUniqueName0 = ..\\VEPROMS.CSLA.Library\\VEPROMS.CSLA.Library.csproj - SccProjectName0 = \u0022$/PROMS/VEPROMS.CSLA.Library\u0022,\u0020TPBAAAAA - SccLocalPath0 = ..\\VEPROMS.CSLA.Library - SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Demo|Any CPU = Demo|Any CPU - Demo|x86 = Demo|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {592B86E9-D488-452B-B89B-2BB037793FE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Debug|x86.ActiveCfg = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Demo|Any CPU.ActiveCfg = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Demo|Any CPU.Build.0 = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Demo|x86.ActiveCfg = Debug|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Release|Any CPU.Build.0 = Release|Any CPU - {592B86E9-D488-452B-B89B-2BB037793FE3}.Release|x86.ActiveCfg = Release|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Debug|x86.ActiveCfg = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Demo|Any CPU.ActiveCfg = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Demo|Any CPU.Build.0 = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Demo|x86.ActiveCfg = Debug|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Release|Any CPU.Build.0 = Release|Any CPU - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338}.Release|x86.ActiveCfg = Release|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Debug|x86.ActiveCfg = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Demo|Any CPU.ActiveCfg = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Demo|Any CPU.Build.0 = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Demo|x86.ActiveCfg = Debug|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Release|Any CPU.Build.0 = Release|Any CPU - {4D60F98F-D018-4447-B123-E3BDDE9C60F8}.Release|x86.ActiveCfg = Release|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.ActiveCfg = Debug|x86 - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.Build.0 = Debug|x86 - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.ActiveCfg = Demo|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.Build.0 = Demo|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.ActiveCfg = Demo|x86 - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.Build.0 = Demo|x86 - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.Build.0 = Release|Any CPU - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.ActiveCfg = Release|x86 - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Assignment.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Assignment.cs deleted file mode 100644 index dbbdaf46..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Assignment.cs +++ /dev/null @@ -1,764 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Assignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Assignment : BusinessBase - { - #region Business Methods - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_gid != value) - { - _gid = value; - PropertyHasChanged(); - } - } - } - private int _rid; - [System.ComponentModel.DataObjectField(true, true)] - public int Rid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _rid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_rid != value) - { - _rid = value; - PropertyHasChanged(); - } - } - } - private int _folderid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folderid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folderid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_folderid != value) - { - _folderid = 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 - // TODO: Replace base Assignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Assignment - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Assignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Assignment - protected override object GetIdValue() - { - return _aid; - } - - #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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - 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(Aid, ""); - //AuthorizationRules.AllowRead(Gid, ""); - //AuthorizationRules.AllowRead(Rid, ""); - //AuthorizationRules.AllowRead(Folderid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Gid, ""); - //AuthorizationRules.AllowWrite(Rid, ""); - //AuthorizationRules.AllowWrite(Folderid, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Assignment() - {/* require use of factory methods */} - - public static Assignment New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Assignment"); - return DataPortal.Create(); - } - - public static Assignment Get(int _aid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Assignment"); - return DataPortal.Fetch(new PKCriteria(_aid)); - } - - public static void Delete(int _aid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Assignment"); - DataPortal.Delete(new PKCriteria(_aid)); - } - - public override Assignment Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Assignment"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Assignment"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Assignment"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _aid; - public int Aid - { get { return _aid; } } - public PKCriteria(int aid) - { - _aid = aid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignment"; - cm.Parameters.AddWithValue("@aID", criteria.Aid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - } - } - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAssignment"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@gID", _gid); - cm.Parameters.AddWithValue("@rID", _rid); - cm.Parameters.AddWithValue("@folderID", _folderid); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_aid = new SqlParameter("@newAID", SqlDbType.Int); - param_aid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_aid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _aid = (int)cm.Parameters["@newAID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - } - - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int aid, int gid, int rid, int folderid, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAssignment"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@gID", gid); - cm.Parameters.AddWithValue("@rID", rid); - cm.Parameters.AddWithValue("@folderID", folderid); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_aid = new SqlParameter("@newAID", SqlDbType.Int); - param_aid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_aid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - aid = (int)cm.Parameters["@newAID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAssignment"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@aID", _aid); - cm.Parameters.AddWithValue("@gID", _gid); - cm.Parameters.AddWithValue("@rID", _rid); - cm.Parameters.AddWithValue("@folderID", _folderid); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int aid, int gid, int rid, int folderid, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAssignment"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@aID", aid); - cm.Parameters.AddWithValue("@gID", gid); - cm.Parameters.AddWithValue("@rID", rid); - cm.Parameters.AddWithValue("@folderID", folderid); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_aid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAssignment"; - cm.Parameters.AddWithValue("@aID", criteria.Aid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int aid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAssignment"; - // Input PK Fields - - cm.Parameters.AddWithValue("@aID", aid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int aid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(aid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _aid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int aid) - { - _aid = aid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsAssignment"; - - cm.Parameters.AddWithValue("@aID", _aid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Assignment", ex); - } - } - } - - #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 AssignmentExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Assignment - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfo.cs deleted file mode 100644 index aff78fa9..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfo.cs +++ /dev/null @@ -1,159 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// AssignmentInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class AssignmentInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current AssignmentInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check AssignmentInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AssignmentInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfoList.cs deleted file mode 100644 index 0b7edef5..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/AssignmentInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// AssignmentInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class AssignmentInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static AssignmentInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static AssignmentInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private AssignmentInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignments"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new AssignmentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("AssignmentInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Connection.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Connection.cs deleted file mode 100644 index 992d4cda..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Connection.cs +++ /dev/null @@ -1,764 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Connection Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Connection : BusinessBase - { - #region Business Methods - - 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; - } - [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 _connectionstring = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string ConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _connectionstring; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_connectionstring != value) - { - _connectionstring = value; - PropertyHasChanged(); - } - } - } - private int _servertype; - /// - /// 0 SQL Server - /// - [System.ComponentModel.DataObjectField(true, true)] - public int ServerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _servertype; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_servertype != value) - { - _servertype = 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 - private ConnectionFolders _connectionfolders = ConnectionFolders.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public ConnectionFolders ConnectionFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _connectionfolders; - } - } - public override bool IsDirty - { - get { return base.IsDirty || _connectionfolders.IsDirty; } - } - public override bool IsValid - { - get { return base.IsValid && _connectionfolders.IsValid; } - } - // TODO: Replace base Connection.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Connection - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Connection.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Connection - protected override object GetIdValue() - { - return _dbid; - } - - #endregion - - #region ValidationRules - - protected override void AddBusinessRules() - { - 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("ConnectionString", 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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - // 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(Dbid, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(ConnectionString, ""); - //AuthorizationRules.AllowRead(ServerType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(ConnectionString, ""); - //AuthorizationRules.AllowWrite(ServerType, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Connection() - {/* require use of factory methods */} - - public static Connection New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Connection"); - return DataPortal.Create(); - } - - public static Connection Get(int _dbid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Connection"); - return DataPortal.Fetch(new PKCriteria(_dbid)); - } - - public static void Delete(int _dbid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Connection"); - DataPortal.Delete(new PKCriteria(_dbid)); - } - - public override Connection Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Connection"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Connection"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Connection"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _dbid; - public int Dbid - { get { return _dbid; } } - public PKCriteria(int dbid) - { - _dbid = dbid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _servertype = ext.DefaultServerType; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnection"; - cm.Parameters.AddWithValue("@dBID", criteria.Dbid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - // load child objects - dr.NextResult(); - _connectionfolders = ConnectionFolders.Get(dr); - - } - } - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addConnection"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@connectionString", _connectionstring); - cm.Parameters.AddWithValue("@serverType", _servertype); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_dbid = new SqlParameter("@newDBID", SqlDbType.Int); - param_dbid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_dbid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _dbid = (int)cm.Parameters["@newDBID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - _connectionfolders.Update(this, cn); - - } - - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int dbid, string name, string title, string connectionstring, int servertype, string config, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addConnection"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@connectionString", connectionstring); - cm.Parameters.AddWithValue("@serverType", servertype); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_dbid = new SqlParameter("@newDBID", SqlDbType.Int); - param_dbid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_dbid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - dbid = (int)cm.Parameters["@newDBID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateConnection"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@dBID", _dbid); - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@connectionString", _connectionstring); - cm.Parameters.AddWithValue("@serverType", _servertype); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - _connectionfolders.Update(this, cn); - - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int dbid, string name, string title, string connectionstring, int servertype, string config, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateConnection"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@dBID", dbid); - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@connectionString", connectionstring); - cm.Parameters.AddWithValue("@serverType", servertype); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_dbid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteConnection"; - cm.Parameters.AddWithValue("@dBID", criteria.Dbid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int dbid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteConnection"; - // Input PK Fields - - cm.Parameters.AddWithValue("@dBID", dbid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int dbid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(dbid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _dbid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int dbid) - { - _dbid = dbid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsConnection"; - - cm.Parameters.AddWithValue("@dBID", _dbid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Connection", ex); - } - } - } - - #endregion - - // Standard Default Code - // #region extension - Extension ext = new Extension(); - [Serializable()] - partial class Extension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultServerType - { - get { return 1; } - } - 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 ConnectionExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Connection - // { - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultServerType - // { - // get { return 1; } - // } - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolder.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolder.cs deleted file mode 100644 index d6c4addb..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolder.cs +++ /dev/null @@ -1,432 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// ConnectionFolder Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class ConnectionFolder : BusinessBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ConnectionFolder - protected override object GetIdValue() - { - return _folderid; - } - // TODO: Replace base ConnectionFolder.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ConnectionFolder - //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, ""); - //AuthorizationRules.AllowRead(Parentid, ""); - //AuthorizationRules.AllowWrite(Parentid, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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) - { - 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolders.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolders.cs deleted file mode 100644 index c904de19..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionFolders.cs +++ /dev/null @@ -1,85 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// ConnectionFolders Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class ConnectionFolders : BusinessListBase - { -// No Columns to retrieve - #region Factory Methods - - internal static ConnectionFolders New() - { - return new ConnectionFolders(); - } - - internal static ConnectionFolders Get(SafeDataReader dr) - { - return new ConnectionFolders(dr); - } - - private ConnectionFolders() - { - MarkAsChild(); - } - - private ConnectionFolders(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ConnectionFolder.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Connection connection,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (ConnectionFolder obj in DeletedList) - obj.DeleteSelf(connection,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (ConnectionFolder obj in this) - { - if (obj.IsNew) - obj.Insert(connection,cn); - else - obj.Update(connection,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfo.cs deleted file mode 100644 index 67dc3193..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfo.cs +++ /dev/null @@ -1,162 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class ConnectionInfo : ReadOnlyBase - { - #region Business Methods - - - 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; - /// - /// 0 SQL Server - /// - [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 - /// - /// Overrides Base ToString - /// - /// A string representation of current ConnectionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ConnectionInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfoList.cs deleted file mode 100644 index 5a3c45b7..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/ConnectionInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// ConnectionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class ConnectionInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static ConnectionInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static ConnectionInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private ConnectionInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnections"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new ConnectionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("ConnectionInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Database.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Database.cs deleted file mode 100644 index 362554ce..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Database.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Configuration; -using Csla; -using System.Data.SqlClient; -using System.IO; - -namespace Volian.Object.Library -{ - public static class Database - { - #region Log4Net - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - public static string VEPROMS_Connection - { - get - { - DateTime.Today.ToLongDateString(); - ConnectionStringSettings cs = ConfigurationManager.ConnectionStrings["VEPROMS"]; - if (cs == null) - { - throw new ApplicationException("Database.cs Could not find connection VEPROMS"); - } - return cs.ConnectionString; - } - } - public static SqlConnection VEPROMS_SqlConnection - { - get - { - string strConn = VEPROMS_Connection; // If failure - Fail (Don't try to catch) - // Attempt to make a connection - try - { - SqlConnection cn = new SqlConnection(strConn); - cn.Open(); - return cn; - } - catch (SqlException exsql) - { - const string strAttachError = "An attempt to attach an auto-named database for file "; - if (exsql.Message.StartsWith(strAttachError)) - {// Check to see if the file is missing - string sFile = exsql.Message.Substring(strAttachError.Length); - sFile = sFile.Substring(0, sFile.IndexOf(" failed")); - // "An attempt to attach an auto-named database for file failed" - if (strConn.ToLower().IndexOf("user instance=true") < 0) - { - throw new ApplicationException("Connection String missing attribute: User Instance=True"); - } - if (File.Exists(sFile)) - { - throw new ApplicationException("Database file " + sFile + " Cannot be opened\r\n", exsql); - } - else - { - throw new FileNotFoundException("Database file " + sFile + " Not Found", exsql); - } - } - else - { - throw new ApplicationException("Failure on Connect", exsql); - } - } - catch (Exception ex)// Throw Application Exception on Failure - { - if (log.IsErrorEnabled) log.Error("Connection Error", ex); - throw new ApplicationException("Failure on Connect", ex); - } - } - } - public static void LogException(string s,Exception ex) - { - log.Error(s,ex); - int i = 0; - Console.WriteLine("Error - {0}", s); - for (; ex != null; ex = ex.InnerException) - { - Console.WriteLine("{0}{1} - {2}", "".PadLeft(i * 2), ex.GetType().ToString(), ex.Message); - } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Folder.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Folder.cs deleted file mode 100644 index a9487771..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Folder.cs +++ /dev/null @@ -1,768 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Folder Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Folder : BusinessBase - { - #region Business Methods - - 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 int _dbid; - [System.ComponentModel.DataObjectField(true, true)] - public int Dbid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _dbid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_dbid != value) - { - _dbid = 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 - private FolderAssignments _folderassignments = FolderAssignments.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public FolderAssignments FolderAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folderassignments; - } - } - public override bool IsDirty - { - get { return base.IsDirty || _folderassignments.IsDirty; } - } - public override bool IsValid - { - get { return base.IsValid && _folderassignments.IsValid; } - } - // TODO: Replace base Folder.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Folder - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Folder.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Folder - protected override object GetIdValue() - { - return _folderid; - } - - #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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - // 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, ""); - //AuthorizationRules.AllowRead(Parentid, ""); - //AuthorizationRules.AllowRead(Dbid, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Parentid, ""); - //AuthorizationRules.AllowWrite(Dbid, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Folder() - {/* require use of factory methods */} - - public static Folder New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Folder"); - return DataPortal.Create(); - } - - public static Folder Get(int _folderid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Folder"); - return DataPortal.Fetch(new PKCriteria(_folderid)); - } - - public static void Delete(int _folderid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Folder"); - DataPortal.Delete(new PKCriteria(_folderid)); - } - - public override Folder Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Folder"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Folder"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Folder"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _folderid; - public int Folderid - { get { return _folderid; } } - public PKCriteria(int folderid) - { - _folderid = folderid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _parentid = ext.DefaultParentid; - _dbid = ext.DefaultDbid; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolder"; - cm.Parameters.AddWithValue("@folderID", criteria.Folderid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - // load child objects - dr.NextResult(); - _folderassignments = FolderAssignments.Get(dr); - - } - } - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFolder"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@parentID", _parentid); - cm.Parameters.AddWithValue("@dBID", _dbid); - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_folderid = new SqlParameter("@newFolderID", SqlDbType.Int); - param_folderid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_folderid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _folderid = (int)cm.Parameters["@newFolderID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - _folderassignments.Update(this, cn); - - } - - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int folderid, int parentid, int dbid, string name, string title, string config, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFolder"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@parentID", parentid); - cm.Parameters.AddWithValue("@dBID", dbid); - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_folderid = new SqlParameter("@newFolderID", SqlDbType.Int); - param_folderid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_folderid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - folderid = (int)cm.Parameters["@newFolderID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFolder"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@folderID", _folderid); - cm.Parameters.AddWithValue("@parentID", _parentid); - cm.Parameters.AddWithValue("@dBID", _dbid); - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - _folderassignments.Update(this, cn); - - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int folderid, int parentid, int dbid, string name, string title, string config, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFolder"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@folderID", folderid); - cm.Parameters.AddWithValue("@parentID", parentid); - cm.Parameters.AddWithValue("@dBID", dbid); - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_folderid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFolder"; - cm.Parameters.AddWithValue("@folderID", criteria.Folderid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int folderid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFolder"; - // Input PK Fields - - cm.Parameters.AddWithValue("@folderID", folderid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int folderid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(folderid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _folderid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int folderid) - { - _folderid = folderid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsFolder"; - - cm.Parameters.AddWithValue("@folderID", _folderid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Folder", ex); - } - } - } - - #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 FolderExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Folder - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignment.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignment.cs deleted file mode 100644 index 84cd0846..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignment.cs +++ /dev/null @@ -1,567 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// FolderAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class FolderAssignment : BusinessBase - { - #region Business Methods - - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_gid != value) - { - _gid = value; - PropertyHasChanged(); - } - } - } - private int _rid; - [System.ComponentModel.DataObjectField(true, true)] - public int Rid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _rid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_rid != value) - { - _rid = 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; - } - } - private string _role_name = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_name; - } - } - private string _role_title = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_title; - } - } - private DateTime _role_dts = new DateTime(); - [System.ComponentModel.DataObjectField(true, true)] - public DateTime Role_Dts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_dts; - } - } - private string _role_usrid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Usrid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_usrid; - } - } - // TODO: Check FolderAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FolderAssignment - protected override object GetIdValue() - { - return _aid; - } - // TODO: Replace base FolderAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FolderAssignment - //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(Aid, ""); - //AuthorizationRules.AllowRead(Gid, ""); - //AuthorizationRules.AllowWrite(Gid, ""); - //AuthorizationRules.AllowRead(Rid, ""); - //AuthorizationRules.AllowWrite(Rid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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 FolderAssignment New(int gid, int rid) - { - return new FolderAssignment(Volian.Object.Library.Group.Get(gid), Volian.Object.Library.Role.Get(rid)); - } - - internal static FolderAssignment Get(SafeDataReader dr) - { - return new FolderAssignment(dr); - } - - private FolderAssignment() - { - MarkAsChild(); - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - } - - private FolderAssignment(Group group, Role role) - { - 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; - _rid = role.Rid; - _role_name = role.Name; - _role_title = role.Title; - _role_dts = role.Dts; - _role_usrid = role.Usrid; - } - - private FolderAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - - #endregion - #region Data Access Portal - - private void Fetch(SafeDataReader dr) - { - try - { - _aid = dr.GetInt32("AID"); - _gid = dr.GetInt32("GID"); - _rid = dr.GetInt32("RID"); - _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"); - _role_name = dr.GetString("Roles_Name"); - _role_title = dr.GetString("Roles_Title"); - _role_dts = dr.GetDateTime("Roles_DTS"); - _role_usrid = dr.GetString("Roles_UsrID"); - } - catch (Exception ex) - { - Database.LogException("FolderAssignment", ex); - } - MarkOld(); - } - - internal void Insert(Folder folder, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Add(cn, ref _aid, _gid, _rid, folder.Folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid); - MarkOld(); - } - - internal void Update(Folder folder, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Update(cn, ref _aid, _gid, _rid, folder.Folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged); - } - - internal void DeleteSelf(Folder folder, 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; - Assignment.Remove(cn, _aid); - 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 FolderAssignmentExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class FolderAssignment - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignments.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignments.cs deleted file mode 100644 index 763dc751..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderAssignments.cs +++ /dev/null @@ -1,145 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// FolderAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class FolderAssignments : BusinessListBase - { - #region Business Methods - - public FolderAssignment this[int gid, int rid] - { - get - { - foreach (FolderAssignment assignment in this) - if (assignment.Gid == gid && assignment.Rid == rid) - return assignment; - return null; - } - } - public FolderAssignment GetItem(int gid, int rid) - { - foreach (FolderAssignment assignment in this) - if (assignment.Gid == gid && assignment.Rid == rid) - return assignment; - return null; - } - - public void Add(int gid, int rid) - { - if (!Contains(gid, rid)) - { - FolderAssignment assignment = - FolderAssignment.New(gid, rid); - this.Add(assignment); - } - else - throw new InvalidOperationException("assignment already exists"); - } - - public void Remove(int gid, int rid) - { - foreach (FolderAssignment assignment in this) - { - if (assignment.Gid == gid && assignment.Rid == rid) - { - Remove(assignment); - break; - } - } - } - - public bool Contains(int gid, int rid) - { - foreach (FolderAssignment assignment in this) - if (assignment.Gid == gid && assignment.Rid == rid) - return true; - return false; - } - - public bool ContainsDeleted(int gid, int rid) - { - foreach (FolderAssignment assignment in DeletedList) - if (assignment.Gid == gid && assignment.Rid == rid) - return true; - return false; - } - - #endregion - #region Factory Methods - - internal static FolderAssignments New() - { - return new FolderAssignments(); - } - - internal static FolderAssignments Get(SafeDataReader dr) - { - return new FolderAssignments(dr); - } - - private FolderAssignments() - { - MarkAsChild(); - } - - private FolderAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FolderAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Folder folder,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (FolderAssignment obj in DeletedList) - obj.DeleteSelf(folder,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (FolderAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(folder,cn); - else - obj.Update(folder,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfo.cs deleted file mode 100644 index 650a2fd3..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfo.cs +++ /dev/null @@ -1,159 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// FolderInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class FolderInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current FolderInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check FolderInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FolderInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfoList.cs deleted file mode 100644 index a5cdb69c..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/FolderInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// FolderInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class FolderInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static FolderInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static FolderInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private FolderInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolders"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new FolderInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("FolderInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Group.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Group.cs deleted file mode 100644 index b7fa129a..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Group.cs +++ /dev/null @@ -1,715 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Group Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Group : BusinessBase - { - #region Business Methods - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_groupname != value) - { - _groupname = value; - PropertyHasChanged(); - } - } - } - private int _grouptype; - [System.ComponentModel.DataObjectField(true, true)] - public int GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _grouptype; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_grouptype != value) - { - _grouptype = 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 - private GroupAssignments _groupassignments = GroupAssignments.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public GroupAssignments GroupAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _groupassignments; - } - } - private GroupMemberships _groupmemberships = GroupMemberships.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public GroupMemberships GroupMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _groupmemberships; - } - } - public override bool IsDirty - { - get { return base.IsDirty || _groupassignments.IsDirty || _groupmemberships.IsDirty; } - } - public override bool IsValid - { - get { return base.IsValid && _groupassignments.IsValid && _groupmemberships.IsValid; } - } - // TODO: Replace base Group.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Group - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Group.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Group - protected override object GetIdValue() - { - return _gid; - } - - #endregion - - #region ValidationRules - - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "GroupName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("GroupName", 50)); - 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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - // 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(Gid, ""); - //AuthorizationRules.AllowRead(GroupName, ""); - //AuthorizationRules.AllowRead(GroupType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(GroupName, ""); - //AuthorizationRules.AllowWrite(GroupType, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Group() - {/* require use of factory methods */} - - public static Group New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Group"); - return DataPortal.Create(); - } - - public static Group Get(int _gid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Group"); - return DataPortal.Fetch(new PKCriteria(_gid)); - } - - public static void Delete(int _gid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Group"); - DataPortal.Delete(new PKCriteria(_gid)); - } - - public override Group Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Group"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Group"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Group"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _gid; - public int Gid - { get { return _gid; } } - public PKCriteria(int gid) - { - _gid = gid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroup"; - cm.Parameters.AddWithValue("@gID", criteria.Gid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _gid = dr.GetInt32("GID"); - _groupname = dr.GetString("GroupName"); - _grouptype = dr.GetInt32("GroupType"); - _config = dr.GetString("Config"); - _dts = dr.GetDateTime("DTS"); - _usrid = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - // load child objects - dr.NextResult(); - _groupassignments = GroupAssignments.Get(dr); - - // load child objects - dr.NextResult(); - _groupmemberships = GroupMemberships.Get(dr); - - } - } - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addGroup"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@groupName", _groupname); - cm.Parameters.AddWithValue("@groupType", _grouptype); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_gid = new SqlParameter("@newGID", SqlDbType.Int); - param_gid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_gid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _gid = (int)cm.Parameters["@newGID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - _groupassignments.Update(this, cn); - - _groupmemberships.Update(this, cn); - - } - - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int gid, string groupname, int grouptype, string config, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addGroup"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@groupName", groupname); - cm.Parameters.AddWithValue("@groupType", grouptype); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_gid = new SqlParameter("@newGID", SqlDbType.Int); - param_gid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_gid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - gid = (int)cm.Parameters["@newGID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateGroup"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@gID", _gid); - cm.Parameters.AddWithValue("@groupName", _groupname); - cm.Parameters.AddWithValue("@groupType", _grouptype); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - _groupassignments.Update(this, cn); - - _groupmemberships.Update(this, cn); - - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int gid, string groupname, int grouptype, string config, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateGroup"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@gID", gid); - cm.Parameters.AddWithValue("@groupName", groupname); - cm.Parameters.AddWithValue("@groupType", grouptype); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_gid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteGroup"; - cm.Parameters.AddWithValue("@gID", criteria.Gid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int gid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteGroup"; - // Input PK Fields - - cm.Parameters.AddWithValue("@gID", gid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int gid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(gid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _gid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int gid) - { - _gid = gid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsGroup"; - - cm.Parameters.AddWithValue("@gID", _gid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Group", ex); - } - } - } - - #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 GroupExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Group - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignment.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignment.cs deleted file mode 100644 index 1df07b69..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignment.cs +++ /dev/null @@ -1,591 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupAssignment : BusinessBase - { - #region Business Methods - - - 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 _rid; - [System.ComponentModel.DataObjectField(true, true)] - public int Rid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _rid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_rid != value) - { - _rid = value; - PropertyHasChanged(); - } - } - } - private int _folderid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folderid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folderid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_folderid != value) - { - _folderid = 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 int _folder_parentid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folder_Parentid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_parentid; - } - } - private int _folder_dbid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folder_Dbid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_dbid; - } - } - private string _folder_name = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_name; - } - } - private string _folder_title = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_title; - } - } - private string _folder_config = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_config; - } - } - private DateTime _folder_dts = new DateTime(); - [System.ComponentModel.DataObjectField(true, true)] - public DateTime Folder_Dts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_dts; - } - } - private string _folder_usrid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Usrid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_usrid; - } - } - private string _role_name = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_name; - } - } - private string _role_title = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_title; - } - } - private DateTime _role_dts = new DateTime(); - [System.ComponentModel.DataObjectField(true, true)] - public DateTime Role_Dts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_dts; - } - } - private string _role_usrid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Role_Usrid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _role_usrid; - } - } - // TODO: Check GroupAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupAssignment - protected override object GetIdValue() - { - return _aid; - } - // TODO: Replace base GroupAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupAssignment - //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(Aid, ""); - //AuthorizationRules.AllowRead(Rid, ""); - //AuthorizationRules.AllowWrite(Rid, ""); - //AuthorizationRules.AllowRead(Folderid, ""); - //AuthorizationRules.AllowWrite(Folderid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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 GroupAssignment New(int rid, int folderid) - { - return new GroupAssignment(Volian.Object.Library.Role.Get(rid), Volian.Object.Library.Folder.Get(folderid)); - } - - internal static GroupAssignment Get(SafeDataReader dr) - { - return new GroupAssignment(dr); - } - - private GroupAssignment() - { - MarkAsChild(); - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - } - - private GroupAssignment(Role role, Folder folder) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - _folderid = folder.Folderid; - _folder_parentid = folder.Parentid; - _folder_dbid = folder.Dbid; - _folder_name = folder.Name; - _folder_title = folder.Title; - _folder_config = folder.Config; - _folder_dts = folder.Dts; - _folder_usrid = folder.Usrid; - _rid = role.Rid; - _role_name = role.Name; - _role_title = role.Title; - _role_dts = role.Dts; - _role_usrid = role.Usrid; - } - - private GroupAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - - #endregion - #region Data Access Portal - - private void Fetch(SafeDataReader dr) - { - try - { - _aid = dr.GetInt32("AID"); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - _folder_parentid = dr.GetInt32("Folders_ParentID"); - _folder_dbid = dr.GetInt32("Folders_DBID"); - _folder_name = dr.GetString("Folders_Name"); - _folder_title = dr.GetString("Folders_Title"); - _folder_config = dr.GetString("Folders_Config"); - _folder_dts = dr.GetDateTime("Folders_DTS"); - _folder_usrid = dr.GetString("Folders_UsrID"); - _role_name = dr.GetString("Roles_Name"); - _role_title = dr.GetString("Roles_Title"); - _role_dts = dr.GetDateTime("Roles_DTS"); - _role_usrid = dr.GetString("Roles_UsrID"); - } - catch (Exception ex) - { - Database.LogException("GroupAssignment", ex); - } - MarkOld(); - } - - internal void Insert(Group group, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Add(cn, ref _aid, group.Gid, _rid, _folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid); - MarkOld(); - } - - internal void Update(Group group, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Update(cn, ref _aid, group.Gid, _rid, _folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged); - } - - internal void DeleteSelf(Group group, 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; - Assignment.Remove(cn, _aid); - 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 GroupAssignmentExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class GroupAssignment - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignments.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignments.cs deleted file mode 100644 index 72177fc0..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupAssignments.cs +++ /dev/null @@ -1,145 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupAssignments : BusinessListBase - { - #region Business Methods - - public GroupAssignment this[int folderid, int rid] - { - get - { - foreach (GroupAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Rid == rid) - return assignment; - return null; - } - } - public GroupAssignment GetItem(int folderid, int rid) - { - foreach (GroupAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Rid == rid) - return assignment; - return null; - } - - public void Add(int rid, int folderid) - { - if (!Contains(folderid, rid)) - { - GroupAssignment assignment = - GroupAssignment.New(rid, folderid); - this.Add(assignment); - } - else - throw new InvalidOperationException("assignment already exists"); - } - - public void Remove(int folderid, int rid) - { - foreach (GroupAssignment assignment in this) - { - if (assignment.Folderid == folderid && assignment.Rid == rid) - { - Remove(assignment); - break; - } - } - } - - public bool Contains(int folderid, int rid) - { - foreach (GroupAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Rid == rid) - return true; - return false; - } - - public bool ContainsDeleted(int folderid, int rid) - { - foreach (GroupAssignment assignment in DeletedList) - if (assignment.Folderid == folderid && assignment.Rid == rid) - return true; - return false; - } - - #endregion - #region Factory Methods - - internal static GroupAssignments New() - { - return new GroupAssignments(); - } - - internal static GroupAssignments Get(SafeDataReader dr) - { - return new GroupAssignments(dr); - } - - private GroupAssignments() - { - MarkAsChild(); - } - - private GroupAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(GroupAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Group group,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (GroupAssignment obj in DeletedList) - obj.DeleteSelf(group,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (GroupAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(group,cn); - else - obj.Update(group,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfo.cs deleted file mode 100644 index ff6c28b3..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfo.cs +++ /dev/null @@ -1,137 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check GroupInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfoList.cs deleted file mode 100644 index 106cf251..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static GroupInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static GroupInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private GroupInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroups"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new GroupInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("GroupInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembership.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembership.cs deleted file mode 100644 index dcbada3e..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembership.cs +++ /dev/null @@ -1,592 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupMembership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupMembership : BusinessBase - { - #region Business Methods - - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_uid != value) - { - _uid = 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 _user_userid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_Userid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_userid; - } - } - private string _user_firstname = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_FirstName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_firstname; - } - } - private string _user_middlename = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_MiddleName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_middlename; - } - } - private string _user_lastname = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_LastName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_lastname; - } - } - private string _user_suffix = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_Suffix - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_suffix; - } - } - private string _user_courtesytitle = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_CourtesyTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_courtesytitle; - } - } - private string _user_phonenumber = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_PhoneNumber - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_phonenumber; - } - } - private string _user_cfgname = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_CfgName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_cfgname; - } - } - private string _user_userlogin = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_UserLogin - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_userlogin; - } - } - private string _user_username = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_UserName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_username; - } - } - private string _user_config = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_config; - } - } - private DateTime _user_dts = new DateTime(); - [System.ComponentModel.DataObjectField(true, true)] - public DateTime User_Dts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_dts; - } - } - private string _user_usrid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string User_Usrid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _user_usrid; - } - } - // TODO: Check GroupMembership.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupMembership - protected override object GetIdValue() - { - return _ugid; - } - // TODO: Replace base GroupMembership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupMembership - //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, ""); - //AuthorizationRules.AllowRead(Uid, ""); - //AuthorizationRules.AllowWrite(Uid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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 GroupMembership New(int uid) - { - return new GroupMembership(Volian.Object.Library.User.Get(uid)); - } - - internal static GroupMembership Get(SafeDataReader dr) - { - return new GroupMembership(dr); - } - - private GroupMembership() - { - MarkAsChild(); - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - } - - private GroupMembership(User user) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - _uid = user.Uid; - _user_userid = user.Userid; - _user_firstname = user.FirstName; - _user_middlename = user.MiddleName; - _user_lastname = user.LastName; - _user_suffix = user.Suffix; - _user_courtesytitle = user.CourtesyTitle; - _user_phonenumber = user.PhoneNumber; - _user_cfgname = user.CfgName; - _user_userlogin = user.UserLogin; - _user_username = user.UserName; - _user_config = user.Config; - _user_dts = user.Dts; - _user_usrid = user.Usrid; - } - - private GroupMembership(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - - #endregion - #region Data Access Portal - - private void Fetch(SafeDataReader dr) - { - try - { - _ugid = dr.GetInt32("UGID"); - _uid = dr.GetInt32("UID"); - _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); - _user_userid = dr.GetString("Users_UserID"); - _user_firstname = dr.GetString("Users_FirstName"); - _user_middlename = dr.GetString("Users_MiddleName"); - _user_lastname = dr.GetString("Users_LastName"); - _user_suffix = dr.GetString("Users_Suffix"); - _user_courtesytitle = dr.GetString("Users_CourtesyTitle"); - _user_phonenumber = dr.GetString("Users_PhoneNumber"); - _user_cfgname = dr.GetString("Users_CFGName"); - _user_userlogin = dr.GetString("Users_UserLogin"); - _user_username = dr.GetString("Users_UserName"); - _user_config = dr.GetString("Users_Config"); - _user_dts = dr.GetDateTime("Users_DTS"); - _user_usrid = dr.GetString("Users_UsrID"); - } - catch (Exception ex) - { - Database.LogException("GroupMembership", ex); - } - MarkOld(); - } - - internal void Insert(Group group, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Membership.Add(cn, ref _ugid, _uid, group.Gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid); - MarkOld(); - } - - internal void Update(Group group, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Membership.Update(cn, ref _ugid, _uid, group.Gid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged); - } - - internal void DeleteSelf(Group group, 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 GroupMembershipExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class GroupMembership - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembershipExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembershipExt.cs deleted file mode 100644 index bdec66b7..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMembershipExt.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace Volian.Object.Library -{ - public partial class GroupMembership : BusinessBase - { - public string User_FullName - { - get { return User_LastName + ", " + User_FirstName; } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMemberships.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMemberships.cs deleted file mode 100644 index 5e5651bd..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/GroupMemberships.cs +++ /dev/null @@ -1,145 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// GroupMemberships Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class GroupMemberships : BusinessListBase - { - #region Business Methods - - public new GroupMembership this[int uid] - { - get - { - foreach (GroupMembership membership in this) - if (membership.Uid == uid) - return membership; - return null; - } - } - public GroupMembership GetItem(int uid) - { - foreach (GroupMembership membership in this) - if (membership.Uid == uid) - return membership; - return null; - } - - public void Add(int uid) - { - if (!Contains(uid)) - { - GroupMembership membership = - GroupMembership.New(uid); - this.Add(membership); - } - else - throw new InvalidOperationException("membership already exists"); - } - - public void Remove(int uid) - { - foreach (GroupMembership membership in this) - { - if (membership.Uid == uid) - { - Remove(membership); - break; - } - } - } - - public bool Contains(int uid) - { - foreach (GroupMembership membership in this) - if (membership.Uid == uid) - return true; - return false; - } - - public bool ContainsDeleted(int uid) - { - foreach (GroupMembership membership in DeletedList) - if (membership.Uid == uid) - return true; - return false; - } - - #endregion - #region Factory Methods - - internal static GroupMemberships New() - { - return new GroupMemberships(); - } - - internal static GroupMemberships Get(SafeDataReader dr) - { - return new GroupMemberships(dr); - } - - private GroupMemberships() - { - MarkAsChild(); - } - - private GroupMemberships(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(GroupMembership.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Group group,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (GroupMembership obj in DeletedList) - obj.DeleteSelf(group,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (GroupMembership obj in this) - { - if (obj.IsNew) - obj.Insert(group,cn); - else - obj.Update(group,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Membership.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Membership.cs deleted file mode 100644 index a437ce11..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Membership.cs +++ /dev/null @@ -1,738 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Membership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Membership : BusinessBase - { - #region Business Methods - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_uid != value) - { - _uid = value; - PropertyHasChanged(); - } - } - } - 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 - // TODO: Replace base Membership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Membership - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Membership.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Membership - protected override object GetIdValue() - { - return _ugid; - } - - #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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - 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, ""); - //AuthorizationRules.AllowRead(Uid, ""); - //AuthorizationRules.AllowRead(Gid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Uid, ""); - //AuthorizationRules.AllowWrite(Gid, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Membership() - {/* require use of factory methods */} - - public static Membership New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Membership"); - return DataPortal.Create(); - } - - public static Membership Get(int _ugid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Membership"); - return DataPortal.Fetch(new PKCriteria(_ugid)); - } - - public static void Delete(int _ugid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Membership"); - DataPortal.Delete(new PKCriteria(_ugid)); - } - - public override Membership Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Membership"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Membership"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Membership"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _ugid; - public int Ugid - { get { return _ugid; } } - public PKCriteria(int ugid) - { - _ugid = ugid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembership"; - cm.Parameters.AddWithValue("@uGID", criteria.Ugid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - } - } - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addMembership"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@uID", _uid); - cm.Parameters.AddWithValue("@gID", _gid); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_ugid = new SqlParameter("@newUGID", SqlDbType.Int); - param_ugid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ugid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ugid = (int)cm.Parameters["@newUGID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - } - - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int ugid, int uid, int gid, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addMembership"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@uID", uid); - cm.Parameters.AddWithValue("@gID", gid); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_ugid = new SqlParameter("@newUGID", SqlDbType.Int); - param_ugid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ugid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - ugid = (int)cm.Parameters["@newUGID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateMembership"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@uGID", _ugid); - cm.Parameters.AddWithValue("@uID", _uid); - cm.Parameters.AddWithValue("@gID", _gid); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int ugid, int uid, int gid, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateMembership"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@uGID", ugid); - cm.Parameters.AddWithValue("@uID", uid); - cm.Parameters.AddWithValue("@gID", gid); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ugid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteMembership"; - cm.Parameters.AddWithValue("@uGID", criteria.Ugid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int ugid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteMembership"; - // Input PK Fields - - cm.Parameters.AddWithValue("@uGID", ugid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int ugid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(ugid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _ugid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int ugid) - { - _ugid = ugid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsMembership"; - - cm.Parameters.AddWithValue("@uGID", _ugid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Membership", ex); - } - } - } - - #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 MembershipExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Membership - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfo.cs deleted file mode 100644 index e3d52e28..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfo.cs +++ /dev/null @@ -1,148 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// MembershipInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class MembershipInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current MembershipInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check MembershipInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current MembershipInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfoList.cs deleted file mode 100644 index 82ca039c..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/MembershipInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// MembershipInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class MembershipInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static MembershipInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static MembershipInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private MembershipInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMemberships"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new MembershipInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("MembershipInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Permission.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Permission.cs deleted file mode 100644 index 99a98447..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Permission.cs +++ /dev/null @@ -1,837 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Permission Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Permission : BusinessBase - { - #region Business Methods - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_rid != value) - { - _rid = value; - PropertyHasChanged(); - } - } - } - private int _permlevel; - /// - /// 0 - Security, 1 - System, 2 - RO, 3 - Procdures, 4 - Sections, 5 - Steps, 6 - Comments - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permlevel; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permlevel != value) - { - _permlevel = value; - PropertyHasChanged(); - } - } - } - private int _versiontype; - /// - /// 0 - Working Draft, 1 - Temporary Change, 2 Approved - /// - [System.ComponentModel.DataObjectField(true, true)] - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _versiontype; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_versiontype != value) - { - _versiontype = value; - PropertyHasChanged(); - } - } - } - private int _permvalue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permvalue; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permvalue != value) - { - _permvalue = value; - PropertyHasChanged(); - } - } - } - private int _permad; - /// - /// 0 - Allow, 1 - Deny - /// - [System.ComponentModel.DataObjectField(true, true)] - public int Permad - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permad; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permad != value) - { - _permad = 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 - // TODO: Replace base Permission.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Permission - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Permission.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Permission - protected override object GetIdValue() - { - return _pid; - } - - #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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - 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(Pid, ""); - //AuthorizationRules.AllowRead(Rid, ""); - //AuthorizationRules.AllowRead(PermLevel, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowRead(PermValue, ""); - //AuthorizationRules.AllowRead(Permad, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Rid, ""); - //AuthorizationRules.AllowWrite(PermLevel, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowWrite(PermValue, ""); - //AuthorizationRules.AllowWrite(Permad, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Permission() - {/* require use of factory methods */} - - public static Permission New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Permission"); - return DataPortal.Create(); - } - - public static Permission Get(int _pid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Permission"); - return DataPortal.Fetch(new PKCriteria(_pid)); - } - - public static void Delete(int _pid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Permission"); - DataPortal.Delete(new PKCriteria(_pid)); - } - - public override Permission Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Permission"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Permission"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Permission"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _pid; - public int Pid - { get { return _pid; } } - public PKCriteria(int pid) - { - _pid = pid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _permad = ext.DefaultPermad; - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermission"; - cm.Parameters.AddWithValue("@pID", criteria.Pid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - } - } - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPermission"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@rID", _rid); - cm.Parameters.AddWithValue("@permLevel", _permlevel); - cm.Parameters.AddWithValue("@versionType", _versiontype); - cm.Parameters.AddWithValue("@permValue", _permvalue); - cm.Parameters.AddWithValue("@permAD", _permad); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_pid = new SqlParameter("@newPID", SqlDbType.Int); - param_pid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_pid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _pid = (int)cm.Parameters["@newPID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - } - - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int pid, int rid, int permlevel, int versiontype, int permvalue, int permad, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPermission"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@rID", rid); - cm.Parameters.AddWithValue("@permLevel", permlevel); - cm.Parameters.AddWithValue("@versionType", versiontype); - cm.Parameters.AddWithValue("@permValue", permvalue); - cm.Parameters.AddWithValue("@permAD", permad); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_pid = new SqlParameter("@newPID", SqlDbType.Int); - param_pid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_pid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - pid = (int)cm.Parameters["@newPID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePermission"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@pID", _pid); - cm.Parameters.AddWithValue("@rID", _rid); - cm.Parameters.AddWithValue("@permLevel", _permlevel); - cm.Parameters.AddWithValue("@versionType", _versiontype); - cm.Parameters.AddWithValue("@permValue", _permvalue); - cm.Parameters.AddWithValue("@permAD", _permad); - cm.Parameters.AddWithValue("@startDate", new SmartDate(_startdate).DBValue); - cm.Parameters.AddWithValue("@endDate", new SmartDate(_enddate).DBValue); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int pid, int rid, int permlevel, int versiontype, int permvalue, int permad, SmartDate startdate, SmartDate enddate, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePermission"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@pID", pid); - cm.Parameters.AddWithValue("@rID", rid); - cm.Parameters.AddWithValue("@permLevel", permlevel); - cm.Parameters.AddWithValue("@versionType", versiontype); - cm.Parameters.AddWithValue("@permValue", permvalue); - cm.Parameters.AddWithValue("@permAD", permad); - cm.Parameters.AddWithValue("@startDate", startdate.DBValue); - cm.Parameters.AddWithValue("@endDate", enddate.DBValue); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_pid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePermission"; - cm.Parameters.AddWithValue("@pID", criteria.Pid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int pid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePermission"; - // Input PK Fields - - cm.Parameters.AddWithValue("@pID", pid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int pid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(pid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _pid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int pid) - { - _pid = pid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsPermission"; - - cm.Parameters.AddWithValue("@pID", _pid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Permission", ex); - } - } - } - - #endregion - - // Standard Default Code - // #region extension - Extension ext = new Extension(); - [Serializable()] - partial class Extension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultPermad - { - get { return 0; } - } - 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 PermissionExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Permission - // { - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultPermad - // { - // get { return 0; } - // } - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionExt.cs deleted file mode 100644 index 88de545a..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionExt.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace Volian.Object.Library -{ - public partial class Permission - { - private static List _permADLookup; - private static List _permLevelLookup; - private static void setupLookup() - { - if (_permADLookup == null) - { - _permADLookup = new List(); - _permADLookup.Add(new vlnValueKey(0,"Allow")); - _permADLookup.Add(new vlnValueKey(1, "Deny")); - } - if (_permLevelLookup == null) - { - _permLevelLookup = new List(); - _permLevelLookup.Add(new vlnValueKey(0, "Security")); - _permLevelLookup.Add(new vlnValueKey(1, "System")); - _permLevelLookup.Add(new vlnValueKey(2, "RO")); - _permLevelLookup.Add(new vlnValueKey(3, "Procedure")); - _permLevelLookup.Add(new vlnValueKey(4, "Sections")); - _permLevelLookup.Add(new vlnValueKey(5, "Steps")); - _permLevelLookup.Add(new vlnValueKey(6, "Comments")); - } - } - public static List PermADLookup - { - get { setupLookup(); return _permADLookup; } - } - public static List PermLevelLookup - { - get { setupLookup(); return _permLevelLookup; } - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value?PermValue|1:PermValue^(PermValue&1));} - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultPermad - // { - // get { return 0; } - // } - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfo.cs deleted file mode 100644 index 45ea6159..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfo.cs +++ /dev/null @@ -1,193 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// PermissionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class PermissionInfo : ReadOnlyBase - { - #region Business Methods - - - 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; - /// - /// 0 - Security, 1 - System, 2 - RO, 3 - Procdures, 4 - Sections, 5 - Steps, 6 - Comments - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permlevel; - } - } - private int _versiontype; - /// - /// 0 - Working Draft, 1 - Temporary Change, 2 Approved - /// - [System.ComponentModel.DataObjectField(true, true)] - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _versiontype; - } - } - private int _permvalue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permvalue; - } - } - private int _permad; - /// - /// 0 - Allow, 1 - Deny - /// - [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 - /// - /// Overrides Base ToString - /// - /// A string representation of current PermissionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check PermissionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current PermissionInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfoList.cs deleted file mode 100644 index 31c0f932..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// PermissionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class PermissionInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static PermissionInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static PermissionInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private PermissionInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermissions"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new PermissionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("PermissionInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRole.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRole.cs deleted file mode 100644 index b3fd14bd..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRole.cs +++ /dev/null @@ -1,369 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// PermissionRole Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class PermissionRole : BusinessBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current PermissionRole - protected override object GetIdValue() - { - return _rid; - } - // TODO: Replace base PermissionRole.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current PermissionRole - //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, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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) - { - 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRoles.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRoles.cs deleted file mode 100644 index d20e0aaa..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/PermissionRoles.cs +++ /dev/null @@ -1,85 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// PermissionRoles Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class PermissionRoles : BusinessListBase - { -// No Columns to retrieve - #region Factory Methods - - internal static PermissionRoles New() - { - return new PermissionRoles(); - } - - internal static PermissionRoles Get(SafeDataReader dr) - { - return new PermissionRoles(dr); - } - - private PermissionRoles() - { - MarkAsChild(); - } - - private PermissionRoles(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(PermissionRole.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Permission permission,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (PermissionRole obj in DeletedList) - obj.DeleteSelf(permission,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (PermissionRole obj in this) - { - if (obj.IsNew) - obj.Insert(permission,cn); - else - obj.Update(permission,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Properties/AssemblyInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Properties/AssemblyInfo.cs deleted file mode 100644 index 21b06c7d..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Volian.Object.Library")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises, Inc.")] -[assembly: AssemblyProduct("Volian.Object.Library")] -[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d6450c32-46ad-4f6f-9609-ad3a96730bfe")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Role.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/Role.cs deleted file mode 100644 index e36e8860..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Role.cs +++ /dev/null @@ -1,691 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// Role Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class Role : BusinessBase - { - #region Business Methods - - 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 - private RoleAssignments _roleassignments = RoleAssignments.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public RoleAssignments RoleAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _roleassignments; - } - } - private RolePermissions _rolepermissions = RolePermissions.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public RolePermissions RolePermissions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _rolepermissions; - } - } - public override bool IsDirty - { - get { return base.IsDirty || _roleassignments.IsDirty || _rolepermissions.IsDirty; } - } - public override bool IsValid - { - get { return base.IsValid && _roleassignments.IsValid && _rolepermissions.IsValid; } - } - // TODO: Replace base Role.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Role - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check Role.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Role - protected override object GetIdValue() - { - return _rid; - } - - #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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - // 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, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private Role() - {/* require use of factory methods */} - - public static Role New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Role"); - return DataPortal.Create(); - } - - public static Role Get(int _rid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Role"); - return DataPortal.Fetch(new PKCriteria(_rid)); - } - - public static void Delete(int _rid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Role"); - DataPortal.Delete(new PKCriteria(_rid)); - } - - public override Role Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Role"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Role"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Role"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _rid; - public int Rid - { get { return _rid; } } - public PKCriteria(int rid) - { - _rid = rid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRole"; - cm.Parameters.AddWithValue("@rID", criteria.Rid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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); - // load child objects - dr.NextResult(); - _roleassignments = RoleAssignments.Get(dr); - - // load child objects - dr.NextResult(); - _rolepermissions = RolePermissions.Get(dr); - - } - } - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRole"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_rid = new SqlParameter("@newRID", SqlDbType.Int); - param_rid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_rid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _rid = (int)cm.Parameters["@newRID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - _roleassignments.Update(this, cn); - - _rolepermissions.Update(this, cn); - - } - - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRole"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_rid = new SqlParameter("@newRID", SqlDbType.Int); - param_rid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_rid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - rid = (int)cm.Parameters["@newRID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRole"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@rID", _rid); - cm.Parameters.AddWithValue("@name", _name); - cm.Parameters.AddWithValue("@title", _title); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - _roleassignments.Update(this, cn); - - _rolepermissions.Update(this, cn); - - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRole"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@rID", rid); - cm.Parameters.AddWithValue("@name", name); - cm.Parameters.AddWithValue("@title", title); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_rid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRole"; - cm.Parameters.AddWithValue("@rID", criteria.Rid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRole"; - // Input PK Fields - - cm.Parameters.AddWithValue("@rID", rid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int rid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(rid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _rid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int rid) - { - _rid = rid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsRole"; - - cm.Parameters.AddWithValue("@rID", _rid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("Role", ex); - } - } - } - - #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 RoleExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class Role - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignment.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignment.cs deleted file mode 100644 index c618b621..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignment.cs +++ /dev/null @@ -1,603 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RoleAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RoleAssignment : BusinessBase - { - #region Business Methods - - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_gid != value) - { - _gid = value; - PropertyHasChanged(); - } - } - } - private int _folderid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folderid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folderid; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_folderid != value) - { - _folderid = 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 int _folder_parentid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folder_Parentid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_parentid; - } - } - private int _folder_dbid; - [System.ComponentModel.DataObjectField(true, true)] - public int Folder_Dbid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_dbid; - } - } - private string _folder_name = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_name; - } - } - private string _folder_title = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_title; - } - } - private string _folder_config = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_config; - } - } - private DateTime _folder_dts = new DateTime(); - [System.ComponentModel.DataObjectField(true, true)] - public DateTime Folder_Dts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_dts; - } - } - private string _folder_usrid = string.Empty; - [System.ComponentModel.DataObjectField(true, true)] - public string Folder_Usrid - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _folder_usrid; - } - } - 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 RoleAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoleAssignment - protected override object GetIdValue() - { - return _aid; - } - // TODO: Replace base RoleAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RoleAssignment - //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(Aid, ""); - //AuthorizationRules.AllowRead(Gid, ""); - //AuthorizationRules.AllowWrite(Gid, ""); - //AuthorizationRules.AllowRead(Folderid, ""); - //AuthorizationRules.AllowWrite(Folderid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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 RoleAssignment New(int gid, int folderid) - { - return new RoleAssignment(Volian.Object.Library.Group.Get(gid), Volian.Object.Library.Folder.Get(folderid)); - } - - internal static RoleAssignment Get(SafeDataReader dr) - { - return new RoleAssignment(dr); - } - - private RoleAssignment() - { - MarkAsChild(); - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - } - - private RoleAssignment(Group group, Folder folder) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - _folderid = folder.Folderid; - _folder_parentid = folder.Parentid; - _folder_dbid = folder.Dbid; - _folder_name = folder.Name; - _folder_title = folder.Title; - _folder_config = folder.Config; - _folder_dts = folder.Dts; - _folder_usrid = folder.Usrid; - _gid = group.Gid; - _group_groupname = group.GroupName; - _group_grouptype = group.GroupType; - _group_config = group.Config; - _group_dts = group.Dts; - _group_usrid = group.Usrid; - } - - private RoleAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - - #endregion - #region Data Access Portal - - private void Fetch(SafeDataReader dr) - { - try - { - _aid = dr.GetInt32("AID"); - _gid = dr.GetInt32("GID"); - _folderid = dr.GetInt32("FolderID"); - _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); - _folder_parentid = dr.GetInt32("Folders_ParentID"); - _folder_dbid = dr.GetInt32("Folders_DBID"); - _folder_name = dr.GetString("Folders_Name"); - _folder_title = dr.GetString("Folders_Title"); - _folder_config = dr.GetString("Folders_Config"); - _folder_dts = dr.GetDateTime("Folders_DTS"); - _folder_usrid = dr.GetString("Folders_UsrID"); - _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("RoleAssignment", ex); - } - MarkOld(); - } - - internal void Insert(Role role, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Add(cn, ref _aid, _gid, role.Rid, _folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid); - MarkOld(); - } - - internal void Update(Role role, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Assignment.Update(cn, ref _aid, _gid, role.Rid, _folderid, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged); - } - - internal void DeleteSelf(Role role, 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; - Assignment.Remove(cn, _aid); - 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 RoleAssignmentExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class RoleAssignment - // { - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignments.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignments.cs deleted file mode 100644 index b89502bd..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleAssignments.cs +++ /dev/null @@ -1,145 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RoleAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RoleAssignments : BusinessListBase - { - #region Business Methods - - public RoleAssignment this[int folderid, int gid] - { - get - { - foreach (RoleAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Gid == gid) - return assignment; - return null; - } - } - public RoleAssignment GetItem(int folderid, int gid) - { - foreach (RoleAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Gid == gid) - return assignment; - return null; - } - - public void Add(int gid, int folderid) - { - if (!Contains(folderid, gid)) - { - RoleAssignment assignment = - RoleAssignment.New(gid, folderid); - this.Add(assignment); - } - else - throw new InvalidOperationException("assignment already exists"); - } - - public void Remove(int folderid, int gid) - { - foreach (RoleAssignment assignment in this) - { - if (assignment.Folderid == folderid && assignment.Gid == gid) - { - Remove(assignment); - break; - } - } - } - - public bool Contains(int folderid, int gid) - { - foreach (RoleAssignment assignment in this) - if (assignment.Folderid == folderid && assignment.Gid == gid) - return true; - return false; - } - - public bool ContainsDeleted(int folderid, int gid) - { - foreach (RoleAssignment assignment in DeletedList) - if (assignment.Folderid == folderid && assignment.Gid == gid) - return true; - return false; - } - - #endregion - #region Factory Methods - - internal static RoleAssignments New() - { - return new RoleAssignments(); - } - - internal static RoleAssignments Get(SafeDataReader dr) - { - return new RoleAssignments(dr); - } - - private RoleAssignments() - { - MarkAsChild(); - } - - private RoleAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RoleAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Role role,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (RoleAssignment obj in DeletedList) - obj.DeleteSelf(role,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (RoleAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(role,cn); - else - obj.Update(role,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfo.cs deleted file mode 100644 index cf725ff9..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfo.cs +++ /dev/null @@ -1,126 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RoleInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RoleInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current RoleInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check RoleInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoleInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfoList.cs deleted file mode 100644 index 85901f39..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RoleInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RoleInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RoleInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static RoleInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static RoleInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private RoleInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoles"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new RoleInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("RoleInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissinExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissinExt.cs deleted file mode 100644 index c18b4346..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissinExt.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace Volian.Object.Library -{ - public partial class RolePermission : BusinessBase - { - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value ? PermValue | 1 : PermValue ^ (PermValue & 1)); } - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermission.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermission.cs deleted file mode 100644 index a2306570..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermission.cs +++ /dev/null @@ -1,525 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RolePermission Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RolePermission : BusinessBase - { - #region Business Methods - - - 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 _permlevel; - /// - /// 0 - Security, 1 - System, 2 - RO, 3 - Procdures, 4 - Sections, 5 - Steps, 6 - Comments - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permlevel; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permlevel != value) - { - _permlevel = value; - PropertyHasChanged(); - } - } - } - private int _versiontype; - /// - /// 0 - Working Draft, 1 - Temporary Change, 2 Approved - /// - [System.ComponentModel.DataObjectField(true, true)] - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _versiontype; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_versiontype != value) - { - _versiontype = value; - PropertyHasChanged(); - } - } - } - private int _permvalue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - [System.ComponentModel.DataObjectField(true, true)] - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permvalue; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permvalue != value) - { - _permvalue = value; - PropertyHasChanged(); - } - } - } - private int _permad; - /// - /// 0 - Allow, 1 - Deny - /// - [System.ComponentModel.DataObjectField(true, true)] - public int Permad - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _permad; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_permad != value) - { - _permad = 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 - // TODO: Check RolePermission.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RolePermission - protected override object GetIdValue() - { - return _pid; - } - // TODO: Replace base RolePermission.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RolePermission - //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(Pid, ""); - //AuthorizationRules.AllowRead(PermLevel, ""); - //AuthorizationRules.AllowWrite(PermLevel, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowRead(PermValue, ""); - //AuthorizationRules.AllowWrite(PermValue, ""); - //AuthorizationRules.AllowRead(Permad, ""); - //AuthorizationRules.AllowWrite(Permad, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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 RolePermission New(int permlevel, int versiontype, int permvalue) - { - return new RolePermission(permlevel, versiontype, permvalue); - } - - internal static RolePermission Get(SafeDataReader dr) - { - return new RolePermission(dr); - } - - private RolePermission() - { - MarkAsChild(); - _permad = ext.DefaultPermad; - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - } - - private RolePermission(int permlevel, int versiontype, int permvalue) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _permad = ext.DefaultPermad; - _startdate = ext.DefaultStartDate; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - _permlevel = permlevel; - _versiontype = versiontype; - _permvalue = permvalue; - } - - private RolePermission(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - - #endregion - #region Data Access Portal - - private void Fetch(SafeDataReader dr) - { - try - { - _pid = dr.GetInt32("PID"); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - } - catch (Exception ex) - { - Database.LogException("RolePermission", ex); - } - MarkOld(); - } - - internal void Insert(Role role, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Permission.Add(cn, ref _pid, role.Rid, _permlevel, _versiontype, _permvalue, _permad, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid); - MarkOld(); - } - - internal void Update(Role role, SqlConnection cn) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - _lastchanged = Permission.Update(cn, ref _pid, role.Rid, _permlevel, _versiontype, _permvalue, _permad, new SmartDate(_startdate), new SmartDate(_enddate), _dts, _usrid, ref _lastchanged); - } - - internal void DeleteSelf(Role role, 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; - Permission.Remove(cn, _pid); - MarkNew(); - } - - #endregion - // Standard Default Code - // #region extension - Extension ext = new Extension(); - [Serializable()] - partial class Extension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultPermad - { - get { return 0; } - } - 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 RolePermissionExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class RolePermission - // { - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultPermad - // { - // get { return 0; } - // } - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissionExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissionExt.cs deleted file mode 100644 index 60805696..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissionExt.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace Volian.Object.Library -{ - public partial class RolePermission : BusinessBase - { - public static RolePermission New() - { - return new RolePermission(1, 1, 1); - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value ? PermValue | 1 : PermValue ^ (PermValue & 1)); } - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } - public class PermLookup - { - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissions.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissions.cs deleted file mode 100644 index 7fb3c2a3..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/RolePermissions.cs +++ /dev/null @@ -1,85 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// RolePermissions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class RolePermissions : BusinessListBase - { -// No Columns to retrieve - #region Factory Methods - - internal static RolePermissions New() - { - return new RolePermissions(); - } - - internal static RolePermissions Get(SafeDataReader dr) - { - return new RolePermissions(dr); - } - - private RolePermissions() - { - MarkAsChild(); - } - - private RolePermissions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RolePermission.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(Role role,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (RolePermission obj in DeletedList) - obj.DeleteSelf(role,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (RolePermission obj in this) - { - if (obj.IsNew) - obj.Insert(role,cn); - else - obj.Update(role,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/User.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/User.cs deleted file mode 100644 index 03b0e1a9..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/User.cs +++ /dev/null @@ -1,944 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// User Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class User : BusinessBase - { - #region Business Methods - - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_userid != value) - { - _userid = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_firstname != value) - { - _firstname = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_middlename != value) - { - _middlename = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_lastname != value) - { - _lastname = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_suffix != value) - { - _suffix = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_courtesytitle != value) - { - _courtesytitle = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_phonenumber != value) - { - _phonenumber = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_cfgname != value) - { - _cfgname = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_userlogin != value) - { - _userlogin = value; - PropertyHasChanged(); - } - } - } - 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; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_username != value) - { - _username = 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 - private UserMemberships _usermemberships = UserMemberships.New(); - /// - /// Related Field - /// - [System.ComponentModel.DataObjectField(true, true)] - public UserMemberships UserMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _usermemberships; - } - } - public override bool IsDirty - { - get { return base.IsDirty || _usermemberships.IsDirty; } - } - public override bool IsValid - { - get { return base.IsValid && _usermemberships.IsValid; } - } - // TODO: Replace base User.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current User - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check User.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current User - protected override object GetIdValue() - { - return _uid; - } - - #endregion - - #region ValidationRules - - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Userid", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FirstName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("MiddleName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("LastName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Suffix", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("CourtesyTitle", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("PhoneNumber", 30)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("CfgName", 8)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserLogin", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserName", 32)); - 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)); - ext.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - // ValidationRules.AddRule(StartDateGTEndDate, "Started"); - } - // 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(Uid, ""); - //AuthorizationRules.AllowRead(Userid, ""); - //AuthorizationRules.AllowRead(FirstName, ""); - //AuthorizationRules.AllowRead(MiddleName, ""); - //AuthorizationRules.AllowRead(LastName, ""); - //AuthorizationRules.AllowRead(Suffix, ""); - //AuthorizationRules.AllowRead(CourtesyTitle, ""); - //AuthorizationRules.AllowRead(PhoneNumber, ""); - //AuthorizationRules.AllowRead(CfgName, ""); - //AuthorizationRules.AllowRead(UserLogin, ""); - //AuthorizationRules.AllowRead(UserName, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Userid, ""); - //AuthorizationRules.AllowWrite(FirstName, ""); - //AuthorizationRules.AllowWrite(MiddleName, ""); - //AuthorizationRules.AllowWrite(LastName, ""); - //AuthorizationRules.AllowWrite(Suffix, ""); - //AuthorizationRules.AllowWrite(CourtesyTitle, ""); - //AuthorizationRules.AllowWrite(PhoneNumber, ""); - //AuthorizationRules.AllowWrite(CfgName, ""); - //AuthorizationRules.AllowWrite(UserLogin, ""); - //AuthorizationRules.AllowWrite(UserName, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - ext.AddAuthorizationRules(AuthorizationRules); - } - - 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 - - private User() - {/* require use of factory methods */} - - public static User New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a User"); - return DataPortal.Create(); - } - - public static User Get(int _uid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a User"); - return DataPortal.Fetch(new PKCriteria(_uid)); - } - - public static void Delete(int _uid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a User"); - DataPortal.Delete(new PKCriteria(_uid)); - } - - public override User Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a User"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a User"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a User"); - return base.Save(); - } - - #endregion - - #region Data Access Portal - - [Serializable()] - private class PKCriteria - { - private int _uid; - public int Uid - { get { return _uid; } } - public PKCriteria(int uid) - { - _uid = uid; - } - } - // If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create(object criteria) - { - - // Database Defaults - _userid = ext.DefaultUserid; - _dts = ext.DefaultDts; - _usrid = ext.DefaultUsrid; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - - private void DataPortal_Fetch(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUser"; - cm.Parameters.AddWithValue("@uID", criteria.Uid); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - dr.Read(); - _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"); - dr.GetBytes("LastChanged", 0, _lastchanged, 0, 8); - // load child objects - dr.NextResult(); - _usermemberships = UserMemberships.Get(dr); - - } - } - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addUser"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@userID", _userid); - cm.Parameters.AddWithValue("@firstName", _firstname); - cm.Parameters.AddWithValue("@middleName", _middlename); - cm.Parameters.AddWithValue("@lastName", _lastname); - cm.Parameters.AddWithValue("@suffix", _suffix); - cm.Parameters.AddWithValue("@courtesyTitle", _courtesytitle); - cm.Parameters.AddWithValue("@phoneNumber", _phonenumber); - cm.Parameters.AddWithValue("@cFGName", _cfgname); - cm.Parameters.AddWithValue("@userLogin", _userlogin); - cm.Parameters.AddWithValue("@userName", _username); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - // Output Calculated Columns - SqlParameter param_uid = new SqlParameter("@newUID", SqlDbType.Int); - param_uid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_uid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _uid = (int)cm.Parameters["@newUID"].Value; - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - // update child objects - _usermemberships.Update(this, cn); - - } - - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int uid, string userid, string firstname, string middlename, string lastname, string suffix, string courtesytitle, string phonenumber, string cfgname, string userlogin, string username, string config, DateTime dts, string usrid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addUser"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@userID", userid); - cm.Parameters.AddWithValue("@firstName", firstname); - cm.Parameters.AddWithValue("@middleName", middlename); - cm.Parameters.AddWithValue("@lastName", lastname); - cm.Parameters.AddWithValue("@suffix", suffix); - cm.Parameters.AddWithValue("@courtesyTitle", courtesytitle); - cm.Parameters.AddWithValue("@phoneNumber", phonenumber); - cm.Parameters.AddWithValue("@cFGName", cfgname); - cm.Parameters.AddWithValue("@userLogin", userlogin); - cm.Parameters.AddWithValue("@userName", username); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - // Output Calculated Columns - SqlParameter param_uid = new SqlParameter("@newUID", SqlDbType.Int); - param_uid.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_uid); - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - uid = (int)cm.Parameters["@newUID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (IsDirty)// If this is dirty - open the connection - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateUser"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@uID", _uid); - cm.Parameters.AddWithValue("@userID", _userid); - cm.Parameters.AddWithValue("@firstName", _firstname); - cm.Parameters.AddWithValue("@middleName", _middlename); - cm.Parameters.AddWithValue("@lastName", _lastname); - cm.Parameters.AddWithValue("@suffix", _suffix); - cm.Parameters.AddWithValue("@courtesyTitle", _courtesytitle); - cm.Parameters.AddWithValue("@phoneNumber", _phonenumber); - cm.Parameters.AddWithValue("@cFGName", _cfgname); - cm.Parameters.AddWithValue("@userLogin", _userlogin); - cm.Parameters.AddWithValue("@userName", _username); - cm.Parameters.AddWithValue("@config", _config); - cm.Parameters.AddWithValue("@dTS", _dts); - cm.Parameters.AddWithValue("@usrID", _usrid); - cm.Parameters.AddWithValue("@lastChanged", _lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _lastchanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - // use the open connection to update child objects - _usermemberships.Update(this, cn); - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - - } - } - - - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int uid, string userid, string firstname, string middlename, string lastname, string suffix, string courtesytitle, string phonenumber, string cfgname, string userlogin, string username, string config, DateTime dts, string usrid, ref byte[] lastchanged) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateUser"; - // Input All Fields - Except Calculated Columns - - cm.Parameters.AddWithValue("@uID", uid); - cm.Parameters.AddWithValue("@userID", userid); - cm.Parameters.AddWithValue("@firstName", firstname); - cm.Parameters.AddWithValue("@middleName", middlename); - cm.Parameters.AddWithValue("@lastName", lastname); - cm.Parameters.AddWithValue("@suffix", suffix); - cm.Parameters.AddWithValue("@courtesyTitle", courtesytitle); - cm.Parameters.AddWithValue("@phoneNumber", phonenumber); - cm.Parameters.AddWithValue("@cFGName", cfgname); - cm.Parameters.AddWithValue("@userLogin", userlogin); - cm.Parameters.AddWithValue("@userName", username); - cm.Parameters.AddWithValue("@config", config); - cm.Parameters.AddWithValue("@dTS", dts); - cm.Parameters.AddWithValue("@usrID", usrid); - cm.Parameters.AddWithValue("@lastChanged", lastchanged); - // Output Calculated Columns - SqlParameter param_lastchanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_lastchanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_lastchanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - return null; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_uid)); - } - - - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteUser"; - cm.Parameters.AddWithValue("@uID", criteria.Uid); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - } - - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int uid) - { - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteUser"; - // Input PK Fields - - cm.Parameters.AddWithValue("@uID", uid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - } - - #endregion - - #region Exists - - - public static bool Exists(int uid) - { - ExistsCommand result; - result = DataPortal.Execute - (new ExistsCommand(uid)); - return result.Exists; - } - - [Serializable()] - private class ExistsCommand : CommandBase - { - - private int _uid; - private bool _exists; - - public bool Exists - { - get { return _exists; } - } - - public ExistsCommand(int uid) - { - _uid = uid; - } - - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsUser"; - - cm.Parameters.AddWithValue("@uID", _uid); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - Database.LogException("User", ex); - } - } - } - - #endregion - - // Standard Default Code - // #region extension - Extension ext = new Extension(); - [Serializable()] - partial class Extension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultUserid - { - get { return Environment.UserName.ToUpper(); } - } - 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 UserExt.cs - //using System; - //using System.Collections.Generic; - //using System.Text; - //using Csla; - - //namespace PatrialClass - //{ - // public partial class User - // { - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual string DefaultUserid - // { - // get { return Environment.UserName.ToUpper(); } - // } - // 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserExt.cs deleted file mode 100644 index d809ef36..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserExt.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace Volian.Object.Library -{ - public partial class User : BusinessBase - { - public string FullName - { - get { return LastName + ", " + FirstName; } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfo.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfo.cs deleted file mode 100644 index a3493665..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfo.cs +++ /dev/null @@ -1,225 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// UserInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class UserInfo : ReadOnlyBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base ToString - /// - /// A string representation of current UserInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - - // TODO: Check UserInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current UserInfo - 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 diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoList.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoList.cs deleted file mode 100644 index ab451dee..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoList.cs +++ /dev/null @@ -1,78 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// UserInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class UserInfoList : ReadOnlyListBase - { - #region Factory Methods - /// - /// Return a list of all projects. - /// - public static UserInfoList Get() - { - return DataPortal.Fetch(new Criteria()); - } - - - // TODO: Add alternative gets - - //public static UserInfoList Get() - //{ - // return DataPortal.Fetch(new FilteredCriteria()); - //} - - private UserInfoList() - { /* require use of factory methods */ } - - #endregion - #region Data Access Portal - [Serializable()] - private class Criteria - { /* no criteria - retrieve all rows */ } - - private void DataPortal_Fetch(Criteria criteria) - { - this.RaiseListChangedEvents = false; - try{ - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUsers"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read())this.Add(new UserInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch(Exception ex) - { - Database.LogException("UserInfoList",ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoListExt.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoListExt.cs deleted file mode 100644 index 9431a685..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserInfoListExt.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -namespace Volian.Object.Library -{ - /// - /// Extensions - /// - public partial class UserInfo : ReadOnlyBase - { - public string FullName - { - get { return LastName + ", " + FirstName; } - } - } -} diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserMembership.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserMembership.cs deleted file mode 100644 index 89cd4296..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserMembership.cs +++ /dev/null @@ -1,497 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// UserMembership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class UserMembership : BusinessBase - { - #region Business Methods - - - 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 - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current UserMembership - protected override object GetIdValue() - { - return _ugid; - } - // TODO: Replace base UserMembership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current UserMembership - //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, ""); - //AuthorizationRules.AllowRead(Gid, ""); - //AuthorizationRules.AllowWrite(Gid, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Dts, ""); - //AuthorizationRules.AllowWrite(Dts, ""); - //AuthorizationRules.AllowRead(Usrid, ""); - //AuthorizationRules.AllowWrite(Usrid, ""); - } - - 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) - { - 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, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - // } - //} - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/UserMemberships.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/UserMemberships.cs deleted file mode 100644 index edd9be8a..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/UserMemberships.cs +++ /dev/null @@ -1,145 +0,0 @@ - -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace Volian.Object.Library -{ - /// - /// UserMemberships Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class UserMemberships : BusinessListBase - { - #region Business Methods - - public new UserMembership this[int gid] - { - get - { - foreach (UserMembership membership in this) - if (membership.Gid == gid) - return membership; - return null; - } - } - public UserMembership GetItem(int gid) - { - foreach (UserMembership membership in this) - if (membership.Gid == gid) - return membership; - return null; - } - - public void Add(int gid) - { - if (!Contains(gid)) - { - UserMembership membership = - UserMembership.New(gid); - this.Add(membership); - } - else - throw new InvalidOperationException("membership already exists"); - } - - public void Remove(int gid) - { - foreach (UserMembership membership in this) - { - if (membership.Gid == gid) - { - Remove(membership); - break; - } - } - } - - public bool Contains(int gid) - { - foreach (UserMembership membership in this) - if (membership.Gid == gid) - return true; - return false; - } - - public bool ContainsDeleted(int gid) - { - foreach (UserMembership membership in DeletedList) - if (membership.Gid == gid) - return true; - return false; - } - - #endregion - #region Factory Methods - - internal static UserMemberships New() - { - return new UserMemberships(); - } - - internal static UserMemberships Get(SafeDataReader dr) - { - return new UserMemberships(dr); - } - - private UserMemberships() - { - MarkAsChild(); - } - - private UserMemberships(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - - #endregion - #region Data Access Portal - - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(UserMembership.Get(dr)); - this.RaiseListChangedEvents = true; - } - - internal void Update(User user,SqlConnection cn) - { - this.RaiseListChangedEvents = false; - // update (thus deleting) any deleted child objects - foreach (UserMembership obj in DeletedList) - obj.DeleteSelf(user,cn); - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - - // add/update any current child objects - foreach (UserMembership obj in this) - { - if (obj.IsNew) - obj.Insert(user,cn); - else - obj.Update(user,cn); - } - this.RaiseListChangedEvents = true; - } - - #endregion - - } // Class -} // Namespace diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/Volian.Object.Library.csproj b/PROMS/VEPROMS_Security/Volian.Object.Library/Volian.Object.Library.csproj deleted file mode 100644 index c6148946..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/Volian.Object.Library.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {592B86E9-D488-452B-B89B-2BB037793FE3} - Library - Properties - Volian.Object.Library - Volian.Object.Library - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\csla20cs\csla20cs\Csla\bin\Debug\Csla.dll - - - False - ..\..\..\Log4Net\log4net-1.2.10\bin\net\2.0\release\log4net.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/Volian.Object.Library/vlnValueKey.cs b/PROMS/VEPROMS_Security/Volian.Object.Library/vlnValueKey.cs deleted file mode 100644 index d576b1db..00000000 --- a/PROMS/VEPROMS_Security/Volian.Object.Library/vlnValueKey.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Volian.Object.Library -{ - public class vlnValueKey - { - public vlnValueKey() { ;} - public vlnValueKey(int key, string value) - { - _key = key; - _value = value; - } - private int _key; - public int Key - { - get { return _key; } - } - private string _value; - public string Value - { - get { return _value; } - } - public override string ToString() - { - return _value; - } - } -} diff --git a/PROMS/VEPROMS_Security/WinApp/App.config b/PROMS/VEPROMS_Security/WinApp/App.config deleted file mode 100644 index e7be1308..00000000 --- a/PROMS/VEPROMS_Security/WinApp/App.config +++ /dev/null @@ -1,138 +0,0 @@ - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - 1 - - - 2 - - - 192, 255, 255 - - - True - - - False - - - Normal - - - True - - - False - - - False - - - True - - - - - False - - - 1 - - - - diff --git a/PROMS/VEPROMS_Security/WinApp/App.config test b/PROMS/VEPROMS_Security/WinApp/App.config test deleted file mode 100644 index b8bd5b03..00000000 --- a/PROMS/VEPROMS_Security/WinApp/App.config test +++ /dev/null @@ -1,71 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/VEPROMS_Security/WinApp/FolderTreeNode.cs b/PROMS/VEPROMS_Security/WinApp/FolderTreeNode.cs deleted file mode 100644 index a319348f..00000000 --- a/PROMS/VEPROMS_Security/WinApp/FolderTreeNode.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using VEPROMS.CSLA.Library; -using Csla; -using System.Windows.Forms; - -namespace WinApp -{ - public class FolderTreeNode : TreeNode - { - FolderTreeNode(string s) : base(s) - { - this.Name="ID:" + s; - } - FolderTreeNode(FolderInfo folderinfo) - : base(folderinfo.Name) - { - _folderinfo = folderinfo; - this.Name = "ID:" + folderinfo.FolderID.ToString(); - } - private FolderInfo _folderinfo; - public FolderInfo FolderInfo - { - get { return _folderinfo; } - set - { - _folderinfo = value; - } - } - private Dictionary _findTree = null; - private Dictionary FindTree - { - get { return _findTree; } - set { _findTree = value; } - } - public FolderTreeNode FindTreeNode(int folderID) - { - if (_findTree != null) return _findTree[folderID]; - return null; - } - public static FolderTreeNode BuildTreeList() - { - FolderTreeNode root = null; - FolderInfoList fil = FolderInfoList.Get(); - Dictionary dicMissing = new Dictionary(); - Dictionary dicExists = new Dictionary(); - foreach (FolderInfo fi in fil) - { - FolderTreeNode ftp = null; - if (dicExists.ContainsKey(fi.ParentID)) - { - ftp = dicExists[fi.ParentID]; - } - else - { - if (fi.ParentID != 0) - { - ftp = new FolderTreeNode(fi.ParentID.ToString()); - dicMissing.Add(fi.ParentID, ftp); - dicExists.Add(fi.ParentID, ftp); - } - } - FolderTreeNode ft = null; - if (dicMissing.ContainsKey(fi.FolderID)) - { - ft = dicMissing[fi.FolderID]; - ft.FolderInfo = fi; - dicMissing.Remove(fi.FolderID); - } - else - { - ft = new FolderTreeNode(fi); - dicExists.Add(fi.FolderID, ft); - } - if (fi.ParentID == 0) - root = ft; - else - ftp.Nodes.Add(ft); - } - root.FindTree = dicExists; - return root; - } - } -} - diff --git a/PROMS/VEPROMS_Security/WinApp/Program.cs b/PROMS/VEPROMS_Security/WinApp/Program.cs deleted file mode 100644 index b3ceda78..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace WinApp -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new frmUser()); - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/AssemblyInfo.cs b/PROMS/VEPROMS_Security/WinApp/Properties/AssemblyInfo.cs deleted file mode 100644 index 808eaa0e..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WinApp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises, Inc.")] -[assembly: AssemblyProduct("WinApp")] -[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e47b4096-8f91-4c73-9f15-2130d983fd08")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Group.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Group.datasource deleted file mode 100644 index 513ba47e..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Group.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.Group, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupAssignments.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupAssignments.datasource deleted file mode 100644 index cbd248bf..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupAssignments.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.GroupAssignments, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupInfoList.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupInfoList.datasource deleted file mode 100644 index e285a500..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.GroupInfoList.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.GroupInfoList, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Membership.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Membership.datasource deleted file mode 100644 index 3e6d68f5..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Membership.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.Membership, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.MembershipInfoList.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.MembershipInfoList.datasource deleted file mode 100644 index 8e6f6193..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.MembershipInfoList.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.MembershipInfoList, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.PermLookup.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.PermLookup.datasource deleted file mode 100644 index ded496b4..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.PermLookup.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.PermLookup, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Role.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Role.datasource deleted file mode 100644 index 3bba001c..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.Role.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.Role, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.RoleInfoList.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.RoleInfoList.datasource deleted file mode 100644 index fc7c94e0..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.RoleInfoList.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.RoleInfoList, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.User.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.User.datasource deleted file mode 100644 index f58b89de..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.User.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.User, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.UserInfoList.datasource b/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.UserInfoList.datasource deleted file mode 100644 index 169007de..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/DataSources/Volian.Object.Library.UserInfoList.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - Volian.Object.Library.UserInfoList, Volian.Object.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/Resources.Designer.cs b/PROMS/VEPROMS_Security/WinApp/Properties/Resources.Designer.cs deleted file mode 100644 index eade7d04..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WinApp.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinApp.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/Resources.resx b/PROMS/VEPROMS_Security/WinApp/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/Settings.Designer.cs b/PROMS/VEPROMS_Security/WinApp/Properties/Settings.Designer.cs deleted file mode 100644 index 2096e4b7..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WinApp.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/PROMS/VEPROMS_Security/WinApp/Properties/Settings.settings b/PROMS/VEPROMS_Security/WinApp/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/PROMS/VEPROMS_Security/WinApp/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/PROMS/VEPROMS_Security/WinApp/WinApp.csproj b/PROMS/VEPROMS_Security/WinApp/WinApp.csproj deleted file mode 100644 index 9df6e979..00000000 --- a/PROMS/VEPROMS_Security/WinApp/WinApp.csproj +++ /dev/null @@ -1,164 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {9912ADA4-5934-4C1D-AF2E-CA8031EBA338} - WinExe - Properties - WinApp - WinApp - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\VEPROMS.CSLA.Library\bin\Debug\Csla.dll - - - False - ..\..\..\Log4Net\log4net-1.2.10\bin\net\2.0\release\log4net.dll - - - - - - - - - - - - Form - - - frmAssignmentSelect.cs - - - Form - - - frmGroups.cs - - - Form - - - frmGroupSelect.cs - - - Form - - - frmMembership.cs - - - Form - - - frmRoles.cs - - - Form - - - frmUser.cs - - - Form - - - frmUserSelect.cs - - - - - Designer - frmAssignmentSelect.cs - - - Designer - frmGroups.cs - - - Designer - frmGroupSelect.cs - - - Designer - frmMembership.cs - - - Designer - frmRoles.cs - - - Designer - frmUser.cs - - - Designer - frmUserSelect.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - - - - - - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5} - VEPROMS.CSLA.Library - - - - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.Designer.cs deleted file mode 100644 index 9cb52355..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.Designer.cs +++ /dev/null @@ -1,172 +0,0 @@ -namespace WinApp -{ - partial class frmAssignmentSelect - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.roleInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnRoles = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.tvFolder = new System.Windows.Forms.TreeView(); - this.panel2 = new System.Windows.Forms.Panel(); - this.cmbRoles = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.roleInfoListBindingSource)).BeginInit(); - this.panel1.SuspendLayout(); - this.panel2.SuspendLayout(); - this.SuspendLayout(); - // - // roleInfoListBindingSource - // - this.roleInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.RoleInfo); - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.Controls.Add(this.btnRoles); - this.panel1.Controls.Add(this.btnOK); - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 478); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(557, 29); - this.panel1.TabIndex = 2; - // - // btnRoles - // - this.btnRoles.Dock = System.Windows.Forms.DockStyle.Left; - this.btnRoles.Location = new System.Drawing.Point(0, 0); - this.btnRoles.Name = "btnRoles"; - this.btnRoles.Size = new System.Drawing.Size(75, 29); - this.btnRoles.TabIndex = 2; - this.btnRoles.Text = "Roles"; - this.btnRoles.UseVisualStyleBackColor = true; - this.btnRoles.Click += new System.EventHandler(this.btnRoles_Click); - // - // btnOK - // - this.btnOK.Dock = System.Windows.Forms.DockStyle.Right; - this.btnOK.Location = new System.Drawing.Point(407, 0); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(75, 29); - this.btnOK.TabIndex = 1; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Dock = System.Windows.Forms.DockStyle.Right; - this.btnCancel.Location = new System.Drawing.Point(482, 0); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 29); - this.btnCancel.TabIndex = 0; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // tvFolder - // - this.tvFolder.CheckBoxes = true; - this.tvFolder.Dock = System.Windows.Forms.DockStyle.Fill; - this.tvFolder.Location = new System.Drawing.Point(0, 25); - this.tvFolder.Name = "tvFolder"; - this.tvFolder.Size = new System.Drawing.Size(557, 453); - this.tvFolder.TabIndex = 3; - this.tvFolder.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvFolder_BeforeCheck); - // - // panel2 - // - this.panel2.Controls.Add(this.cmbRoles); - this.panel2.Controls.Add(this.label1); - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(557, 25); - this.panel2.TabIndex = 6; - // - // cmbRoles - // - this.cmbRoles.DataSource = this.roleInfoListBindingSource; - this.cmbRoles.DisplayMember = "Name"; - this.cmbRoles.Dock = System.Windows.Forms.DockStyle.Fill; - this.cmbRoles.FormattingEnabled = true; - this.cmbRoles.Location = new System.Drawing.Point(41, 0); - this.cmbRoles.Name = "cmbRoles"; - this.cmbRoles.Size = new System.Drawing.Size(516, 24); - this.cmbRoles.TabIndex = 6; - this.cmbRoles.ValueMember = "Rid"; - this.cmbRoles.SelectedValueChanged += new System.EventHandler(this.cmbRoles_SelectedValueChanged); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Left; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(41, 17); - this.label1.TabIndex = 0; - this.label1.Text = "Role:"; - // - // frmAssignmentSelect - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(557, 507); - this.Controls.Add(this.tvFolder); - this.Controls.Add(this.panel2); - this.Controls.Add(this.panel1); - this.Name = "frmAssignmentSelect"; - this.Text = "Assignment Selection"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BeforeFormClosing); - ((System.ComponentModel.ISupportInitialize)(this.roleInfoListBindingSource)).EndInit(); - this.panel1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.BindingSource roleInfoListBindingSource; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btnRoles; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.TreeView tvFolder; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.ComboBox cmbRoles; - private System.Windows.Forms.Label label1; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.cs b/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.cs deleted file mode 100644 index fee34d7b..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -namespace WinApp -{ - public partial class frmAssignmentSelect : Form - { - Group _grp; - FolderTreeNode _topnode; - public frmAssignmentSelect(Group grp) - { - InitializeComponent(); - _grp = grp; - this.Text = grp.GroupName + " Assignments"; - //_grp.BeginEdit();// Push - _topnode = FolderTreeNode.BuildTreeList(); - tvFolder.Nodes.Add(_topnode); - tvFolder.Nodes[0].Expand(); - roleInfoListBindingSource.DataSource = RoleInfoList.Get(); - //Initialize cmbRoles - if (grp.GroupAssignments.Count > 0) - { - int rid = grp.GroupAssignments[0].RID; - cmbRoles.SelectedValue = rid; - SetupFolders(rid); - } - } - private void BeforeFormClosing(object sender, FormClosingEventArgs e) - { - e.Cancel = (SaveAsNeeded() == DialogResult.Cancel); - } - private DialogResult SaveAsNeeded() - { - return DialogResult.Yes; - } - private void btnOK_Click(object sender, EventArgs e) - { - // This should save the changes to _grp.GroupAssignments - _grp.ApplyEdit(); //Apply - } - - private void btnCancel_Click(object sender, EventArgs e) - { - // This should throw away any changes to _grp.GroupAssignments - _grp.CancelEdit();// Pop - } - - private void btnRoles_Click(object sender, EventArgs e) - { - // TODO: Maybe should not be able to do this if unsaved data - frmRoles fr = new frmRoles(); - fr.ShowDialog(); - roleInfoListBindingSource.DataSource = RoleInfoList.Get(); - } - - private void tvFolder_BeforeCheck(object sender, TreeViewCancelEventArgs e) - { - if(!bSetup) - { - FolderTreeNode ftn = (FolderTreeNode)e.Node; - if (!ftn.Checked) - { - MessageBox.Show("Conversion Error"); - //_grp.GroupAssignments.Add(int.Parse(cmbRoles.SelectedValue.ToString()), ftn.FolderInfo.FolderID); - } - else - { - MessageBox.Show("Conversion Error"); - //TODO: KBR _grp.GroupAssignments.Remove(ftn.FolderInfo.FolderID, int.Parse(cmbRoles.SelectedValue.ToString())); - } - } - } - - private void cmbRoles_SelectedValueChanged(object sender, EventArgs e) - { - if (cmbRoles.SelectedIndex >= 0) - { - int rid = int.Parse(cmbRoles.SelectedValue.ToString()); - SetupFolders(rid); - } - } - private bool bSetup = false; - private void ResetTree(TreeNodeCollection tc) - { - foreach(TreeNode tn in tc) - { - tn.Checked=false; - if(tn.Nodes != null)ResetTree(tn.Nodes); - } - } - private void SetupFolders(int rid) - { - bSetup=true; - ResetTree(tvFolder.Nodes); - foreach(GroupAssignment ga in _grp.GroupAssignments) - { - if (ga.RID == rid) - _topnode.FindTreeNode(ga.FolderID).Checked = true; - } - bSetup=false; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.resx b/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.resx deleted file mode 100644 index 1845f7ca..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmAssignmentSelect.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.Designer.cs deleted file mode 100644 index 24fffca5..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -namespace WinApp -{ - partial class frmGroupSelect - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.lbGroups = new System.Windows.Forms.ListBox(); - this.groupInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.btnCancel = new System.Windows.Forms.Button(); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnOK = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).BeginInit(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // lbGroups - // - this.lbGroups.DataSource = this.groupInfoListBindingSource; - this.lbGroups.DisplayMember = "GroupName"; - this.lbGroups.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbGroups.FormattingEnabled = true; - this.lbGroups.ItemHeight = 16; - this.lbGroups.Location = new System.Drawing.Point(0, 0); - this.lbGroups.Name = "lbGroups"; - this.lbGroups.Size = new System.Drawing.Size(298, 292); - this.lbGroups.TabIndex = 3; - this.lbGroups.ValueMember = "Gid"; - // - // groupInfoListBindingSource - // - this.groupInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.GroupInfo); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Dock = System.Windows.Forms.DockStyle.Left; - this.btnCancel.Location = new System.Drawing.Point(79, 0); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(76, 35); - this.btnCancel.TabIndex = 1; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // panel1 - // - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.btnOK); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 293); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(298, 35); - this.panel1.TabIndex = 2; - // - // btnOK - // - this.btnOK.Dock = System.Windows.Forms.DockStyle.Left; - this.btnOK.Location = new System.Drawing.Point(0, 0); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(79, 35); - this.btnOK.TabIndex = 0; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // frmGroupSelect - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(298, 328); - this.Controls.Add(this.lbGroups); - this.Controls.Add(this.panel1); - this.Name = "frmGroupSelect"; - this.Text = "frmGroupSelect"; - this.Load += new System.EventHandler(this.frmGroupSelect_Load); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).EndInit(); - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ListBox lbGroups; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.BindingSource groupInfoListBindingSource; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.cs b/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.cs deleted file mode 100644 index 672c4a12..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using Csla; - -namespace WinApp -{ - public partial class frmGroupSelect : Form - { - public frmGroupSelect() - { - InitializeComponent(); - } - private void frmGroupSelect_Load(object sender, EventArgs e) - { - groupInfoListBindingSource.DataSource = GroupInfoList.Get(); - } - public int GID - { - get { return (int)lbGroups.SelectedValue; } - } - private void btnOK_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.OK; - } - - private void btnCancel_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.resx b/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.resx deleted file mode 100644 index 9c2cf16c..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroupSelect.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroups.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmGroups.Designer.cs deleted file mode 100644 index 9ab054de..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroups.Designer.cs +++ /dev/null @@ -1,523 +0,0 @@ -namespace WinApp -{ - partial class frmGroups - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.Label configLabel; - System.Windows.Forms.Label groupNameLabel; - System.Windows.Forms.Label groupTypeLabel; - this.btnNew = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.lbGroups = new System.Windows.Forms.ListBox(); - this.groupInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.groupMembershipsDataGridView = new System.Windows.Forms.DataGridView(); - this.Uid = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.User_FullName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.groupMembershipsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.groupBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnRemoveGA = new System.Windows.Forms.Button(); - this.btnNewGA = new System.Windows.Forms.Button(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.groupAssignmentsDataGridView = new System.Windows.Forms.DataGridView(); - this.Aid = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.folderNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.roleNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.startDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.endDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.groupAssignmentsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel2 = new System.Windows.Forms.Panel(); - this.btnRemoveAssign = new System.Windows.Forms.Button(); - this.btnNewAssign = new System.Windows.Forms.Button(); - this.configTextBox = new System.Windows.Forms.TextBox(); - this.gidTextBox = new System.Windows.Forms.TextBox(); - this.groupNameTextBox = new System.Windows.Forms.TextBox(); - this.groupTypeTextBox = new System.Windows.Forms.TextBox(); - this.userInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - configLabel = new System.Windows.Forms.Label(); - groupNameLabel = new System.Windows.Forms.Label(); - groupTypeLabel = new System.Windows.Forms.Label(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).BeginInit(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.groupMembershipsDataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupMembershipsBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupBindingSource)).BeginInit(); - this.panel1.SuspendLayout(); - this.tabPage2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.groupAssignmentsDataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupAssignmentsBindingSource)).BeginInit(); - this.panel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // configLabel - // - configLabel.AutoSize = true; - configLabel.Location = new System.Drawing.Point(14, 92); - configLabel.Name = "configLabel"; - configLabel.Size = new System.Drawing.Size(52, 17); - configLabel.TabIndex = 5; - configLabel.Text = "Config:"; - // - // groupNameLabel - // - groupNameLabel.AutoSize = true; - groupNameLabel.Location = new System.Drawing.Point(14, 36); - groupNameLabel.Name = "groupNameLabel"; - groupNameLabel.Size = new System.Drawing.Size(93, 17); - groupNameLabel.TabIndex = 11; - groupNameLabel.Text = "Group Name:"; - // - // groupTypeLabel - // - groupTypeLabel.AutoSize = true; - groupTypeLabel.Location = new System.Drawing.Point(14, 64); - groupTypeLabel.Name = "groupTypeLabel"; - groupTypeLabel.Size = new System.Drawing.Size(88, 17); - groupTypeLabel.TabIndex = 13; - groupTypeLabel.Text = "Group Type:"; - // - // btnNew - // - this.btnNew.Location = new System.Drawing.Point(505, 61); - this.btnNew.Name = "btnNew"; - this.btnNew.Size = new System.Drawing.Size(75, 23); - this.btnNew.TabIndex = 5; - this.btnNew.Text = "New"; - this.btnNew.UseVisualStyleBackColor = true; - this.btnNew.Click += new System.EventHandler(this.btnNew_Click); - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(505, 32); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 4; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(505, 3); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 3; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.lbGroups); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.AutoScroll = true; - this.splitContainer1.Panel2.Controls.Add(this.tabControl1); - this.splitContainer1.Panel2.Controls.Add(configLabel); - this.splitContainer1.Panel2.Controls.Add(this.configTextBox); - this.splitContainer1.Panel2.Controls.Add(this.gidTextBox); - this.splitContainer1.Panel2.Controls.Add(groupNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.groupNameTextBox); - this.splitContainer1.Panel2.Controls.Add(groupTypeLabel); - this.splitContainer1.Panel2.Controls.Add(this.groupTypeTextBox); - this.splitContainer1.Panel2.Controls.Add(this.btnNew); - this.splitContainer1.Panel2.Controls.Add(this.btnCancel); - this.splitContainer1.Panel2.Controls.Add(this.btnSave); - this.splitContainer1.Size = new System.Drawing.Size(892, 488); - this.splitContainer1.SplitterDistance = 296; - this.splitContainer1.TabIndex = 1; - // - // lbGroups - // - this.lbGroups.DataSource = this.groupInfoListBindingSource; - this.lbGroups.DisplayMember = "GroupName"; - this.lbGroups.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbGroups.FormattingEnabled = true; - this.lbGroups.ItemHeight = 16; - this.lbGroups.Location = new System.Drawing.Point(0, 0); - this.lbGroups.Name = "lbGroups"; - this.lbGroups.Size = new System.Drawing.Size(296, 484); - this.lbGroups.TabIndex = 0; - this.lbGroups.ValueMember = "Gid"; - this.lbGroups.SelectedValueChanged += new System.EventHandler(this.lbGroup_SelectedValueChanged); - // - // groupInfoListBindingSource - // - this.groupInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.GroupInfo); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Location = new System.Drawing.Point(23, 213); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(557, 260); - this.tabControl1.TabIndex = 15; - // - // tabPage1 - // - this.tabPage1.AutoScroll = true; - this.tabPage1.Controls.Add(this.groupMembershipsDataGridView); - this.tabPage1.Controls.Add(this.panel1); - this.tabPage1.Location = new System.Drawing.Point(4, 25); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(549, 231); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Members"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // groupMembershipsDataGridView - // - this.groupMembershipsDataGridView.AutoGenerateColumns = false; - this.groupMembershipsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Uid, - this.User_FullName, - this.dataGridViewTextBoxColumn4, - this.dataGridViewTextBoxColumn8}); - this.groupMembershipsDataGridView.DataSource = this.groupMembershipsBindingSource; - this.groupMembershipsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupMembershipsDataGridView.Location = new System.Drawing.Point(3, 35); - this.groupMembershipsDataGridView.Name = "groupMembershipsDataGridView"; - this.groupMembershipsDataGridView.RowTemplate.Height = 24; - this.groupMembershipsDataGridView.Size = new System.Drawing.Size(543, 193); - this.groupMembershipsDataGridView.TabIndex = 0; - // - // Uid - // - this.Uid.DataPropertyName = "Uid"; - this.Uid.HeaderText = "Uid"; - this.Uid.Name = "Uid"; - this.Uid.ReadOnly = true; - this.Uid.Visible = false; - // - // User_FullName - // - this.User_FullName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.User_FullName.DataPropertyName = "User_FullName"; - this.User_FullName.HeaderText = "User"; - this.User_FullName.Name = "User_FullName"; - this.User_FullName.ReadOnly = true; - // - // dataGridViewTextBoxColumn4 - // - this.dataGridViewTextBoxColumn4.DataPropertyName = "StartDate"; - this.dataGridViewTextBoxColumn4.HeaderText = "StartDate"; - this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; - // - // dataGridViewTextBoxColumn8 - // - this.dataGridViewTextBoxColumn8.DataPropertyName = "EndDate"; - this.dataGridViewTextBoxColumn8.HeaderText = "EndDate"; - this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; - // - // groupMembershipsBindingSource - // - this.groupMembershipsBindingSource.DataMember = "GroupMemberships"; - this.groupMembershipsBindingSource.DataSource = this.groupBindingSource; - this.groupMembershipsBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // groupBindingSource - // - this.groupBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.Group); - this.groupBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // panel1 - // - this.panel1.Controls.Add(this.btnRemoveGA); - this.panel1.Controls.Add(this.btnNewGA); - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(3, 3); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(543, 32); - this.panel1.TabIndex = 1; - // - // btnRemoveGA - // - this.btnRemoveGA.AutoSize = true; - this.btnRemoveGA.Dock = System.Windows.Forms.DockStyle.Left; - this.btnRemoveGA.Location = new System.Drawing.Point(72, 0); - this.btnRemoveGA.Name = "btnRemoveGA"; - this.btnRemoveGA.Size = new System.Drawing.Size(75, 32); - this.btnRemoveGA.TabIndex = 37; - this.btnRemoveGA.TabStop = false; - this.btnRemoveGA.Text = "Remove"; - this.btnRemoveGA.UseVisualStyleBackColor = true; - this.btnRemoveGA.Click += new System.EventHandler(this.btnRemoveGA_Click); - // - // btnNewGA - // - this.btnNewGA.AutoSize = true; - this.btnNewGA.Dock = System.Windows.Forms.DockStyle.Left; - this.btnNewGA.Location = new System.Drawing.Point(0, 0); - this.btnNewGA.Name = "btnNewGA"; - this.btnNewGA.Size = new System.Drawing.Size(72, 32); - this.btnNewGA.TabIndex = 36; - this.btnNewGA.TabStop = false; - this.btnNewGA.Text = "New"; - this.btnNewGA.UseVisualStyleBackColor = true; - this.btnNewGA.Click += new System.EventHandler(this.btnNewGA_Click); - // - // tabPage2 - // - this.tabPage2.AutoScroll = true; - this.tabPage2.Controls.Add(this.groupAssignmentsDataGridView); - this.tabPage2.Controls.Add(this.panel2); - this.tabPage2.Location = new System.Drawing.Point(4, 25); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(549, 231); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Assignments"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // groupAssignmentsDataGridView - // - this.groupAssignmentsDataGridView.AutoGenerateColumns = false; - this.groupAssignmentsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Aid, - this.folderNameDataGridViewTextBoxColumn, - this.roleNameDataGridViewTextBoxColumn, - this.startDateDataGridViewTextBoxColumn, - this.endDateDataGridViewTextBoxColumn}); - this.groupAssignmentsDataGridView.DataSource = this.groupAssignmentsBindingSource; - this.groupAssignmentsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupAssignmentsDataGridView.Location = new System.Drawing.Point(3, 35); - this.groupAssignmentsDataGridView.Name = "groupAssignmentsDataGridView"; - this.groupAssignmentsDataGridView.RowTemplate.Height = 24; - this.groupAssignmentsDataGridView.Size = new System.Drawing.Size(543, 193); - this.groupAssignmentsDataGridView.TabIndex = 0; - // - // Aid - // - this.Aid.DataPropertyName = "Aid"; - this.Aid.HeaderText = "Aid"; - this.Aid.Name = "Aid"; - this.Aid.ReadOnly = true; - this.Aid.Visible = false; - // - // folderNameDataGridViewTextBoxColumn - // - this.folderNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.folderNameDataGridViewTextBoxColumn.DataPropertyName = "Folder_Name"; - this.folderNameDataGridViewTextBoxColumn.HeaderText = "Folder"; - this.folderNameDataGridViewTextBoxColumn.Name = "folderNameDataGridViewTextBoxColumn"; - this.folderNameDataGridViewTextBoxColumn.ReadOnly = true; - // - // roleNameDataGridViewTextBoxColumn - // - this.roleNameDataGridViewTextBoxColumn.DataPropertyName = "Role_Name"; - this.roleNameDataGridViewTextBoxColumn.HeaderText = "Role"; - this.roleNameDataGridViewTextBoxColumn.Name = "roleNameDataGridViewTextBoxColumn"; - this.roleNameDataGridViewTextBoxColumn.ReadOnly = true; - // - // startDateDataGridViewTextBoxColumn - // - this.startDateDataGridViewTextBoxColumn.DataPropertyName = "StartDate"; - this.startDateDataGridViewTextBoxColumn.HeaderText = "Start"; - this.startDateDataGridViewTextBoxColumn.Name = "startDateDataGridViewTextBoxColumn"; - // - // endDateDataGridViewTextBoxColumn - // - this.endDateDataGridViewTextBoxColumn.DataPropertyName = "EndDate"; - this.endDateDataGridViewTextBoxColumn.HeaderText = "End"; - this.endDateDataGridViewTextBoxColumn.Name = "endDateDataGridViewTextBoxColumn"; - // - // groupAssignmentsBindingSource - // - this.groupAssignmentsBindingSource.DataMember = "GroupAssignments"; - this.groupAssignmentsBindingSource.DataSource = this.groupBindingSource; - // - // panel2 - // - this.panel2.Controls.Add(this.btnRemoveAssign); - this.panel2.Controls.Add(this.btnNewAssign); - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(3, 3); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(543, 32); - this.panel2.TabIndex = 2; - // - // btnRemoveAssign - // - this.btnRemoveAssign.AutoSize = true; - this.btnRemoveAssign.Dock = System.Windows.Forms.DockStyle.Left; - this.btnRemoveAssign.Location = new System.Drawing.Point(72, 0); - this.btnRemoveAssign.Name = "btnRemoveAssign"; - this.btnRemoveAssign.Size = new System.Drawing.Size(83, 32); - this.btnRemoveAssign.TabIndex = 37; - this.btnRemoveAssign.TabStop = false; - this.btnRemoveAssign.Text = "Remove"; - this.btnRemoveAssign.UseVisualStyleBackColor = true; - this.btnRemoveAssign.Click += new System.EventHandler(this.btnRemoveAssign_Click); - // - // btnNewAssign - // - this.btnNewAssign.AutoSize = true; - this.btnNewAssign.Dock = System.Windows.Forms.DockStyle.Left; - this.btnNewAssign.Location = new System.Drawing.Point(0, 0); - this.btnNewAssign.Name = "btnNewAssign"; - this.btnNewAssign.Size = new System.Drawing.Size(72, 32); - this.btnNewAssign.TabIndex = 36; - this.btnNewAssign.TabStop = false; - this.btnNewAssign.Text = "New"; - this.btnNewAssign.UseVisualStyleBackColor = true; - this.btnNewAssign.Click += new System.EventHandler(this.btnNewAssign_Click); - // - // configTextBox - // - this.configTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.groupBindingSource, "Config", true)); - this.configTextBox.Location = new System.Drawing.Point(113, 89); - this.configTextBox.Multiline = true; - this.configTextBox.Name = "configTextBox"; - this.configTextBox.Size = new System.Drawing.Size(381, 108); - this.configTextBox.TabIndex = 6; - // - // gidTextBox - // - this.gidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.groupBindingSource, "Gid", true)); - this.gidTextBox.Enabled = false; - this.gidTextBox.Location = new System.Drawing.Point(2, 0); - this.gidTextBox.Name = "gidTextBox"; - this.gidTextBox.Size = new System.Drawing.Size(34, 22); - this.gidTextBox.TabIndex = 10; - // - // groupNameTextBox - // - this.groupNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.groupBindingSource, "GroupName", true)); - this.groupNameTextBox.Location = new System.Drawing.Point(113, 33); - this.groupNameTextBox.Name = "groupNameTextBox"; - this.groupNameTextBox.Size = new System.Drawing.Size(381, 22); - this.groupNameTextBox.TabIndex = 12; - // - // groupTypeTextBox - // - this.groupTypeTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.groupBindingSource, "GroupType", true)); - this.groupTypeTextBox.Location = new System.Drawing.Point(113, 61); - this.groupTypeTextBox.Name = "groupTypeTextBox"; - this.groupTypeTextBox.Size = new System.Drawing.Size(381, 22); - this.groupTypeTextBox.TabIndex = 14; - // - // userInfoListBindingSource - // - this.userInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.UserInfo); - // - // frmGroups - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(892, 488); - this.Controls.Add(this.splitContainer1); - this.Name = "frmGroups"; - this.Text = "frmGroups"; - this.Load += new System.EventHandler(this.frmGroup_Load); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BeforeFormClosing); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).EndInit(); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.groupMembershipsDataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupMembershipsBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupBindingSource)).EndInit(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - this.tabPage2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.groupAssignmentsDataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupAssignmentsBindingSource)).EndInit(); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button btnNew; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListBox lbGroups; - private System.Windows.Forms.TextBox configTextBox; - private System.Windows.Forms.BindingSource groupBindingSource; - private System.Windows.Forms.TextBox gidTextBox; - private System.Windows.Forms.TextBox groupNameTextBox; - private System.Windows.Forms.TextBox groupTypeTextBox; - private System.Windows.Forms.BindingSource groupInfoListBindingSource; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.BindingSource groupMembershipsBindingSource; - private System.Windows.Forms.DataGridView groupMembershipsDataGridView; - private System.Windows.Forms.BindingSource userInfoListBindingSource; - private System.Windows.Forms.DataGridView groupAssignmentsDataGridView; -// private System.Windows.Forms.BindingSource groupPermissionsBindingSource; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btnRemoveGA; - private System.Windows.Forms.Button btnNewGA; - private System.Windows.Forms.DataGridViewTextBoxColumn Uid; - private System.Windows.Forms.DataGridViewTextBoxColumn User_FullName; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; - private System.Windows.Forms.BindingSource groupAssignmentsBindingSource; - // private System.Windows.Forms.DataGridViewTextBoxColumn roleGidDataGridViewTextBoxColumn; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button btnRemoveAssign; - private System.Windows.Forms.Button btnNewAssign; - private System.Windows.Forms.DataGridViewTextBoxColumn Aid; - private System.Windows.Forms.DataGridViewTextBoxColumn ridDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn folderidDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn folderNameDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn roleNameDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn startDateDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn endDateDataGridViewTextBoxColumn; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroups.cs b/PROMS/VEPROMS_Security/WinApp/frmGroups.cs deleted file mode 100644 index 594845f8..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroups.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -namespace WinApp -{ - public partial class frmGroups : Form - { - public frmGroups(int gid) - { - InitializeComponent(); - _gid = gid; - } - private int _gid; - private Group _group; - private void frmGroup_Load(object sender, EventArgs e) - { - groupInfoListBindingSource.DataSource = GroupInfoList.Get(); - userInfoListBindingSource.DataSource = UserInfoList.Get(); - lbGroups.SelectedValue = _gid; - SetupDetail(); - SetupButtons(); - } - private void BeforeFormClosing(object sender, FormClosingEventArgs e) - { - e.Cancel = (SaveAsNeeded() == DialogResult.Cancel); - } - private DialogResult SaveAsNeeded() - { - if (_group != null && _group.IsSavable) - { - DialogResult dr = MessageBox.Show("Do you want to save changes", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) Save(); - if (dr == DialogResult.No) Cancel(); - // TODO: Need a Cancel - return dr; - } - return DialogResult.Yes; - } - private void SetupDetail() - { - if (lbGroups.SelectedValue != null) - { - int gid = (int)lbGroups.SelectedValue; - if (_group == null || _group.GID != gid) - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _group = Group.Get(gid); - groupBindingSource.DataSource = _group; - groupMembershipsBindingSource.DataSource = _group.GroupMemberships; - groupAssignmentsBindingSource.DataSource = _group.GroupAssignments; - } - } - } - } - private void lbGroup_SelectedValueChanged(object sender, EventArgs e) - { - SetupDetail(); - } - private void SetupButtons() - { - if (_group != null) - { - btnSave.Enabled = _group.IsSavable; - btnCancel.Enabled = _group.IsDirty; - btnNew.Enabled = _group.IsValid; - } - else - { - btnSave.Enabled = false; - btnCancel.Enabled = false; - btnNew.Enabled = true; - } - } - private void CurrentItemChanged(object sender, EventArgs e) - { - SetupButtons(); - } - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - private void btnSave_Click(object sender, EventArgs e) - { - Save(); - } - private void btnNew_Click(object sender, EventArgs e) - { - New(); - } - private void Cancel() - { - _group.CancelEdit(); - _group.BeginEdit(); - } - private void Save() - { - groupBindingSource.RaiseListChangedEvents = false; - groupMembershipsBindingSource.RaiseListChangedEvents = false; - groupBindingSource.EndEdit(); - groupMembershipsBindingSource.EndEdit(); - - try - { - Group temp = _group.Clone(); - _group = temp.Save(); - _group.BeginEdit(); - groupBindingSource.DataSource = null; - groupMembershipsBindingSource.DataSource = null; - int gid = _group.GID; - groupInfoListBindingSource.DataSource = GroupInfoList.Get(); - lbGroups.SelectedValue = gid; - groupBindingSource.DataSource = _group; - groupMembershipsBindingSource.DataSource = _group.GroupMemberships; - } - catch (Csla.DataPortalException ex) - { - MessageBox.Show(ex.BusinessException.ToString(), - "Error saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error saving", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - finally - { - groupBindingSource.RaiseListChangedEvents = true; - groupMembershipsBindingSource.RaiseListChangedEvents = true; - groupBindingSource.ResetBindings(false); - groupMembershipsBindingSource.ResetBindings(false); - } - SetupButtons(); - } - public void New() - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _group = Group.New(); - groupBindingSource.DataSource = _group; - groupMembershipsBindingSource.DataSource = _group.GroupMemberships; - } - } - private void btnNewGA_Click(object sender, EventArgs e) - { - using (frmUserSelect f = new frmUserSelect()) - { - f.ShowDialog(); - if (f.DialogResult == DialogResult.OK) - { - _group.GroupMemberships.Add(User.Get(f.UID)); // KBR using? - SetupButtons(); - } - } - } - private void btnRemoveGA_Click(object sender, EventArgs e) - { - if (this.groupMembershipsDataGridView.SelectedRows.Count > 0) - { - int uid = int.Parse( - this.groupMembershipsDataGridView.SelectedRows[0].Cells[0].Value.ToString()); - MessageBox.Show("Conversion error"); - //TODO KBR: _group.GroupMemberships.Remove(uid); - } - } - - private void btnRemoveAssign_Click(object sender, EventArgs e) - { - if (this.groupAssignmentsDataGridView.SelectedRows.Count > 0) - { - int rid = int.Parse( - this.groupAssignmentsDataGridView.SelectedRows[0].Cells[1].Value.ToString()); - int folderid = int.Parse( - this.groupAssignmentsDataGridView.SelectedRows[0].Cells[2].Value.ToString()); - MessageBox.Show("Conversion error"); - //TODO KBR: _group.GroupAssignments.Remove(folderid, rid); - } - - } - - private void btnNewAssign_Click(object sender, EventArgs e) - { - using (frmAssignmentSelect f = new frmAssignmentSelect(_group)) - { - f.ShowDialog(); - if (f.DialogResult == DialogResult.OK) - { - //TODO: Do I need to refresh Assignments? - } - } - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmGroups.resx b/PROMS/VEPROMS_Security/WinApp/frmGroups.resx deleted file mode 100644 index 3be1ae67..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmGroups.resx +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - False - - - False - - - 17, 17 - - - True - - - True - - - 424, 17 - - - 244, 17 - - - True - - - 17, 57 - - - 687, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmMembership.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmMembership.Designer.cs deleted file mode 100644 index eca90746..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmMembership.Designer.cs +++ /dev/null @@ -1,317 +0,0 @@ -namespace WinApp -{ - partial class frmMembership - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.Label dtsLabel; - System.Windows.Forms.Label endDateLabel; - System.Windows.Forms.Label gidLabel; - System.Windows.Forms.Label startDateLabel; - System.Windows.Forms.Label ugidLabel; - System.Windows.Forms.Label uidLabel; - System.Windows.Forms.Label usridLabel; - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.lbMembers = new System.Windows.Forms.ListBox(); - this.membershipInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.membershipBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.dtsTextBox = new System.Windows.Forms.TextBox(); - this.endDateTextBox = new System.Windows.Forms.TextBox(); - this.gidTextBox = new System.Windows.Forms.TextBox(); - this.startDateTextBox = new System.Windows.Forms.TextBox(); - this.ugidTextBox = new System.Windows.Forms.TextBox(); - this.uidTextBox = new System.Windows.Forms.TextBox(); - this.usridTextBox = new System.Windows.Forms.TextBox(); - this.btnNew = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components); - dtsLabel = new System.Windows.Forms.Label(); - endDateLabel = new System.Windows.Forms.Label(); - gidLabel = new System.Windows.Forms.Label(); - startDateLabel = new System.Windows.Forms.Label(); - ugidLabel = new System.Windows.Forms.Label(); - uidLabel = new System.Windows.Forms.Label(); - usridLabel = new System.Windows.Forms.Label(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.membershipInfoListBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.membershipBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); - this.SuspendLayout(); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.lbMembers); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.btnNew); - this.splitContainer1.Panel2.Controls.Add(this.btnCancel); - this.splitContainer1.Panel2.Controls.Add(this.btnSave); - this.splitContainer1.Panel2.Controls.Add(dtsLabel); - this.splitContainer1.Panel2.Controls.Add(this.dtsTextBox); - this.splitContainer1.Panel2.Controls.Add(endDateLabel); - this.splitContainer1.Panel2.Controls.Add(this.endDateTextBox); - this.splitContainer1.Panel2.Controls.Add(gidLabel); - this.splitContainer1.Panel2.Controls.Add(this.gidTextBox); - this.splitContainer1.Panel2.Controls.Add(startDateLabel); - this.splitContainer1.Panel2.Controls.Add(this.startDateTextBox); - this.splitContainer1.Panel2.Controls.Add(ugidLabel); - this.splitContainer1.Panel2.Controls.Add(this.ugidTextBox); - this.splitContainer1.Panel2.Controls.Add(uidLabel); - this.splitContainer1.Panel2.Controls.Add(this.uidTextBox); - this.splitContainer1.Panel2.Controls.Add(usridLabel); - this.splitContainer1.Panel2.Controls.Add(this.usridTextBox); - this.splitContainer1.Size = new System.Drawing.Size(685, 409); - this.splitContainer1.SplitterDistance = 228; - this.splitContainer1.TabIndex = 0; - // - // lbMembers - // - this.lbMembers.DataSource = this.membershipInfoListBindingSource; - this.lbMembers.DisplayMember = "Ugid"; - this.lbMembers.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbMembers.FormattingEnabled = true; - this.lbMembers.ItemHeight = 16; - this.lbMembers.Location = new System.Drawing.Point(0, 0); - this.lbMembers.Name = "lbMembers"; - this.lbMembers.Size = new System.Drawing.Size(228, 404); - this.lbMembers.TabIndex = 0; - this.lbMembers.ValueMember = "Ugid"; - this.lbMembers.SelectedValueChanged += new System.EventHandler(this.lbMembers_SelectedValueChanged); - // - // membershipInfoListBindingSource - // - this.membershipInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.MembershipInfo); - // - // membershipBindingSource - // - this.membershipBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.Membership); - this.membershipBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // dtsLabel - // - dtsLabel.AutoSize = true; - dtsLabel.Location = new System.Drawing.Point(20, 15); - dtsLabel.Name = "dtsLabel"; - dtsLabel.Size = new System.Drawing.Size(33, 17); - dtsLabel.TabIndex = 0; - dtsLabel.Text = "Dts:"; - // - // dtsTextBox - // - this.dtsTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "Dts", true)); - this.dtsTextBox.Location = new System.Drawing.Point(102, 12); - this.dtsTextBox.Name = "dtsTextBox"; - this.dtsTextBox.Size = new System.Drawing.Size(100, 22); - this.dtsTextBox.TabIndex = 1; - // - // endDateLabel - // - endDateLabel.AutoSize = true; - endDateLabel.Location = new System.Drawing.Point(20, 43); - endDateLabel.Name = "endDateLabel"; - endDateLabel.Size = new System.Drawing.Size(71, 17); - endDateLabel.TabIndex = 2; - endDateLabel.Text = "End Date:"; - // - // endDateTextBox - // - this.endDateTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "EndDate", true)); - this.endDateTextBox.Location = new System.Drawing.Point(102, 40); - this.endDateTextBox.Name = "endDateTextBox"; - this.endDateTextBox.Size = new System.Drawing.Size(100, 22); - this.endDateTextBox.TabIndex = 3; - // - // gidLabel - // - gidLabel.AutoSize = true; - gidLabel.Location = new System.Drawing.Point(20, 71); - gidLabel.Name = "gidLabel"; - gidLabel.Size = new System.Drawing.Size(34, 17); - gidLabel.TabIndex = 4; - gidLabel.Text = "Gid:"; - // - // gidTextBox - // - this.gidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "Gid", true)); - this.gidTextBox.Location = new System.Drawing.Point(102, 68); - this.gidTextBox.Name = "gidTextBox"; - this.gidTextBox.Size = new System.Drawing.Size(100, 22); - this.gidTextBox.TabIndex = 5; - // - // startDateLabel - // - startDateLabel.AutoSize = true; - startDateLabel.Location = new System.Drawing.Point(20, 99); - startDateLabel.Name = "startDateLabel"; - startDateLabel.Size = new System.Drawing.Size(76, 17); - startDateLabel.TabIndex = 6; - startDateLabel.Text = "Start Date:"; - // - // startDateTextBox - // - this.startDateTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "StartDate", true)); - this.startDateTextBox.Location = new System.Drawing.Point(102, 96); - this.startDateTextBox.Name = "startDateTextBox"; - this.startDateTextBox.Size = new System.Drawing.Size(100, 22); - this.startDateTextBox.TabIndex = 7; - // - // ugidLabel - // - ugidLabel.AutoSize = true; - ugidLabel.Location = new System.Drawing.Point(20, 127); - ugidLabel.Name = "ugidLabel"; - ugidLabel.Size = new System.Drawing.Size(41, 17); - ugidLabel.TabIndex = 8; - ugidLabel.Text = "Ugid:"; - // - // ugidTextBox - // - this.ugidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "Ugid", true)); - this.ugidTextBox.Location = new System.Drawing.Point(102, 124); - this.ugidTextBox.Name = "ugidTextBox"; - this.ugidTextBox.Size = new System.Drawing.Size(100, 22); - this.ugidTextBox.TabIndex = 9; - // - // uidLabel - // - uidLabel.AutoSize = true; - uidLabel.Location = new System.Drawing.Point(20, 155); - uidLabel.Name = "uidLabel"; - uidLabel.Size = new System.Drawing.Size(33, 17); - uidLabel.TabIndex = 10; - uidLabel.Text = "Uid:"; - // - // uidTextBox - // - this.uidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "Uid", true)); - this.uidTextBox.Location = new System.Drawing.Point(102, 152); - this.uidTextBox.Name = "uidTextBox"; - this.uidTextBox.Size = new System.Drawing.Size(100, 22); - this.uidTextBox.TabIndex = 11; - // - // usridLabel - // - usridLabel.AutoSize = true; - usridLabel.Location = new System.Drawing.Point(20, 183); - usridLabel.Name = "usridLabel"; - usridLabel.Size = new System.Drawing.Size(45, 17); - usridLabel.TabIndex = 12; - usridLabel.Text = "Usrid:"; - // - // usridTextBox - // - this.usridTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.membershipBindingSource, "Usrid", true)); - this.usridTextBox.Location = new System.Drawing.Point(102, 180); - this.usridTextBox.Name = "usridTextBox"; - this.usridTextBox.Size = new System.Drawing.Size(100, 22); - this.usridTextBox.TabIndex = 13; - // - // btnNew - // - this.btnNew.Location = new System.Drawing.Point(366, 67); - this.btnNew.Name = "btnNew"; - this.btnNew.Size = new System.Drawing.Size(75, 23); - this.btnNew.TabIndex = 33; - this.btnNew.Text = "New"; - this.btnNew.UseVisualStyleBackColor = true; - this.btnNew.Click += new System.EventHandler(this.btnNew_Click); - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(366, 38); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 32; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(366, 9); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 31; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // errorProvider1 - // - this.errorProvider1.ContainerControl = this; - this.errorProvider1.DataSource = this.membershipBindingSource; - // - // frmMembership - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(685, 409); - this.Controls.Add(this.splitContainer1); - this.Name = "frmMembership"; - this.Text = "frmMembership"; - this.Load += new System.EventHandler(this.frmMembership_Load); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.membershipInfoListBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.membershipBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListBox lbMembers; - private System.Windows.Forms.BindingSource membershipInfoListBindingSource; - private System.Windows.Forms.TextBox dtsTextBox; - private System.Windows.Forms.BindingSource membershipBindingSource; - private System.Windows.Forms.TextBox endDateTextBox; - private System.Windows.Forms.TextBox gidTextBox; - private System.Windows.Forms.TextBox startDateTextBox; - private System.Windows.Forms.TextBox ugidTextBox; - private System.Windows.Forms.TextBox uidTextBox; - private System.Windows.Forms.TextBox usridTextBox; - private System.Windows.Forms.Button btnNew; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.ErrorProvider errorProvider1; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmMembership.cs b/PROMS/VEPROMS_Security/WinApp/frmMembership.cs deleted file mode 100644 index 71ff80cd..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmMembership.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -namespace WinApp -{ - public partial class frmMembership : Form - { - public frmMembership() - { - InitializeComponent(); - } - Membership _mem; - private void frmMembership_Load(object sender, EventArgs e) - { - membershipInfoListBindingSource.DataSource = MembershipInfoList.Get(); - SetupDetail(); - SetupButtons(); - } - private DialogResult SaveAsNeeded() - { - if (_mem != null && _mem.IsSavable) - { - DialogResult dr = MessageBox.Show("Do you want to save changes", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) Save(); - if (dr == DialogResult.No) Cancel(); - // TODO: Need a Cancel - return dr; - } - return DialogResult.Yes; - } - private void SetupDetail() - { - if (lbMembers.SelectedIndex != -1) - { - int ugid = (int)lbMembers.SelectedValue; - if (_mem == null || _mem.UGID != ugid) - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _mem = Membership.Get(ugid); - membershipBindingSource.DataSource = _mem; - } - } - } - } - private void lbMembers_SelectedValueChanged(object sender, EventArgs e) - { - SetupDetail(); - } - private void SetupButtons() - { - if (_mem != null) - { - btnSave.Enabled = _mem.IsSavable; - btnCancel.Enabled = _mem.IsDirty; - btnNew.Enabled = _mem.IsValid; - } - else - { - btnSave.Enabled = false; - btnCancel.Enabled = false; - btnNew.Enabled = true; - } - } - private void CurrentItemChanged(object sender, EventArgs e) - { - SetupButtons(); - } - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - private void btnSave_Click(object sender, EventArgs e) - { - Save(); - } - private void btnNew_Click(object sender, EventArgs e) - { - New(); - } - private void Cancel() - { - _mem.CancelEdit(); - _mem.BeginEdit(); - } - private void Save() - { - membershipBindingSource.RaiseListChangedEvents = false; - membershipBindingSource.EndEdit(); - - try - { - Membership temp = _mem.Clone(); - _mem = temp.Save(); - _mem.BeginEdit(); - membershipBindingSource.DataSource = null; - int ugid = _mem.UID; - if (lbMembers.SelectedIndex == -1) - lbMembers.SelectedValue = ugid; - membershipBindingSource.DataSource = _mem; - } - catch (Csla.DataPortalException ex) - { - MessageBox.Show(ex.BusinessException.ToString(), - "Error saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error saving", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - finally - { - membershipBindingSource.RaiseListChangedEvents = true; - membershipBindingSource.ResetBindings(false); - } - SetupButtons(); - } - public void New() - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _mem = Membership.New(); - membershipBindingSource.DataSource = _mem; - lbMembers.SelectedIndex = -1; - } - } - - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmMembership.resx b/PROMS/VEPROMS_Security/WinApp/frmMembership.resx deleted file mode 100644 index 29a88681..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmMembership.resx +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - False - - - 285, 17 - - - False - - - False - - - False - - - False - - - False - - - False - - - 17, 17 - - - 285, 17 - - - 506, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmRoles.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmRoles.Designer.cs deleted file mode 100644 index be1d6284..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmRoles.Designer.cs +++ /dev/null @@ -1,555 +0,0 @@ -namespace WinApp -{ - partial class frmRoles - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.Label nameLabel; - System.Windows.Forms.Label titleLabel; - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.lbRoles = new System.Windows.Forms.ListBox(); - this.roleInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.roleAssignmentsDataGridView = new System.Windows.Forms.DataGridView(); - this.StartDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.EndDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.roleAssignmentsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel3 = new System.Windows.Forms.Panel(); - this.btnRemoveAssign = new System.Windows.Forms.Button(); - this.btnNewAssign = new System.Windows.Forms.Button(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.rolePermissionsDataGridView = new System.Windows.Forms.DataGridView(); - this.Pid = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.permADLookupBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn19 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dataGridViewCheckBoxColumn4 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dataGridViewCheckBoxColumn3 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.rolePermissionsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.roleBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel2 = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); - this.btnNewPermission = new System.Windows.Forms.Button(); - this.panel1 = new System.Windows.Forms.Panel(); - this.nameTextBox = new System.Windows.Forms.TextBox(); - this.ridTextBox = new System.Windows.Forms.TextBox(); - this.titleTextBox = new System.Windows.Forms.TextBox(); - this.btnNew = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components); - nameLabel = new System.Windows.Forms.Label(); - titleLabel = new System.Windows.Forms.Label(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.roleInfoListBindingSource)).BeginInit(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.roleAssignmentsDataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.roleAssignmentsBindingSource)).BeginInit(); - this.panel3.SuspendLayout(); - this.tabPage2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.rolePermissionsDataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.permADLookupBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.rolePermissionsBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.roleBindingSource)).BeginInit(); - this.panel2.SuspendLayout(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); - this.SuspendLayout(); - // - // nameLabel - // - nameLabel.AutoSize = true; - nameLabel.Location = new System.Drawing.Point(69, 11); - nameLabel.Name = "nameLabel"; - nameLabel.Size = new System.Drawing.Size(49, 17); - nameLabel.TabIndex = 21; - nameLabel.Text = "Name:"; - // - // titleLabel - // - titleLabel.AutoSize = true; - titleLabel.Location = new System.Drawing.Point(6, 38); - titleLabel.Name = "titleLabel"; - titleLabel.Size = new System.Drawing.Size(39, 17); - titleLabel.TabIndex = 24; - titleLabel.Text = "Title:"; - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.lbRoles); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.AutoScroll = true; - this.splitContainer1.Panel2.Controls.Add(this.tabControl1); - this.splitContainer1.Panel2.Controls.Add(this.panel1); - this.splitContainer1.Size = new System.Drawing.Size(863, 550); - this.splitContainer1.SplitterDistance = 225; - this.splitContainer1.TabIndex = 0; - // - // lbRoles - // - this.lbRoles.DataSource = this.roleInfoListBindingSource; - this.lbRoles.DisplayMember = "Name"; - this.lbRoles.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbRoles.FormattingEnabled = true; - this.lbRoles.ItemHeight = 16; - this.lbRoles.Location = new System.Drawing.Point(0, 0); - this.lbRoles.Name = "lbRoles"; - this.lbRoles.Size = new System.Drawing.Size(225, 548); - this.lbRoles.TabIndex = 0; - this.lbRoles.ValueMember = "Rid"; - this.lbRoles.SelectedValueChanged += new System.EventHandler(this.lbRole_SelectedValueChanged); - // - // roleInfoListBindingSource - // - this.roleInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.RoleInfo); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 102); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(634, 448); - this.tabControl1.TabIndex = 18; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.roleAssignmentsDataGridView); - this.tabPage1.Controls.Add(this.panel3); - this.tabPage1.Location = new System.Drawing.Point(4, 25); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(626, 419); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Assignments"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // roleAssignmentsDataGridView - // - this.roleAssignmentsDataGridView.AutoGenerateColumns = false; - this.roleAssignmentsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.StartDate, - this.EndDate}); - this.roleAssignmentsDataGridView.DataSource = this.roleAssignmentsBindingSource; - this.roleAssignmentsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.roleAssignmentsDataGridView.Location = new System.Drawing.Point(3, 35); - this.roleAssignmentsDataGridView.Name = "roleAssignmentsDataGridView"; - this.roleAssignmentsDataGridView.RowTemplate.Height = 24; - this.roleAssignmentsDataGridView.Size = new System.Drawing.Size(620, 381); - this.roleAssignmentsDataGridView.TabIndex = 18; - // - // StartDate - // - this.StartDate.DataPropertyName = "StartDate"; - this.StartDate.HeaderText = "StartDate"; - this.StartDate.Name = "StartDate"; - // - // EndDate - // - this.EndDate.DataPropertyName = "EndDate"; - this.EndDate.HeaderText = "EndDate"; - this.EndDate.Name = "EndDate"; - // - // roleAssignmentsBindingSource - // - this.roleAssignmentsBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // panel3 - // - this.panel3.AutoScroll = true; - this.panel3.Controls.Add(this.btnRemoveAssign); - this.panel3.Controls.Add(this.btnNewAssign); - this.panel3.Dock = System.Windows.Forms.DockStyle.Top; - this.panel3.Location = new System.Drawing.Point(3, 3); - this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(620, 32); - this.panel3.TabIndex = 19; - // - // btnRemoveAssign - // - this.btnRemoveAssign.AutoSize = true; - this.btnRemoveAssign.Dock = System.Windows.Forms.DockStyle.Left; - this.btnRemoveAssign.Location = new System.Drawing.Point(75, 0); - this.btnRemoveAssign.Name = "btnRemoveAssign"; - this.btnRemoveAssign.Size = new System.Drawing.Size(75, 32); - this.btnRemoveAssign.TabIndex = 20; - this.btnRemoveAssign.Text = "Remove"; - this.btnRemoveAssign.UseVisualStyleBackColor = true; - // - // btnNewAssign - // - this.btnNewAssign.AutoSize = true; - this.btnNewAssign.Dock = System.Windows.Forms.DockStyle.Left; - this.btnNewAssign.Location = new System.Drawing.Point(0, 0); - this.btnNewAssign.Name = "btnNewAssign"; - this.btnNewAssign.Size = new System.Drawing.Size(75, 32); - this.btnNewAssign.TabIndex = 19; - this.btnNewAssign.Text = "New"; - this.btnNewAssign.UseVisualStyleBackColor = true; - // - // tabPage2 - // - this.tabPage2.AutoScroll = true; - this.tabPage2.Controls.Add(this.rolePermissionsDataGridView); - this.tabPage2.Controls.Add(this.panel2); - this.tabPage2.Location = new System.Drawing.Point(4, 25); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(626, 419); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Permissions"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // rolePermissionsDataGridView - // - this.rolePermissionsDataGridView.AutoGenerateColumns = false; - this.rolePermissionsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Pid, - this.dataGridViewTextBoxColumn13, - this.dataGridViewTextBoxColumn19, - this.dataGridViewTextBoxColumn7, - this.dataGridViewCheckBoxColumn2, - this.dataGridViewCheckBoxColumn4, - this.dataGridViewCheckBoxColumn1, - this.dataGridViewCheckBoxColumn3, - this.dataGridViewTextBoxColumn16, - this.dataGridViewTextBoxColumn12}); - this.rolePermissionsDataGridView.DataSource = this.rolePermissionsBindingSource; - this.rolePermissionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.rolePermissionsDataGridView.Location = new System.Drawing.Point(3, 37); - this.rolePermissionsDataGridView.Name = "rolePermissionsDataGridView"; - this.rolePermissionsDataGridView.RowTemplate.Height = 24; - this.rolePermissionsDataGridView.Size = new System.Drawing.Size(620, 379); - this.rolePermissionsDataGridView.TabIndex = 20; - // - // Pid - // - this.Pid.DataPropertyName = "Pid"; - this.Pid.HeaderText = "Pid"; - this.Pid.MinimumWidth = 2; - this.Pid.Name = "Pid"; - this.Pid.ReadOnly = true; - this.Pid.Visible = false; - this.Pid.Width = 2; - // - // permADLookupBindingSource - // - this.permADLookupBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.vlnValueKey); - // - // dataGridViewTextBoxColumn13 - // - this.dataGridViewTextBoxColumn13.DataPropertyName = "VersionType"; - this.dataGridViewTextBoxColumn13.HeaderText = "VersionType"; - this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13"; - // - // dataGridViewTextBoxColumn19 - // - this.dataGridViewTextBoxColumn19.DataPropertyName = "PermLevel"; - this.dataGridViewTextBoxColumn19.HeaderText = "PermLevel"; - this.dataGridViewTextBoxColumn19.Name = "dataGridViewTextBoxColumn19"; - this.dataGridViewTextBoxColumn19.Resizable = System.Windows.Forms.DataGridViewTriState.True; - // - // dataGridViewTextBoxColumn7 - // - this.dataGridViewTextBoxColumn7.DataPropertyName = "PermValue"; - this.dataGridViewTextBoxColumn7.HeaderText = "PermValue"; - this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; - this.dataGridViewTextBoxColumn7.Visible = false; - // - // dataGridViewCheckBoxColumn2 - // - this.dataGridViewCheckBoxColumn2.DataPropertyName = "ReadAccess"; - this.dataGridViewCheckBoxColumn2.HeaderText = "R"; - this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2"; - this.dataGridViewCheckBoxColumn2.ToolTipText = "Read Access"; - this.dataGridViewCheckBoxColumn2.Width = 30; - // - // dataGridViewCheckBoxColumn4 - // - this.dataGridViewCheckBoxColumn4.DataPropertyName = "WriteAccess"; - this.dataGridViewCheckBoxColumn4.HeaderText = "W"; - this.dataGridViewCheckBoxColumn4.Name = "dataGridViewCheckBoxColumn4"; - this.dataGridViewCheckBoxColumn4.ToolTipText = "Write Access"; - this.dataGridViewCheckBoxColumn4.Width = 30; - // - // dataGridViewCheckBoxColumn1 - // - this.dataGridViewCheckBoxColumn1.DataPropertyName = "CreateAccess"; - this.dataGridViewCheckBoxColumn1.HeaderText = "C"; - this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; - this.dataGridViewCheckBoxColumn1.ToolTipText = "Create Access"; - this.dataGridViewCheckBoxColumn1.Width = 30; - // - // dataGridViewCheckBoxColumn3 - // - this.dataGridViewCheckBoxColumn3.DataPropertyName = "DeleteAccess"; - this.dataGridViewCheckBoxColumn3.HeaderText = "D"; - this.dataGridViewCheckBoxColumn3.Name = "dataGridViewCheckBoxColumn3"; - this.dataGridViewCheckBoxColumn3.ToolTipText = "Delete Access"; - this.dataGridViewCheckBoxColumn3.Width = 30; - // - // dataGridViewTextBoxColumn16 - // - this.dataGridViewTextBoxColumn16.DataPropertyName = "EndDate"; - this.dataGridViewTextBoxColumn16.HeaderText = "EndDate"; - this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16"; - // - // dataGridViewTextBoxColumn12 - // - this.dataGridViewTextBoxColumn12.DataPropertyName = "StartDate"; - this.dataGridViewTextBoxColumn12.HeaderText = "StartDate"; - this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12"; - // - // rolePermissionsBindingSource - // - this.rolePermissionsBindingSource.DataMember = "RolePermissions"; - this.rolePermissionsBindingSource.DataSource = this.roleBindingSource; - this.rolePermissionsBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // roleBindingSource - // - this.roleBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.Role); - this.roleBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // panel2 - // - this.panel2.Controls.Add(this.button1); - this.panel2.Controls.Add(this.btnNewPermission); - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(3, 3); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(620, 34); - this.panel2.TabIndex = 20; - // - // button1 - // - this.button1.AutoSize = true; - this.button1.Dock = System.Windows.Forms.DockStyle.Left; - this.button1.Location = new System.Drawing.Point(75, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 34); - this.button1.TabIndex = 20; - this.button1.Text = "Remove"; - this.button1.UseVisualStyleBackColor = true; - // - // btnNewPermission - // - this.btnNewPermission.AutoSize = true; - this.btnNewPermission.Dock = System.Windows.Forms.DockStyle.Left; - this.btnNewPermission.Location = new System.Drawing.Point(0, 0); - this.btnNewPermission.Name = "btnNewPermission"; - this.btnNewPermission.Size = new System.Drawing.Size(75, 34); - this.btnNewPermission.TabIndex = 19; - this.btnNewPermission.Text = "New"; - this.btnNewPermission.UseVisualStyleBackColor = true; - this.btnNewPermission.Click += new System.EventHandler(this.btnNewPermission_Click); - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.Controls.Add(nameLabel); - this.panel1.Controls.Add(this.nameTextBox); - this.panel1.Controls.Add(this.ridTextBox); - this.panel1.Controls.Add(titleLabel); - this.panel1.Controls.Add(this.titleTextBox); - this.panel1.Controls.Add(this.btnNew); - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.btnSave); - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(634, 102); - this.panel1.TabIndex = 19; - // - // nameTextBox - // - this.nameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.roleBindingSource, "Name", true)); - this.nameTextBox.Location = new System.Drawing.Point(124, 6); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(417, 22); - this.nameTextBox.TabIndex = 22; - // - // ridTextBox - // - this.ridTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.roleBindingSource, "Rid", true)); - this.ridTextBox.Enabled = false; - this.ridTextBox.Location = new System.Drawing.Point(7, 5); - this.ridTextBox.Name = "ridTextBox"; - this.ridTextBox.Size = new System.Drawing.Size(47, 22); - this.ridTextBox.TabIndex = 23; - // - // titleTextBox - // - this.titleTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.roleBindingSource, "Title", true)); - this.titleTextBox.Location = new System.Drawing.Point(61, 35); - this.titleTextBox.Multiline = true; - this.titleTextBox.Name = "titleTextBox"; - this.titleTextBox.Size = new System.Drawing.Size(480, 51); - this.titleTextBox.TabIndex = 25; - // - // btnNew - // - this.btnNew.Location = new System.Drawing.Point(547, 62); - this.btnNew.Name = "btnNew"; - this.btnNew.Size = new System.Drawing.Size(75, 23); - this.btnNew.TabIndex = 20; - this.btnNew.Text = "New"; - this.btnNew.UseVisualStyleBackColor = true; - this.btnNew.Click += new System.EventHandler(this.btnNew_Click); - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(547, 33); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 19; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(547, 4); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 18; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // dataGridViewTextBoxColumn10 - // - this.dataGridViewTextBoxColumn10.DataPropertyName = "Pid"; - this.dataGridViewTextBoxColumn10.HeaderText = "Pid"; - this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; - this.dataGridViewTextBoxColumn10.ReadOnly = true; - this.dataGridViewTextBoxColumn10.Visible = false; - // - // errorProvider1 - // - this.errorProvider1.ContainerControl = this; - this.errorProvider1.DataSource = this.roleBindingSource; - // - // frmRoles - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(863, 550); - this.Controls.Add(this.splitContainer1); - this.Name = "frmRoles"; - this.Text = "Roles"; - this.Load += new System.EventHandler(this.frmRoles_Load); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BeforeFormClosing); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.roleInfoListBindingSource)).EndInit(); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.roleAssignmentsDataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.roleAssignmentsBindingSource)).EndInit(); - this.panel3.ResumeLayout(false); - this.panel3.PerformLayout(); - this.tabPage2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.rolePermissionsDataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.permADLookupBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.rolePermissionsBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.roleBindingSource)).EndInit(); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListBox lbRoles; - private System.Windows.Forms.BindingSource roleInfoListBindingSource; - private System.Windows.Forms.BindingSource roleAssignmentsBindingSource; - private System.Windows.Forms.BindingSource roleBindingSource; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.DataGridView roleAssignmentsDataGridView; - private System.Windows.Forms.DataGridViewTextBoxColumn StartDate; - private System.Windows.Forms.DataGridViewTextBoxColumn EndDate; - private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.TextBox nameTextBox; - private System.Windows.Forms.TextBox ridTextBox; - private System.Windows.Forms.TextBox titleTextBox; - private System.Windows.Forms.Button btnNew; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.Button btnRemoveAssign; - private System.Windows.Forms.Button btnNewAssign; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button btnNewPermission; - private System.Windows.Forms.DataGridView rolePermissionsDataGridView; - private System.Windows.Forms.BindingSource rolePermissionsBindingSource; - private System.Windows.Forms.ErrorProvider errorProvider1; - private System.Windows.Forms.BindingSource permADLookupBindingSource; - private System.Windows.Forms.DataGridViewTextBoxColumn Pid; - private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewTextBoxColumn15; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn19; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; - private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn2; - private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn4; - private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1; - private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn3; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmRoles.cs b/PROMS/VEPROMS_Security/WinApp/frmRoles.cs deleted file mode 100644 index 1d3c2c2b..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmRoles.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -namespace WinApp -{ - public partial class frmRoles : Form - { - Role _role; - private PermLookup _pl=new PermLookup(); - public frmRoles() - { - InitializeComponent(); - roleInfoListBindingSource.DataSource = RoleInfoList.Get(); - permADLookupBindingSource.DataSource = _pl.PermADLookup; - SetupDetail(); - SetupButtons(); - } - private DialogResult SaveAsNeeded() - { - if (_role != null && _role.IsSavable) - { - DialogResult dr = MessageBox.Show("Do you want to save changes", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) Save(); - if (dr == DialogResult.No) Cancel(); - // TODO: Need a Cancel - return dr; - } - return DialogResult.Yes; - } - private void SetupDetail() - { - if (lbRoles.SelectedValue != null) - { - int rid = (int)lbRoles.SelectedValue; - if (_role == null || _role.RID != rid) - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _role = Role.Get(rid); - roleBindingSource.DataSource = _role; - roleAssignmentsBindingSource.DataSource = _role.RoleAssignments; - rolePermissionsBindingSource.DataSource = _role.RolePermissions; - } - } - } - } - private void lbRole_SelectedValueChanged(object sender, EventArgs e) - { - SetupDetail(); - } - private void SetupButtons() - { - if (_role != null) - { - btnSave.Enabled = _role.IsSavable; - btnCancel.Enabled = _role.IsDirty; - btnNew.Enabled = _role.IsValid; - } - else - { - btnSave.Enabled = false; - btnCancel.Enabled = false; - btnNew.Enabled = true; - } - } - private void CurrentItemChanged(object sender, EventArgs e) - { - SetupButtons(); - } - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - private void btnSave_Click(object sender, EventArgs e) - { - Save(); - } - private void btnNew_Click(object sender, EventArgs e) - { - New(); - } - private void Cancel() - { - _role.CancelEdit(); - _role.BeginEdit(); - } - private void Save() - { - roleBindingSource.RaiseListChangedEvents = false; - roleAssignmentsBindingSource.RaiseListChangedEvents = false; - rolePermissionsBindingSource.RaiseListChangedEvents = false; - roleBindingSource.EndEdit(); - roleAssignmentsBindingSource.EndEdit(); - rolePermissionsBindingSource.EndEdit(); - try - { - Role temp = _role.Clone(); - _role = temp.Save(); - _role.BeginEdit(); - roleBindingSource.DataSource = null; - roleAssignmentsBindingSource.DataSource = null; - rolePermissionsBindingSource.DataSource = null; - int rid = _role.RID; - roleInfoListBindingSource.DataSource = RoleInfoList.Get(); - if (lbRoles.SelectedIndex == -1) - lbRoles.SelectedValue = rid; - roleBindingSource.DataSource = _role; - roleAssignmentsBindingSource.DataSource = _role.RoleAssignments; - rolePermissionsBindingSource.DataSource = _role.RolePermissions; - } - catch (Csla.DataPortalException ex) - { - MessageBox.Show(ex.BusinessException.ToString(), - "Error saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error saving", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - finally - { - roleBindingSource.RaiseListChangedEvents = true; - roleAssignmentsBindingSource.RaiseListChangedEvents = true; - rolePermissionsBindingSource.RaiseListChangedEvents = true; - roleBindingSource.ResetBindings(false); - roleAssignmentsBindingSource.ResetBindings(false); - rolePermissionsBindingSource.ResetBindings(false); - } - SetupButtons(); - } - public void New() - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _role = Role.New(); - roleBindingSource.DataSource = _role; - roleAssignmentsBindingSource.DataSource = _role.RoleAssignments; - rolePermissionsBindingSource.DataSource = _role.RolePermissions; - } - } - - private void BeforeFormClosing(object sender, FormClosingEventArgs e) - { - e.Cancel = (SaveAsNeeded() == DialogResult.Cancel); - } - - private void btnNewPermission_Click(object sender, EventArgs e) - { - _role.RolePermissions.Add(RolePermission.New()); - } - - private void frmRoles_Load(object sender, EventArgs e) - { - - } - //private void btnNewGA_Click(object sender, EventArgs e) - //{ - // using (frmUserSelect f = new frmUserSelect()) - // { - // f.ShowDialog(); - // if (f.DialogResult == DialogResult.OK) - // { - // _group.GroupMemberships.Add(f.UID); - // SetupButtons(); - // } - // } - //} - //private void btnRemoveGA_Click(object sender, EventArgs e) - //{ - // if (this.groupMembershipsDataGridView.SelectedRows.Count > 0) - // { - // int uid = int.Parse( - // this.groupMembershipsDataGridView.SelectedRows[0].Cells[0].Value.ToString()); - // _group.GroupMemberships.Remove(uid); - // } - //} - - //private void btnRemoveAssign_Click(object sender, EventArgs e) - //{ - // if (this.groupPermissionsDataGridView.SelectedRows.Count > 0) - // { - // int folderid = int.Parse( - // this.groupMembershipsDataGridView.SelectedRows[1].Cells[0].Value.ToString()); - // int rid = int.Parse( - // this.groupMembershipsDataGridView.SelectedRows[2].Cells[0].Value.ToString()); - // _group.GroupAssignments.Remove(folderid, rid); - // } - - //} - - //private void btnNewAssign_Click(object sender, EventArgs e) - //{ - // using (frmAssignmentSelect f = new frmAssignmentSelect(_group)) - // { - // f.ShowDialog(); - // if (f.DialogResult == DialogResult.OK) - // { - // //TODO: Do I need to refresh Assignments? - // } - // } - //} - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmRoles.resx b/PROMS/VEPROMS_Security/WinApp/frmRoles.resx deleted file mode 100644 index 46a2cb45..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmRoles.resx +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - False - - - 17, 57 - - - True - - - True - - - 269, 17 - - - True - - - 515, 17 - - - 54, 18 - - - 231, 57 - - - 756, 17 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmUser.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmUser.Designer.cs deleted file mode 100644 index 6590e450..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUser.Designer.cs +++ /dev/null @@ -1,574 +0,0 @@ -namespace WinApp -{ - partial class frmUser - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.Label cfgNameLabel; - System.Windows.Forms.Label configLabel; - System.Windows.Forms.Label courtesyTitleLabel; - System.Windows.Forms.Label firstNameLabel; - System.Windows.Forms.Label lastNameLabel; - System.Windows.Forms.Label middleNameLabel; - System.Windows.Forms.Label phoneNumberLabel; - System.Windows.Forms.Label suffixLabel; - System.Windows.Forms.Label userLoginLabel; - System.Windows.Forms.Label userNameLabel; - System.Windows.Forms.Label useridLabel; - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.lbUsers = new System.Windows.Forms.ListBox(); - this.userInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.btnPop = new System.Windows.Forms.Button(); - this.btnStack = new System.Windows.Forms.Button(); - this.useridTextBox = new System.Windows.Forms.TextBox(); - this.userBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.btnRemoveGA = new System.Windows.Forms.Button(); - this.btnNewGA = new System.Windows.Forms.Button(); - this.btnGroups = new System.Windows.Forms.Button(); - this.btnNew = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.userMembershipsDataGridView = new System.Windows.Forms.DataGridView(); - this.Gid = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Group_GroupName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.userMembershipsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.cfgNameTextBox = new System.Windows.Forms.TextBox(); - this.configTextBox = new System.Windows.Forms.TextBox(); - this.courtesyTitleTextBox = new System.Windows.Forms.TextBox(); - this.firstNameTextBox = new System.Windows.Forms.TextBox(); - this.lastNameTextBox = new System.Windows.Forms.TextBox(); - this.middleNameTextBox = new System.Windows.Forms.TextBox(); - this.phoneNumberTextBox = new System.Windows.Forms.TextBox(); - this.suffixTextBox = new System.Windows.Forms.TextBox(); - this.uidTextBox = new System.Windows.Forms.TextBox(); - this.userLoginTextBox = new System.Windows.Forms.TextBox(); - this.userNameTextBox = new System.Windows.Forms.TextBox(); - this.groupInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components); - cfgNameLabel = new System.Windows.Forms.Label(); - configLabel = new System.Windows.Forms.Label(); - courtesyTitleLabel = new System.Windows.Forms.Label(); - firstNameLabel = new System.Windows.Forms.Label(); - lastNameLabel = new System.Windows.Forms.Label(); - middleNameLabel = new System.Windows.Forms.Label(); - phoneNumberLabel = new System.Windows.Forms.Label(); - suffixLabel = new System.Windows.Forms.Label(); - userLoginLabel = new System.Windows.Forms.Label(); - userNameLabel = new System.Windows.Forms.Label(); - useridLabel = new System.Windows.Forms.Label(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.userBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsDataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); - this.SuspendLayout(); - // - // cfgNameLabel - // - cfgNameLabel.AutoSize = true; - cfgNameLabel.Location = new System.Drawing.Point(252, 45); - cfgNameLabel.Name = "cfgNameLabel"; - cfgNameLabel.Size = new System.Drawing.Size(74, 17); - cfgNameLabel.TabIndex = 0; - cfgNameLabel.Text = "Cfg Name:"; - // - // configLabel - // - configLabel.AutoSize = true; - configLabel.Location = new System.Drawing.Point(35, 158); - configLabel.Name = "configLabel"; - configLabel.Size = new System.Drawing.Size(52, 17); - configLabel.TabIndex = 2; - configLabel.Text = "Config:"; - // - // courtesyTitleLabel - // - courtesyTitleLabel.AutoSize = true; - courtesyTitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - courtesyTitleLabel.Location = new System.Drawing.Point(35, 103); - courtesyTitleLabel.Name = "courtesyTitleLabel"; - courtesyTitleLabel.Size = new System.Drawing.Size(35, 17); - courtesyTitleLabel.TabIndex = 4; - courtesyTitleLabel.Text = "Title"; - // - // firstNameLabel - // - firstNameLabel.AutoSize = true; - firstNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - firstNameLabel.Location = new System.Drawing.Point(77, 103); - firstNameLabel.Name = "firstNameLabel"; - firstNameLabel.Size = new System.Drawing.Size(35, 17); - firstNameLabel.TabIndex = 8; - firstNameLabel.Text = "First"; - // - // lastNameLabel - // - lastNameLabel.AutoSize = true; - lastNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - lastNameLabel.Location = new System.Drawing.Point(289, 103); - lastNameLabel.Name = "lastNameLabel"; - lastNameLabel.Size = new System.Drawing.Size(35, 17); - lastNameLabel.TabIndex = 10; - lastNameLabel.Text = "Last"; - // - // middleNameLabel - // - middleNameLabel.AutoSize = true; - middleNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - middleNameLabel.Location = new System.Drawing.Point(183, 103); - middleNameLabel.Name = "middleNameLabel"; - middleNameLabel.Size = new System.Drawing.Size(49, 17); - middleNameLabel.TabIndex = 12; - middleNameLabel.Text = "Middle"; - // - // phoneNumberLabel - // - phoneNumberLabel.AutoSize = true; - phoneNumberLabel.Location = new System.Drawing.Point(252, 17); - phoneNumberLabel.Name = "phoneNumberLabel"; - phoneNumberLabel.Size = new System.Drawing.Size(107, 17); - phoneNumberLabel.TabIndex = 14; - phoneNumberLabel.Text = "Phone Number:"; - // - // suffixLabel - // - suffixLabel.AutoSize = true; - suffixLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - suffixLabel.Location = new System.Drawing.Point(395, 103); - suffixLabel.Name = "suffixLabel"; - suffixLabel.Size = new System.Drawing.Size(46, 17); - suffixLabel.TabIndex = 16; - suffixLabel.Text = "Suffix:"; - // - // userLoginLabel - // - userLoginLabel.AutoSize = true; - userLoginLabel.Location = new System.Drawing.Point(35, 17); - userLoginLabel.Name = "userLoginLabel"; - userLoginLabel.Size = new System.Drawing.Size(81, 17); - userLoginLabel.TabIndex = 24; - userLoginLabel.Text = "User Login:"; - // - // userNameLabel - // - userNameLabel.AutoSize = true; - userNameLabel.Location = new System.Drawing.Point(35, 45); - userNameLabel.Name = "userNameLabel"; - userNameLabel.Size = new System.Drawing.Size(83, 17); - userNameLabel.TabIndex = 26; - userNameLabel.Text = "User Name:"; - // - // useridLabel - // - useridLabel.AutoSize = true; - useridLabel.Location = new System.Drawing.Point(178, 133); - useridLabel.Name = "useridLabel"; - useridLabel.Size = new System.Drawing.Size(53, 17); - useridLabel.TabIndex = 35; - useridLabel.Text = "Userid:"; - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.lbUsers); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.AutoScroll = true; - this.splitContainer1.Panel2.Controls.Add(this.btnPop); - this.splitContainer1.Panel2.Controls.Add(this.btnStack); - this.splitContainer1.Panel2.Controls.Add(useridLabel); - this.splitContainer1.Panel2.Controls.Add(this.useridTextBox); - this.splitContainer1.Panel2.Controls.Add(this.btnRemoveGA); - this.splitContainer1.Panel2.Controls.Add(this.btnNewGA); - this.splitContainer1.Panel2.Controls.Add(this.btnGroups); - this.splitContainer1.Panel2.Controls.Add(this.btnNew); - this.splitContainer1.Panel2.Controls.Add(this.btnCancel); - this.splitContainer1.Panel2.Controls.Add(this.btnSave); - this.splitContainer1.Panel2.Controls.Add(this.userMembershipsDataGridView); - this.splitContainer1.Panel2.Controls.Add(cfgNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.cfgNameTextBox); - this.splitContainer1.Panel2.Controls.Add(configLabel); - this.splitContainer1.Panel2.Controls.Add(this.configTextBox); - this.splitContainer1.Panel2.Controls.Add(courtesyTitleLabel); - this.splitContainer1.Panel2.Controls.Add(this.courtesyTitleTextBox); - this.splitContainer1.Panel2.Controls.Add(firstNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.firstNameTextBox); - this.splitContainer1.Panel2.Controls.Add(lastNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.lastNameTextBox); - this.splitContainer1.Panel2.Controls.Add(middleNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.middleNameTextBox); - this.splitContainer1.Panel2.Controls.Add(phoneNumberLabel); - this.splitContainer1.Panel2.Controls.Add(this.phoneNumberTextBox); - this.splitContainer1.Panel2.Controls.Add(suffixLabel); - this.splitContainer1.Panel2.Controls.Add(this.suffixTextBox); - this.splitContainer1.Panel2.Controls.Add(this.uidTextBox); - this.splitContainer1.Panel2.Controls.Add(userLoginLabel); - this.splitContainer1.Panel2.Controls.Add(this.userLoginTextBox); - this.splitContainer1.Panel2.Controls.Add(userNameLabel); - this.splitContainer1.Panel2.Controls.Add(this.userNameTextBox); - this.splitContainer1.Size = new System.Drawing.Size(841, 462); - this.splitContainer1.SplitterDistance = 280; - this.splitContainer1.TabIndex = 0; - // - // lbUsers - // - this.lbUsers.DataSource = this.userInfoListBindingSource; - this.lbUsers.DisplayMember = "FullName"; - this.lbUsers.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbUsers.FormattingEnabled = true; - this.lbUsers.ItemHeight = 16; - this.lbUsers.Location = new System.Drawing.Point(0, 0); - this.lbUsers.Name = "lbUsers"; - this.lbUsers.Size = new System.Drawing.Size(280, 452); - this.lbUsers.TabIndex = 0; - this.lbUsers.ValueMember = "Uid"; - this.lbUsers.SelectedValueChanged += new System.EventHandler(this.lbUser_SelectedValueChanged); - // - // userInfoListBindingSource - // - this.userInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.UserInfo); - // - // btnPop - // - this.btnPop.Location = new System.Drawing.Point(470, 127); - this.btnPop.Name = "btnPop"; - this.btnPop.Size = new System.Drawing.Size(75, 23); - this.btnPop.TabIndex = 38; - this.btnPop.Text = "Push"; - this.btnPop.UseVisualStyleBackColor = true; - this.btnPop.Click += new System.EventHandler(this.btnPop_Click); - // - // btnStack - // - this.btnStack.Location = new System.Drawing.Point(471, 100); - this.btnStack.Name = "btnStack"; - this.btnStack.Size = new System.Drawing.Size(75, 23); - this.btnStack.TabIndex = 37; - this.btnStack.Text = "Push"; - this.btnStack.UseVisualStyleBackColor = true; - this.btnStack.Click += new System.EventHandler(this.btnStack_Click); - // - // useridTextBox - // - this.useridTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Userid", true)); - this.useridTextBox.Location = new System.Drawing.Point(237, 130); - this.useridTextBox.Name = "useridTextBox"; - this.useridTextBox.Size = new System.Drawing.Size(100, 22); - this.useridTextBox.TabIndex = 36; - // - // userBindingSource - // - this.userBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.User); - this.userBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // btnRemoveGA - // - this.btnRemoveGA.Location = new System.Drawing.Point(177, 227); - this.btnRemoveGA.Name = "btnRemoveGA"; - this.btnRemoveGA.Size = new System.Drawing.Size(149, 23); - this.btnRemoveGA.TabIndex = 35; - this.btnRemoveGA.TabStop = false; - this.btnRemoveGA.Text = "Remove Membership"; - this.btnRemoveGA.UseVisualStyleBackColor = true; - this.btnRemoveGA.Click += new System.EventHandler(this.btnRemoveGA_Click); - // - // btnNewGA - // - this.btnNewGA.Location = new System.Drawing.Point(38, 227); - this.btnNewGA.Name = "btnNewGA"; - this.btnNewGA.Size = new System.Drawing.Size(133, 23); - this.btnNewGA.TabIndex = 34; - this.btnNewGA.TabStop = false; - this.btnNewGA.Text = "New Membership"; - this.btnNewGA.UseVisualStyleBackColor = true; - this.btnNewGA.Click += new System.EventHandler(this.btnNewGA_Click); - // - // btnGroups - // - this.btnGroups.Location = new System.Drawing.Point(423, 227); - this.btnGroups.Name = "btnGroups"; - this.btnGroups.Size = new System.Drawing.Size(100, 23); - this.btnGroups.TabIndex = 33; - this.btnGroups.TabStop = false; - this.btnGroups.Text = "Group Edit"; - this.btnGroups.UseVisualStyleBackColor = true; - this.btnGroups.Click += new System.EventHandler(this.btnGroups_Click); - // - // btnNew - // - this.btnNew.Location = new System.Drawing.Point(471, 72); - this.btnNew.Name = "btnNew"; - this.btnNew.Size = new System.Drawing.Size(75, 23); - this.btnNew.TabIndex = 30; - this.btnNew.Text = "New"; - this.btnNew.UseVisualStyleBackColor = true; - this.btnNew.Click += new System.EventHandler(this.btnNewGA_Click); - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(471, 43); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 29; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(471, 14); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 28; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // userMembershipsDataGridView - // - this.userMembershipsDataGridView.AllowUserToAddRows = false; - this.userMembershipsDataGridView.AllowUserToDeleteRows = false; - this.userMembershipsDataGridView.AutoGenerateColumns = false; - this.userMembershipsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Gid, - this.Group_GroupName, - this.dataGridViewTextBoxColumn8, - this.dataGridViewTextBoxColumn4}); - this.userMembershipsDataGridView.DataSource = this.userMembershipsBindingSource; - this.userMembershipsDataGridView.Location = new System.Drawing.Point(38, 256); - this.userMembershipsDataGridView.Name = "userMembershipsDataGridView"; - this.userMembershipsDataGridView.RowTemplate.Height = 24; - this.userMembershipsDataGridView.Size = new System.Drawing.Size(485, 157); - this.userMembershipsDataGridView.TabIndex = 27; - this.userMembershipsDataGridView.SelectionChanged += new System.EventHandler(this.userMembershipsDataGridView_SelectionChanged); - // - // Gid - // - this.Gid.DataPropertyName = "Gid"; - this.Gid.HeaderText = "Gid"; - this.Gid.Name = "Gid"; - this.Gid.Visible = false; - // - // Group_GroupName - // - this.Group_GroupName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Group_GroupName.DataPropertyName = "Group_GroupName"; - this.Group_GroupName.HeaderText = "Group"; - this.Group_GroupName.Name = "Group_GroupName"; - this.Group_GroupName.ReadOnly = true; - // - // dataGridViewTextBoxColumn8 - // - this.dataGridViewTextBoxColumn8.DataPropertyName = "StartDate"; - this.dataGridViewTextBoxColumn8.HeaderText = "StartDate"; - this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; - // - // dataGridViewTextBoxColumn4 - // - this.dataGridViewTextBoxColumn4.DataPropertyName = "EndDate"; - this.dataGridViewTextBoxColumn4.HeaderText = "EndDate"; - this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; - // - // userMembershipsBindingSource - // - this.userMembershipsBindingSource.DataMember = "UserMemberships"; - this.userMembershipsBindingSource.DataSource = this.userBindingSource; - this.userMembershipsBindingSource.CurrentItemChanged += new System.EventHandler(this.CurrentItemChanged); - // - // cfgNameTextBox - // - this.cfgNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "CfgName", true)); - this.cfgNameTextBox.Location = new System.Drawing.Point(365, 42); - this.cfgNameTextBox.Name = "cfgNameTextBox"; - this.cfgNameTextBox.Size = new System.Drawing.Size(100, 22); - this.cfgNameTextBox.TabIndex = 1; - // - // configTextBox - // - this.configTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Config", true)); - this.configTextBox.Location = new System.Drawing.Point(93, 158); - this.configTextBox.Multiline = true; - this.configTextBox.Name = "configTextBox"; - this.configTextBox.Size = new System.Drawing.Size(430, 63); - this.configTextBox.TabIndex = 3; - // - // courtesyTitleTextBox - // - this.courtesyTitleTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "CourtesyTitle", true)); - this.courtesyTitleTextBox.Location = new System.Drawing.Point(38, 78); - this.courtesyTitleTextBox.Name = "courtesyTitleTextBox"; - this.courtesyTitleTextBox.Size = new System.Drawing.Size(36, 22); - this.courtesyTitleTextBox.TabIndex = 5; - // - // firstNameTextBox - // - this.firstNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "FirstName", true)); - this.firstNameTextBox.Location = new System.Drawing.Point(80, 78); - this.firstNameTextBox.Name = "firstNameTextBox"; - this.firstNameTextBox.Size = new System.Drawing.Size(100, 22); - this.firstNameTextBox.TabIndex = 9; - // - // lastNameTextBox - // - this.lastNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "LastName", true)); - this.lastNameTextBox.Location = new System.Drawing.Point(292, 78); - this.lastNameTextBox.Name = "lastNameTextBox"; - this.lastNameTextBox.Size = new System.Drawing.Size(100, 22); - this.lastNameTextBox.TabIndex = 11; - // - // middleNameTextBox - // - this.middleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "MiddleName", true)); - this.middleNameTextBox.Location = new System.Drawing.Point(186, 78); - this.middleNameTextBox.Name = "middleNameTextBox"; - this.middleNameTextBox.Size = new System.Drawing.Size(100, 22); - this.middleNameTextBox.TabIndex = 13; - // - // phoneNumberTextBox - // - this.phoneNumberTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "PhoneNumber", true)); - this.phoneNumberTextBox.Location = new System.Drawing.Point(365, 14); - this.phoneNumberTextBox.Name = "phoneNumberTextBox"; - this.phoneNumberTextBox.Size = new System.Drawing.Size(100, 22); - this.phoneNumberTextBox.TabIndex = 15; - // - // suffixTextBox - // - this.suffixTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Suffix", true)); - this.suffixTextBox.Location = new System.Drawing.Point(398, 78); - this.suffixTextBox.Name = "suffixTextBox"; - this.suffixTextBox.Size = new System.Drawing.Size(38, 22); - this.suffixTextBox.TabIndex = 17; - // - // uidTextBox - // - this.uidTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "Uid", true)); - this.uidTextBox.Enabled = false; - this.uidTextBox.Location = new System.Drawing.Point(3, 3); - this.uidTextBox.Name = "uidTextBox"; - this.uidTextBox.Size = new System.Drawing.Size(33, 22); - this.uidTextBox.TabIndex = 19; - // - // userLoginTextBox - // - this.userLoginTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "UserLogin", true)); - this.userLoginTextBox.Location = new System.Drawing.Point(148, 12); - this.userLoginTextBox.Name = "userLoginTextBox"; - this.userLoginTextBox.Size = new System.Drawing.Size(100, 22); - this.userLoginTextBox.TabIndex = 25; - // - // userNameTextBox - // - this.userNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.userBindingSource, "UserName", true)); - this.userNameTextBox.Location = new System.Drawing.Point(148, 42); - this.userNameTextBox.Name = "userNameTextBox"; - this.userNameTextBox.Size = new System.Drawing.Size(100, 22); - this.userNameTextBox.TabIndex = 27; - // - // groupInfoListBindingSource - // - this.groupInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.GroupInfo); - // - // errorProvider1 - // - this.errorProvider1.ContainerControl = this; - this.errorProvider1.DataSource = this.userBindingSource; - // - // frmUser - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(841, 462); - this.Controls.Add(this.splitContainer1); - this.Name = "frmUser"; - this.Text = "Users"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BeforeFormClosing); - this.Load += new System.EventHandler(this.frmUser_Load); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.userBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsDataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.userMembershipsBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.groupInfoListBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListBox lbUsers; - private System.Windows.Forms.BindingSource userInfoListBindingSource; - private System.Windows.Forms.TextBox cfgNameTextBox; - private System.Windows.Forms.BindingSource userBindingSource; - private System.Windows.Forms.TextBox configTextBox; - private System.Windows.Forms.TextBox courtesyTitleTextBox; - private System.Windows.Forms.TextBox firstNameTextBox; - private System.Windows.Forms.TextBox lastNameTextBox; - private System.Windows.Forms.TextBox middleNameTextBox; - private System.Windows.Forms.TextBox phoneNumberTextBox; - private System.Windows.Forms.TextBox suffixTextBox; - private System.Windows.Forms.TextBox uidTextBox; - private System.Windows.Forms.TextBox userLoginTextBox; - private System.Windows.Forms.TextBox userNameTextBox; - private System.Windows.Forms.DataGridView userMembershipsDataGridView; - private System.Windows.Forms.BindingSource groupInfoListBindingSource; - private System.Windows.Forms.BindingSource userMembershipsBindingSource; - private System.Windows.Forms.Button btnRemoveGA; - private System.Windows.Forms.Button btnNewGA; - private System.Windows.Forms.Button btnGroups; - private System.Windows.Forms.Button btnNew; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.ErrorProvider errorProvider1; - private System.Windows.Forms.TextBox useridTextBox; - private System.Windows.Forms.DataGridViewTextBoxColumn Gid; - private System.Windows.Forms.DataGridViewTextBoxColumn Group_GroupName; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; - private System.Windows.Forms.Button btnStack; - private System.Windows.Forms.Button btnPop; - } -} - diff --git a/PROMS/VEPROMS_Security/WinApp/frmUser.cs b/PROMS/VEPROMS_Security/WinApp/frmUser.cs deleted file mode 100644 index 6002fd8c..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUser.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -[assembly: log4net.Config.XmlConfigurator(Watch = true)] - -namespace WinApp -{ - public partial class frmUser : Form - { - public frmUser() - { - InitializeComponent(); - } - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private void BeforeFormClosing(object sender, FormClosingEventArgs e) - { - e.Cancel = (SaveAsNeeded() == DialogResult.Cancel); - } - private User _user; - private GroupInfoList _gil=GroupInfoList.Get(); - private void frmUser_Load(object sender, EventArgs e) - { - userInfoListBindingSource.DataSource = UserInfoList.Get(); - groupInfoListBindingSource.DataSource = _gil; - SetupDetail(); - SetupButtons(); - log.Info("This is a test"); - //frmMembership f = new frmMembership(); - //f.Show(); - //f.TopMost = true; - } - private DialogResult SaveAsNeeded() - { - if (_user != null && _user.IsSavable) - { - DialogResult dr = MessageBox.Show("Do you want to save changes", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) Save(); - if (dr == DialogResult.No) Cancel(); - // TODO: Need a Cancel - return dr; - } - return DialogResult.Yes; - } - private void SetupDetail() - { - if (lbUsers.SelectedIndex != -1) - { - int uid = (int)lbUsers.SelectedValue; - if (_user == null || _user.UID != uid) - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _user = User.Get(uid); - userBindingSource.DataSource = _user; - userMembershipsBindingSource.DataSource = _user.UserMemberships; - } - } - } - } - private void lbUser_SelectedValueChanged(object sender, EventArgs e) - { - SetupDetail(); - } - private void SetupButtons() - { - if (_user != null) - { - btnSave.Enabled = _user.IsSavable; - btnCancel.Enabled = _user.IsDirty; - btnNew.Enabled = _user.IsValid; - btnGroups.Enabled = this.userMembershipsDataGridView.SelectedRows.Count > 0; - btnNewGA.Enabled = _gil.Count > this.userMembershipsDataGridView.Rows.Count; - btnRemoveGA.Enabled = this.userMembershipsDataGridView.SelectedRows.Count > 0; - } - else - { - btnSave.Enabled = false; - btnCancel.Enabled = false; - btnNew.Enabled = true; - btnGroups.Enabled = false; - btnNewGA.Enabled = false; - btnRemoveGA.Enabled = false; - } - } - private void CurrentItemChanged(object sender, EventArgs e) - { - SetupButtons(); - } - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - private void btnSave_Click(object sender, EventArgs e) - { - Save(); - } - private void btnNew_Click(object sender, EventArgs e) - { - New(); - } - private void Cancel() - { - _user.CancelEdit(); - //if (_user.IsDirty) - //{ - // foreach (UserMembership m in _user.UserMemberships) - // if(m.IsDirty) - // m.CancelEdit(); - //} - _user.BeginEdit(); - } - private void Save() - { - userBindingSource.RaiseListChangedEvents = false; - userMembershipsBindingSource.RaiseListChangedEvents = false; - userBindingSource.EndEdit(); - userMembershipsBindingSource.EndEdit(); - - try - { - User temp = _user.Clone(); - _user = temp.Save(); - _user.BeginEdit(); - userBindingSource.DataSource = null; - userMembershipsBindingSource.DataSource = null; - int uid = _user.UID; - userInfoListBindingSource.DataSource = UserInfoList.Get(); - if (lbUsers.SelectedIndex == -1) - lbUsers.SelectedValue = uid; - userBindingSource.DataSource = _user; - userMembershipsBindingSource.DataSource = _user.UserMemberships; - } - catch (Csla.DataPortalException ex) - { - MessageBox.Show(ex.BusinessException.ToString(), - "Error saving", MessageBoxButtons.OK, - MessageBoxIcon.Exclamation); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error saving", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - finally - { - userBindingSource.RaiseListChangedEvents = true; - userMembershipsBindingSource.RaiseListChangedEvents = true; - userBindingSource.ResetBindings(false); - userMembershipsBindingSource.ResetBindings(false); - } - SetupButtons(); - } - public void New() - { - if (SaveAsNeeded() != DialogResult.Cancel) - { - _user = User.New(); - userBindingSource.DataSource = _user; - userMembershipsBindingSource.DataSource = _user.UserMemberships; - lbUsers.SelectedIndex = -1; - } - } - - private void btnGroups_Click(object sender, EventArgs e) - { - frmGroups fg = new frmGroups(GetGID()); - fg.ShowDialog(); - } - - private void btnNewGA_Click(object sender, EventArgs e) - { - using (frmGroupSelect f = new frmGroupSelect()) - { - f.ShowDialog(); - if (f.DialogResult == DialogResult.OK) - { - _user.UserMemberships.Add(Group.Get(f.GID)); // TODO KBR - using - SetupButtons(); - } - } - } - private int GetGID() - { - return int.Parse(userMembershipsDataGridView.SelectedRows[0].Cells[0].Value.ToString()); - } - private void btnRemoveGA_Click(object sender, EventArgs e) - { - if (this.userMembershipsDataGridView.SelectedRows.Count > 0) - { - MessageBox.Show("Conversion Error"); - //TODO: KBR _user.UserMemberships.Remove(GetGID()); - } - } - - private void userMembershipsDataGridView_SelectionChanged(object sender, EventArgs e) - { - SetupButtons(); - } - - private void btnStack_Click(object sender, EventArgs e) - { - _user.BeginEdit(); - } - - private void btnPop_Click(object sender, EventArgs e) - { - _user.CancelEdit(); - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmUser.resx b/PROMS/VEPROMS_Security/WinApp/frmUser.resx deleted file mode 100644 index 7410ad10..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUser.resx +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - 17, 17 - - - 234, 17 - - - True - - - True - - - 404, 17 - - - 658, 17 - - - 17, 57 - - \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.Designer.cs b/PROMS/VEPROMS_Security/WinApp/frmUserSelect.Designer.cs deleted file mode 100644 index 8f14154e..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -namespace WinApp -{ - partial class frmUserSelect - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.lbUsers = new System.Windows.Forms.ListBox(); - this.userInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).BeginInit(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // lbUsers - // - this.lbUsers.DataSource = this.userInfoListBindingSource; - this.lbUsers.DisplayMember = "FullName"; - this.lbUsers.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbUsers.FormattingEnabled = true; - this.lbUsers.ItemHeight = 16; - this.lbUsers.Location = new System.Drawing.Point(0, 0); - this.lbUsers.Name = "lbUsers"; - this.lbUsers.Size = new System.Drawing.Size(292, 228); - this.lbUsers.TabIndex = 1; - this.lbUsers.ValueMember = "Uid"; - // - // userInfoListBindingSource - // - this.userInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.UserInfo); - // - // panel1 - // - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.btnOK); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 232); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(292, 28); - this.panel1.TabIndex = 2; - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Dock = System.Windows.Forms.DockStyle.Left; - this.btnCancel.Location = new System.Drawing.Point(73, 0); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(70, 28); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnOK - // - this.btnOK.Dock = System.Windows.Forms.DockStyle.Left; - this.btnOK.Location = new System.Drawing.Point(0, 0); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(73, 28); - this.btnOK.TabIndex = 2; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // frmUserSelect - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(292, 260); - this.Controls.Add(this.lbUsers); - this.Controls.Add(this.panel1); - this.Name = "frmUserSelect"; - this.Text = "Select User"; - this.Load += new System.EventHandler(this.frmUserSelect_Load); - ((System.ComponentModel.ISupportInitialize)(this.userInfoListBindingSource)).EndInit(); - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ListBox lbUsers; - private System.Windows.Forms.BindingSource userInfoListBindingSource; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnOK; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.cs b/PROMS/VEPROMS_Security/WinApp/frmUserSelect.cs deleted file mode 100644 index 23bd3359..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using Csla; - -namespace WinApp -{ - public partial class frmUserSelect : Form - { - public frmUserSelect() - { - InitializeComponent(); - } - private void frmUserSelect_Load(object sender, EventArgs e) - { - userInfoListBindingSource.DataSource = UserInfoList.Get(); - } - public int UID - { - get { return (int) lbUsers.SelectedValue; } - } - private void btnOK_Click(object sender, EventArgs e) - { - Console.WriteLine("SelectedValue = {0}", lbUsers.SelectedValue); - DialogResult = DialogResult.OK; - } - private void btnCancel_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.resx b/PROMS/VEPROMS_Security/WinApp/frmUserSelect.resx deleted file mode 100644 index 2f86a2d6..00000000 --- a/PROMS/VEPROMS_Security/WinApp/frmUserSelect.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file