Compare commits

..

95 Commits

Author SHA1 Message Date
851a0b3810 Merge pull request 'Development' (#464) from Development into master
Merging all items through B2024-092 from development into master after successful testing.
2024-11-11 11:39:01 -05:00
fd8dbb4c8b Merge pull request 'Development' (#454) from Development into master
Merging all changes from development into master after successful testing.
2024-11-01 14:18:00 -04:00
4ffd994c5e Merge pull request 'Development' (#450) from Development into master
Merging all development items into master after successful testing.
2024-10-31 09:11:59 -04:00
a34828113a Merge pull request 'Development' (#416) from Development into master
Merging C2017-031 and B2024-075 from development into master after successful testing.
2024-10-03 12:08:30 -04:00
461329468c Merge pull request 'Development' (#413) from Development into master
Merging F2023-136 and F2024-074 in master after successful testing
2024-09-27 14:27:22 -04:00
35de5df04d Merge pull request 'Development' (#410) from Development into master
Merging all items through B2024-03 from development into master after successful testing.
2024-09-17 12:03:23 -04:00
4f0548fd60 Merge pull request 'Development' (#402) from Development into master
Merging C2021-034 and B2024-065 into master after successful testing.
2024-09-06 09:56:37 -04:00
5c1d96cc51 Merge pull request 'Development' (#399) from Development into master
Merging all fixes through B2024-063 from development into master after successful testing.
2024-08-27 15:58:15 -04:00
57049c0c52 Merge pull request 'Development' (#392) from Development into master
Merging B2024-059 and B2024-058 from development into master after successful testing.
2024-08-15 14:55:27 -04:00
31326e1c91 Merge pull request 'Development' (#389) from Development into master
Merging all changes through F2024-069 from development into master after successful testing.
2024-08-09 13:06:40 -04:00
3c60994a0a Merge pull request 'Development' (#373) from Development into master
Merging all changes through B2024-053 from development into master after successful testing.
2024-08-01 08:37:23 -04:00
773cc42346 Merge pull request 'Development' (#362) from Development into master
Merging B2024-046 and B2024-047 from development into master after successful testing.
2024-07-25 10:44:42 -04:00
f46a1f39dc Merge pull request 'Development' (#359) from Development into master
Merging B2024-042 from development into master after successful testing.
2024-07-22 11:14:19 -04:00
b7175bf77f Merge pull request 'Development' (#357) from Development into master
Merging C2024-005 from development into master after successful testing.
2024-07-18 15:41:20 -04:00
ec22232aa8 Merge pull request 'Development' (#356) from Development into master
Merging all items through B2024-041 from development into master after successful testing.
2024-07-18 09:51:54 -04:00
f303cd2236 Merge pull request 'Development' (#348) from Development into master
Merging F2024-065 and F2024-066 from development into master after successful testing.
2024-07-03 10:45:41 -04:00
f40cef4416 Merge pull request 'Development' (#346) from Development into master
Merging F2024-064 from development into master after successful testing.
2024-07-01 11:54:15 -04:00
fbca97d38d Merge pull request 'Development' (#344) from Development into master
Merging C2024-013 from development into master after successful testing.
2024-06-25 15:55:32 -04:00
28bd2cba5c Merge pull request 'Development' (#342) from Development into master
Merging C2022-029 from development into master after successful testing.
2024-06-20 11:36:59 -04:00
4b35f73bbf Merge pull request 'Development' (#340) from Development into master
Merging C2024-004 from development into master after successful testing.
2024-06-19 16:23:23 -04:00
f4706eb126 Merge pull request 'Development' (#338) from Development into master
Merging C2019-047 from development into master after successful testing.
2024-06-17 08:38:34 -04:00
21bcb90558 Merge pull request 'Development' (#335) from Development into master
Merging B2024-036 and F2024-063 from development into master after successful testing.
2024-06-06 14:51:13 -04:00
ae48ac0cae Merge pull request 'Development' (#332) from Development into master
Merging changes through B2024-035 from development into master after successful testing.
2024-05-30 08:08:28 -04:00
cb4979d5bc Merge pull request 'Development' (#327) from Development into master
Merging F2024-061 from development into master after successful testing.
2024-05-20 14:11:12 -04:00
7d3ae74e1f Merge pull request 'Development' (#325) from Development into master
Merging F2024-060 from development into master after successful testing.
2024-05-16 15:32:13 -04:00
9d680aa500 Merge pull request 'Development' (#323) from Development into master
Merging C2024-001 from development into master after successful testing.
2024-05-16 14:17:17 -04:00
0d50b1c2fe Merge pull request 'Development' (#321) from Development into master
Merging all items through B2024-030 from development into master after successful testing.
2024-05-15 08:33:58 -04:00
75e034863f Merge pull request 'Development' (#315) from Development into master
Merging all changes through B2024-026 from development into master after successful testing.
2024-05-09 14:01:48 -04:00
3b42de1571 Merge pull request 'F2024-059_Callaway' (#311) from F2024-059_Callaway into master
Format only changes
2024-05-07 16:00:36 -04:00
668472286e Merge pull request 'Development' (#307) from Development into master
Merging all changes through C2023-006 into master after successful testing.
2024-04-26 09:21:44 -04:00
e00d34c99d Merge pull request 'Development' (#300) from Development into master
Merging C2024-008 and C2024-007 from development into master after successful testing.
2024-04-17 14:57:22 -04:00
9fb496dfb3 Merge pull request 'Development' (#297) from Development into master
Merging F2024-053 from development into master after successful testing.
2024-04-11 09:23:34 -04:00
f4eaa4a3ef Merge pull request 'Development' (#295) from Development into master
Merging F2024-052 from development into master after successful testing.
2024-04-08 11:11:43 -04:00
5d50ed6bdf Merge pull request 'Development' (#292) from Development into master
Merging F2024-051, B2024-021, F2024-049, F2024-050 and F2024-045 after successful testing.
2024-04-05 10:54:57 -04:00
d7ace4eaf9 Merge pull request 'Development' (#287) from Development into master
Merging F2024-047, F2024-048, B2024-017 and B2024-019 from development into master after successful testing.
2024-04-04 11:36:56 -04:00
16a4d335ea Merge pull request 'Development' (#282) from Development into master
Merging all items through B2024-018 from development into master after successful testing.
2024-03-27 13:39:46 -04:00
ba69bb0772 Merge pull request 'Development' (#275) from Development into master
Merging F2024-037 and CSLA updates into master after successful testing.
2024-03-20 16:07:27 -04:00
455940caa2 Merge pull request 'Development' (#271) from Development into master
Merging F2024-040 into master after successful testing.
2024-03-18 10:00:30 -04:00
439344757e Merge pull request 'Development' (#269) from Development into master
Merging F2024-044, F2024-043, and F2024-019 in master after successful testing.
2024-03-15 09:33:57 -04:00
ad912691c9 Merge pull request 'Development' (#265) from Development into master
Merging 	F2024-016, 	F2024-032, 	B2024-013, 	F2024-025,	F2024-027 & F2024-028 into master after successful testing.
2024-03-12 14:01:12 -04:00
237144aff6 Merge pull request 'Development' (#259) from Development into master
Merging B2024-014 from development into master after successful testing.
2024-03-04 15:02:18 -05:00
810332d558 Merge pull request 'Development' (#256) from Development into master
Merging F2024-020 from development into master.  No testing required since formats are under development.
2024-02-29 13:23:48 -05:00
f8431d0ba1 Merge pull request 'Development' (#252) from Development into master
Merging F2024-022 from development into master.  No testing required since formats are under development.
2024-02-29 09:23:51 -05:00
57c3bfa16a Merge pull request 'Development' (#250) from Development into master
Merging C2023-003 and F2024-026 into master after successful testing.
2024-02-28 11:56:15 -05:00
61f1077608 Merge pull request 'Development' (#248) from Development into master
Merging F2024-029, B2024-009, F2024-023, B2024-011, B2024-012 and F2024-017 from development into master after successful testing.
2024-02-27 14:21:22 -05:00
8877e968b9 Merge pull request 'Development' (#239) from Development into master
Merging F2024-018, B2024-008, B2024-007, and F2024-015 from development into master after successful testing.
2024-02-22 08:22:26 -05:00
4575c90bee Merge pull request 'Development' (#233) from Development into master
Merging updated formats from development into master after successful testing.
2024-02-14 16:07:57 -05:00
21279a87ae Merge pull request 'Development' (#231) from Development into master
Merging B2024-006 from development into master after successful testing.
2024-02-14 08:19:09 -05:00
3d5ad4a17e Merge pull request 'Development' (#229) from Development into master
Merging C2024-002 and F2024-013 from development into master after successful testing.
2024-02-09 11:30:41 -05:00
9bb7b044a8 Merge pull request 'Development' (#226) from Development into master
Merging F2024-010, 	F2024-011, 	F2024-008, 	B2024-002, 	F2024-012  and B2024-005 from development into master after successful testing.
2024-02-08 11:38:49 -05:00
dc8f2f7561 Merge pull request 'Development' (#219) from Development into master
Merging C2022-009 into master after successful testing.
2024-02-02 13:53:22 -05:00
829dbf84da Merge pull request 'Development' (#217) from Development into master
Merging F2024-005 and B2024-004 from development into master after successful testing
2024-01-31 08:34:00 -05:00
7b156c17f8 Merge pull request 'Development' (#212) from Development into master
Merging all changes up through F2024-006 from development into master after successful testing.
2024-01-24 11:30:40 -05:00
cbf7cbc164 Merge pull request 'Development' (#198) from Development into master
Merging F2024-002 and F2023-112 from development into master.  No testing required since formats are under development.
2024-01-08 15:24:15 -05:00
b04faa816e Merge pull request 'Development' (#196) from Development into master
Merging F2023-126, F2024-001, C2022-009, C2023-024 and C2023-023 from development into Master after successful testing.
2024-01-03 10:54:22 -05:00
517ebe2902 Merge pull request 'Development' (#189) from Development into master
Initial check-in of Vogtle Background formats.  No testing required since formats are under development.
2023-12-15 15:48:55 -05:00
03d0d314e3 Merge pull request 'Development' (#187) from Development into master
Merging B2023-115 from development into master after successful testing.
2023-12-12 15:31:06 -05:00
3e804c5cce Merge pull request 'Development' (#185) from Development into master
Merging F2023-133 into from development into master. No testing required since formats are under development.
2023-12-11 10:08:22 -05:00
ee2b8b538e Merge pull request 'Development' (#183) from Development into master
Merging PROMSFixes from development into master after minor changes to UpdateFormatList.
2023-12-08 14:51:21 -05:00
fdfd34fe92 Merge pull request 'Development' (#181) from Development into master
Merging F2023-151 from development into master.  No testing required since formats are under development.
2023-12-07 15:55:16 -05:00
2d6fb6523b Merge pull request 'Development' (#179) from Development into master
Merging F2023-133 from development into master.  No testing required since formats are under development.
2023-12-07 11:44:31 -05:00
3084bf3982 Merge pull request 'Development' (#177) from Development into master
Merging B2023-115 and F2023-150 from development into master.  No testing required since formats are under development.
2023-12-06 09:08:18 -05:00
5ba51e8392 Merge pull request 'Development' (#174) from Development into master
Merging F2023-149 from development into master.  No testing required since formats are under development.
2023-12-05 16:30:39 -05:00
fb5eb43e34 Merge pull request 'Development' (#172) from Development into master
Merging F2023-124 from development into master.  No testing required since formats are under development.
2023-12-04 11:22:59 -05:00
b154056276 Merge pull request 'Development' (#170) from Development into master
Merging F2023-119 from development into master.  No testing required since formats are under development.
2023-12-01 15:36:22 -05:00
c67b8f9ca1 Merge pull request 'Development' (#168) from Development into master
Merging F2023-146 from development to master.  No testing required since formats are under development.
2023-12-01 10:02:50 -05:00
95e4181360 Merge pull request 'Development' (#166) from Development into master
Merging F2023-148, F2023-148, and B2023-120 from development into Master. No testing required since formats are under development.
2023-11-30 14:38:49 -05:00
32dffbe56b Merge pull request 'Development' (#162) from Development into master
Merging B2023-116, B2023-117, and F2023-143 from development to master after successful testing.
2023-11-29 15:58:44 -05:00
6b3c8d373b Merge pull request 'F2023-143_Vogtle3&4_Alrm_Footer' (#159) from F2023-143_Vogtle3&4_Alrm_Footer into master
Format only change.
Vogtle 3&4 formats under development. This change will be tested as data in entered into PROMS by Volian
2023-11-27 16:23:44 -05:00
db29107f47 Merge pull request 'Development' (#156) from Development into master
Merging F2023-142 and B2022-046 in from development to master after successful testing.
2023-11-14 08:45:47 -05:00
355537f2ab Merge pull request 'Development' (#153) from Development into master
Merging F2023-140, F2023-123, B2023-007, B2023-108, F2023-139, F2023-138 and B2023-103
2023-11-09 10:33:40 -05:00
0729ef0c21 Merge pull request 'Development' (#147) from Development into master
Merging F2023-139 from development into master after successful testing.
2023-10-26 10:10:33 -04:00
6fe82bfd0f Merge pull request 'Development' (#145) from Development into master
Merging F2023-138 from development into master after successful testing.
2023-10-25 14:40:15 -04:00
39bf072363 Merge pull request 'Development' (#142) from Development into master
Merging B2023-103 from development into master after successful testing.
2023-10-23 15:28:31 -04:00
da7c384fd8 Merge pull request 'Development' (#139) from Development into master
Merging C2023-017, C2023-019, B2023-104, B2023-101 and B2023-102 from development into master after successful testing.
2023-10-18 10:37:59 -04:00
95130fd9a0 Merge pull request 'Development' (#133) from Development into master
Merging C2023-018 from development into master after successful testing.
2023-10-11 09:26:45 -04:00
978e2344a3 Merge pull request 'Development' (#131) from Development into master
Merging C2023-016 and C2023-017 from development into master after successful testing.
2023-10-06 10:56:34 -04:00
c9bf45602c Merge pull request 'Development' (#128) from Development into master
Merging F2023-137 and B2023-100 from development into master. F2023-137 does not require testing since formats are under development. B2023-100 tested successfully.
2023-10-02 11:52:22 -04:00
aa160b2036 Merge pull request 'Development' (#124) from Development into master
Merging B2023-099 from development into master after successful testing.
2023-09-28 15:58:27 -04:00
f82b32d351 Merge pull request 'Development' (#122) from Development into master
Merging B2023-097 and B2023-098 from development into master after successful testing.
2023-09-26 14:58:05 -04:00
e519dc9a57 Merge pull request 'Development' (#120) from Development into master
Merging B2023-094 from development into master after successful testing.
2023-09-22 13:24:17 -04:00
f020c37db9 Merge pull request 'Development' (#118) from Development into master
Merged B2023-096 from development into master after successful testing.
2023-09-15 11:50:57 -04:00
5a4ec3b6b1 Merge pull request 'Development' (#117) from Development into master
Merging F2023-135 and B2023-093 from development into master after successful testing.
2023-09-14 15:58:52 -04:00
2602d6c9d2 Merge pull request 'Development' (#113) from Development into master
Merging C2023-015 from development into master.
2023-09-12 09:23:57 -04:00
ff403583d7 Merge pull request 'Development' (#111) from Development into master
Merging B2023-091 and B2023-078 from development into master.
2023-08-30 16:07:17 -04:00
c5577cc2bd Merge pull request 'Development' (#108) from Development into master
Merging F2023-134 from development into master.  No testing required since formats are under development.
2023-08-24 15:01:12 -04:00
78be6e5dc1 Merge pull request 'Development' (#106) from Development into master
Merging GitAutomation from Development into Master.
2023-08-24 09:13:06 -04:00
b954a41375 Merge pull request 'Development' (#104) from Development into master
Merging B2023-089 and F2023-131 from Development into Master.  No testing required since formats are under development.
2023-08-24 09:05:31 -04:00
0100a11cfe Merge pull request 'Development' (#101) from Development into master
Merging F2023-125 from development into master.  No testing required since formats are under development.
2023-08-23 08:19:00 -04:00
04cf2e8534 Merge pull request 'Development' (#99) from Development into master
Merging F2023-130 from Development into Master. No testing required since formats are under development.
2023-08-22 15:04:22 -04:00
be00724818 Merge pull request 'Development' (#97) from Development into master
Merging B2023-088 from development into master.  No testing required since formats are under development.
2023-08-22 10:52:09 -04:00
274d93c61a Merge pull request 'Development' (#94) from Development into master
Merging F2023-122 from development into master.  No testing required since formats are under development.
2023-08-22 08:53:57 -04:00
7dc4c30436 Merge pull request 'Development' (#92) from Development into master
Merging F2023-127 from development into master.  No testing required since formats are under development.
2023-08-22 08:33:56 -04:00
028ef4bc31 Merge pull request 'Development' (#89) from Development into master
Merging F2023-128 and F2023-129 from development into master.  No testing required since formats are under development.
2023-08-21 11:46:01 -04:00
42124d65c7 Merge pull request 'Development' (#87) from Development into master
Merging F2023-118,  F2023-120 and F2023-121 from development into master.  No testing required since formats are under development.
2023-08-16 10:13:52 -04:00
310 changed files with 165264 additions and 162739 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -746,7 +746,6 @@ namespace ROEditor
break; break;
} }
} }
if (inusename == "u") found = true; //to handle unit designation
if (found == false)syntax(inusename+" invalid field name",strt,where); if (found == false)syntax(inusename+" invalid field name",strt,where);
// used to have procini def stuff here. // used to have procini def stuff here.
start=where+1; start=where+1;

View File

@@ -504,6 +504,7 @@ namespace ROEditor
// if a specific RO was passed in. Load the xml tree from it to the root & then // if a specific RO was passed in. Load the xml tree from it to the root & then
// edit it through the ctlXmledit. // edit it through the ctlXmledit.
// from the input tbl string, get a table name. // from the input tbl string, get a table name.
ArrayList levelRecids = new ArrayList(); ArrayList levelRecids = new ArrayList();
int itbl = System.Convert.ToInt32(specificro.Substring(0,4),16); int itbl = System.Convert.ToInt32(specificro.Substring(0,4),16);
string stbl = System.Convert.ToString(itbl,10); string stbl = System.Convert.ToString(itbl,10);
@@ -593,6 +594,7 @@ namespace ROEditor
return; return;
} }
roTreeView.SelectedNode = trnd; roTreeView.SelectedNode = trnd;
} }
protected void roTreeView_AfterSelect (object sender, protected void roTreeView_AfterSelect (object sender,
@@ -674,14 +676,12 @@ namespace ROEditor
//if Ctrl/Shift Key is held down //if Ctrl/Shift Key is held down
if (ROsSelectedforMultiMove == null) if (ROsSelectedforMultiMove == null)
ROsSelectedforMultiMove = new List<TreeNode>(); ROsSelectedforMultiMove = new List<TreeNode>();
// B2021-094 added check that Control and Alt keys were not pressed with shift key
// if user does the <Ctrl><Shift><G> keystroke (Goto selected RO from step editor) if ((Control.ModifierKeys & Keys.Shift) != 0)
// but only lifts up on the G key, it was dropping down into this code below
// and getting a null reference error upon initial entry in to the RO Editor
if ((Control.ModifierKeys & Keys.Shift) != 0 && (Control.ModifierKeys & Keys.Control) == 0 && (Control.ModifierKeys & Keys.Alt) == 0)
{ {
//if shift is held down, clear existing nodes then add the range of nodes //if shift is held down, clear existing nodes then add the range of nodes
roTreeView_ClearAllMultiSelect(); roTreeView_ClearAllMultiSelect();
if (PreviousNode.Index < CurrentNode.Index) if (PreviousNode.Index < CurrentNode.Index)
{ {
//Traverse Down //Traverse Down
@@ -1154,10 +1154,7 @@ namespace ROEditor
tbtnCancel.Enabled = true; tbtnCancel.Enabled = true;
tbtnSave.Enabled = true; tbtnSave.Enabled = true;
tbtnRestore.Enabled = true; tbtnRestore.Enabled = true;
if (newone == null) tbtnSaveAs.Enabled = true;
{ tbtnSaveAs.Enabled = true; }
else
{ tbtnSaveAs.Enabled = false; }
} }
menuROSave.Enabled = tbtnSave.Enabled; menuROSave.Enabled = tbtnSave.Enabled;
} }
@@ -1173,10 +1170,7 @@ namespace ROEditor
tbtnSave.Enabled = true; tbtnSave.Enabled = true;
tbtnRestore.Enabled = true; tbtnRestore.Enabled = true;
if (newone == null) tbtnSaveAs.Enabled = true;
{ tbtnSaveAs.Enabled = true; }
else
{ tbtnSaveAs.Enabled = false; }
tbtnCancel.Enabled = true; tbtnCancel.Enabled = true;
menuROSave.Enabled = tbtnSave.Enabled; menuROSave.Enabled = tbtnSave.Enabled;
//B2021-080 set the mysavexml flag to true to ensure the text change will be saved //B2021-080 set the mysavexml flag to true to ensure the text change will be saved
@@ -2398,26 +2392,20 @@ namespace ROEditor
*/ */
private void menuRODelete_Click(object sender, System.EventArgs e) private void menuRODelete_Click(object sender, System.EventArgs e)
{ {
string msgstr = "It is recommended that you may wish to create a backup zip of your RO folder prior to performing deletions.\n\nAre you sure you wish to delete the selected RO/RO Group?"; bool success=false;
XmlNode nd = (XmlNode) roTreeView.SelectedNode.Tag;
DialogResult AnswerYN = MessageBox.Show(msgstr, "Deleting ROs/RO Group", MessageBoxButtons.YesNo); if (nd.ParentNode.Name == "RO_Root")
if (AnswerYN == DialogResult.Yes) success = myrodb.RODB_DeleteGroup(nd,null,null);
else
success = myrodb.RODB_DeleteRO(nd);
if (success == true)
{ {
bool success = false; // remove from xml tree & the tree control
XmlNode nd = (XmlNode)roTreeView.SelectedNode.Tag; XmlNode parent = nd.ParentNode;
if (nd.ParentNode.Name == "RO_Root") parent.RemoveChild(nd);
success = myrodb.RODB_DeleteGroup(nd, null, null); updateRoListView(roTreeView.SelectedNode.Parent);
else roTreeView.SelectedNode.Remove();
success = myrodb.RODB_DeleteRO(nd); roTreeView.Refresh();
if (success == true)
{
// remove from xml tree & the tree control
XmlNode parent = nd.ParentNode;
parent.RemoveChild(nd);
updateRoListView(roTreeView.SelectedNode.Parent);
roTreeView.SelectedNode.Remove();
roTreeView.Refresh();
}
} }
} }
@@ -2628,6 +2616,7 @@ namespace ROEditor
success = ctlXMLEdit2.SaveData(); success = ctlXMLEdit2.SaveData();
if (!success) if (!success)
{ {
MessageBox.Show("Save Failed");
return false; return false;
} }
VlnXmlElement myro; VlnXmlElement myro;
@@ -2743,6 +2732,7 @@ namespace ROEditor
if (!success) if (!success)
{ {
tbtnRestore.Enabled = false; // old data may not be around tbtnRestore.Enabled = false; // old data may not be around
MessageBox.Show("Save Failed");
return; return;
} }

View File

@@ -324,17 +324,29 @@ namespace ctlXMLEditLib
string ROINI = Directory.GetCurrentDirectory()+ "\\ROAPP.INI"; string ROINI = Directory.GetCurrentDirectory()+ "\\ROAPP.INI";
// Get the default file extension for graphic files // Get the default file extension for graphic files
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention","",5,"ROAPP.INI"); // DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention","",5,"ROAPP.INI");
// Bug fix: B2006-025 // Bug fix: B2006-025
// needed to pass the full path of ROAPP.INI // needed to pass the full path of ROAPP.INI
// B2025-007 only use the default file location (remove 16 bit PROMS location)
IniReader in1 = new IniReader(ROINI); IniReader in1 = new IniReader(ROINI);
DefaultGraphicFileExtension = in1.ReadString("ROApp", "Extention"); DefaultGraphicFileExtension = in1.ReadString("ROApp","Extention","");
if (string.IsNullOrEmpty(DefaultGraphicFileExtension)) DefaultGraphicFileExtension = in1.ReadString("ROApp", "Extension", ".TIF"); if (DefaultGraphicFileExtension.Equals(""))
// if (File.Exists(PromsINI)) {
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI); string ApplPathUp = ApplicationPath.ToUpper();
// if (File.Exists("ROAPP.INI")) int idx = ApplPathUp.IndexOf("VE-PROMS.NET\\BIN");
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention",".TIF",5,"ROAPP.INI"); if (idx >= 0)
{
string PromsINI = ApplicationPath.Substring(0, idx);
PromsINI += "VE-PROMS\\VEPROMS.INI";
IniReader in2 = new IniReader(PromsINI);
DefaultGraphicFileExtension = in2.ReadString("Graphics", "defaultext", ".TIF");
}
else
DefaultGraphicFileExtension = ".TIF";
}
// if (File.Exists(PromsINI))
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI);
// if (File.Exists("ROAPP.INI"))
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention",".TIF",5,"ROAPP.INI");
if (!DefaultGraphicFileExtension.StartsWith(".")) if (!DefaultGraphicFileExtension.StartsWith("."))
DefaultGraphicFileExtension = "." + DefaultGraphicFileExtension; DefaultGraphicFileExtension = "." + DefaultGraphicFileExtension;
@@ -772,7 +784,6 @@ namespace ctlXMLEditLib
dosaveflag = false; dosaveflag = false;
return (true); return (true);
} }
MessageBox.Show("Save Failed");
return (false); return (false);
} }
@@ -1118,7 +1129,7 @@ namespace ctlXMLEditLib
mylabel.BackColor = chlbckcolor; // PC Applic fields are shaded blue otherwise backcolor is transparent mylabel.BackColor = chlbckcolor; // PC Applic fields are shaded blue otherwise backcolor is transparent
mylabel.Location = new Point(screenx+indent, screeny); mylabel.Location = new Point(screenx+indent, screeny);
mylabel.Name = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName); mylabel.Name = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName);
mylabel.Text = (applicLabel.Length > 0) ? applicLabel : CvtFldToUserFld(element.Name).Replace("Image_",""); // C2021-026 applicLabel is the P/C Child name mylabel.Text = (applicLabel.Length > 0) ? applicLabel : CvtFldToUserFld(element.Name); // C2021-026 applicLabel is the P/C Child name
mylabel.AutoSize = true; mylabel.AutoSize = true;
Controls.Add(mylabel); Controls.Add(mylabel);
// add 3 onto screeny so that textbox is slightly below label. // add 3 onto screeny so that textbox is slightly below label.
@@ -1475,13 +1486,10 @@ namespace ctlXMLEditLib
FileInfo ifi = new FileInfo(fnamebox.Text); FileInfo ifi = new FileInfo(fnamebox.Text);
if (ifi.Exists == false) if (ifi.Exists == false)
{ {
FileInfo ifi2 = new FileInfo(fnamebox.Text + DefaultGraphicFileExtension); MessageBoxButtons buttons = MessageBoxButtons.OK;
if (!ifi2.Exists) MessageBox.Show( "File does not exist.",
{ "File Input Error", buttons);
MessageBox.Show("File does not exist.", return;
"File Input Error", MessageBoxButtons.OK);
return;
}
} }
bool ok = ValidGraphicsFile(fnamebox.Text); bool ok = ValidGraphicsFile(fnamebox.Text);
if (ok != true) if (ok != true)
@@ -1688,7 +1696,7 @@ namespace ctlXMLEditLib
} }
catch (Exception ee) catch (Exception ee)
{ {
MessageBox.Show("The Height and Width cannot be empty fields. Enter a number in either field and the other will automatically adjust to a proportional size.", "Invalid Height Input"); MessageBox.Show("Invalid Height Input",ee.ToString());
} }
} }
} }
@@ -1705,7 +1713,7 @@ namespace ctlXMLEditLib
} }
catch (Exception ee) catch (Exception ee)
{ {
MessageBox.Show("The Height and Width cannot be empty fields. Enter a number in either field and the other will automatically adjust to a proportional size.", "Invalid Width Input"); MessageBox.Show("Invalid Width Input", ee.ToString());
} }
} }
} }

View File

@@ -328,18 +328,6 @@ namespace VEPROMS.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool cbShwRplWrdsColor {
get {
return ((bool)(this["cbShwRplWrdsColor"]));
}
set {
this["cbShwRplWrdsColor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")] [global::System.Configuration.DefaultSettingValueAttribute("False")]

View File

@@ -80,11 +80,6 @@
<Setting Name="UpdateSettings" Type="System.Boolean" Scope="User"> <Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="cbShwRplWrdsColor" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="PasteNoReturns" Type="System.Boolean" Scope="User"> <Setting Name="PasteNoReturns" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
@@ -8,6 +10,7 @@ using System.IO;
using Volian.Controls.Library; using Volian.Controls.Library;
using DevComponents.DotNetBar; using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms; using JR.Utils.GUI.Forms;
using Volian.Controls.Library;
using System.Linq; using System.Linq;
namespace VEPROMS namespace VEPROMS
@@ -175,8 +178,6 @@ namespace VEPROMS
myDocVersions.Clear(); myDocVersions.Clear();
FolderInfo fi = FolderInfo.GetTop(); FolderInfo fi = FolderInfo.GetTop();
fi.RefreshChildFolders();
if (fi.ChildFolderCount > 0) if (fi.ChildFolderCount > 0)
{ {
TreeNode tn = new TreeNode(fi.Name); TreeNode tn = new TreeNode(fi.Name);
@@ -232,7 +233,7 @@ namespace VEPROMS
loadedWorkingDraft = true; loadedWorkingDraft = true;
} }
if (tn.Parent != null && !loadedWorkingDraft && fi.FolderDocVersionCount == 0) if (tn.Parent != null && !loadedWorkingDraft)
{ {
tn.Remove(); tn.Remove();
} }
@@ -339,8 +340,6 @@ namespace VEPROMS
pbProcess.PerformStep(); pbProcess.PerformStep();
Application.DoEvents(); Application.DoEvents();
} }
ClearCache();
} }
Application.DoEvents(); Application.DoEvents();
@@ -388,23 +387,6 @@ namespace VEPROMS
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
} }
//C2025-011 RO Update Admin Tool Memory Enhancements
//Clear what we can from the cache
//runs after each section
private void ClearCache()
{
txtProcess.AppendText("Reclaiming memory used during previous sections.");
PartInfo.ClearPartInfoCache();
ItemInfo.ClearItemInfoCache();
Item.ClearItemCache();
ContentInfo.ClearContentInfoCache();
GridInfo.ClearGridInfoCache();
GC.Collect();
GC.WaitForPendingFinalizers();
}
//C2022-028 check for Bad RO Links - we will check all of the RO links found in procedure step text //C2022-028 check for Bad RO Links - we will check all of the RO links found in procedure step text
//B2022-144 Allow to check individual procedures for bad RO links //B2022-144 Allow to check individual procedures for bad RO links
private void CheckROLinks() private void CheckROLinks()
@@ -499,14 +481,12 @@ namespace VEPROMS
// B2018-002 - Invalid Transitions - Define Transition Refresh Statistics // B2018-002 - Invalid Transitions - Define Transition Refresh Statistics
private int numTransProcessed = 0; private int numTransProcessed = 0;
private int numTransFixed = 0; private int numTransFixed = 0;
private int numTransCantFix = 0;
private int numTransConverted = 0; private int numTransConverted = 0;
// B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics // B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics
private void ResetTransNumbers() private void ResetTransNumbers()
{ {
numTransProcessed = 0; numTransProcessed = 0;
numTransFixed = 0; numTransFixed = 0;
numTransCantFix = 0;
numTransConverted = 0; numTransConverted = 0;
} }
private void RefreshTransitions() private void RefreshTransitions()
@@ -555,12 +535,11 @@ namespace VEPROMS
numTransConverted += ProcedureInfo.TranConvertCount; numTransConverted += ProcedureInfo.TranConvertCount;
numTransProcessed += ProcedureInfo.TranCheckCount; numTransProcessed += ProcedureInfo.TranCheckCount;
numTransFixed += ProcedureInfo.TranFixCount; numTransFixed += ProcedureInfo.TranFixCount;
numTransCantFix += ProcedureInfo.TranCantFixCount; //Bad Transition Link
pbProcess.PerformStep(); pbProcess.PerformStep();
Application.DoEvents(); Application.DoEvents();
} }
} }
if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0) if (numTransFixed == 0 && numTransConverted == 0)
{ {
txtResults.AppendText("No Transitions Needed Updated."); txtResults.AppendText("No Transitions Needed Updated.");
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
@@ -572,18 +551,16 @@ namespace VEPROMS
txtProcess.AppendText(string.Format("Transitions Checked: {0}", numTransProcessed)); txtProcess.AppendText(string.Format("Transitions Checked: {0}", numTransProcessed));
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistics // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics
txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed + numTransCantFix))); txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed)));
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed)); txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed));
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Transitions Converted to text: {0}", numTransConverted)); txtProcess.AppendText(string.Format("Transitions Converted to text: {0}", numTransConverted));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Transitions Unable to be Automatically Fixed (Annotation: Bad Transition Link): {0}", numTransCantFix));
Application.DoEvents(); Application.DoEvents();
if (pil.Count > 0) if (pil.Count > 0)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.AppendLine("The batch refresh process was not successful for all procedures selected."); sb.AppendLine("The batch refresh process was not usccessful for all procedures selected.");
sb.AppendLine("The following procedures were not able to be refreshed..."); sb.AppendLine("The following procedures were not able to be refreshed...");
sb.AppendLine(); sb.AppendLine();
sb.AppendLine(sbProcs.ToString()); sb.AppendLine(sbProcs.ToString());
@@ -602,11 +579,11 @@ namespace VEPROMS
} }
} }
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistic // B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic
if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0) if (numTransFixed == 0 && numTransConverted == 0)
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed"); MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
else else
MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.\n\n {4} Transitions unable to be automatically fixed (Annotation: Bad Transition Link).", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted + numTransCantFix), numTransFixed, numTransConverted, numTransCantFix), "Refresh Transitions Completed"); MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted), numTransFixed, numTransConverted), "Refresh Transitions Completed");
} }
// C2017-030 - new Admin Tools user interface // C2017-030 - new Admin Tools user interface
@@ -1018,9 +995,6 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
} }
//C2025-011 RO Update Admin Tool Memory Enhancements
//clear the list since no longer using it
myItems.Clear();
DateTime pEnd = DateTime.Now; DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm"))); txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(Environment.NewLine);
@@ -1107,7 +1081,6 @@ namespace VEPROMS
} }
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess); ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
//ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
} }
@@ -1130,7 +1103,8 @@ namespace VEPROMS
ProcedureInfo.RefreshTransitions(pq);//, transitionsToDisconnected, transitionsToNonEditable); ProcedureInfo.RefreshTransitions(pq);//, transitionsToDisconnected, transitionsToNonEditable);
TimeSpan ts = DateTime.Now - start; TimeSpan ts = DateTime.Now - start;
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistics // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics
txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Converted to Text {4} Transitions{0}Cant Fix (Annotation: Bad Transition Link) {5} Transitions{0}Elapsed Seconds:{6}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ProcedureInfo.TranCantFixCount, ts.TotalSeconds)); txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Converted to Text {4} Transitions{0}Elapsed Seconds:{5}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds));
//Console.WriteLine("\"{0}\"\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds, numTransProcessed, numTransFixed, numTransConverted);
if (myFixes.Length > 0) if (myFixes.Length > 0)
{ {
txtResults.AppendText(myFixes.ToString()); txtResults.AppendText(myFixes.ToString());
@@ -1996,20 +1970,7 @@ namespace VEPROMS
pil.Add(myProcedures[tn]); pil.Add(myProcedures[tn]);
return pil; return pil;
} }
}
//C2025-011 RO Update Admin Tool Memory Enhancements
private void txtProcess_TextChanged(object sender, EventArgs e)
{
//clears the stack to help with memory - should never need to undo text changes to this.
txtProcess.ClearUndo();
}
private void txtResults_TextChanged(object sender, EventArgs e)
{
//clears the stack to help with memory - should never need to undo text changes to this.
txtResults.ClearUndo();
}
}
} }

View File

@@ -183,19 +183,19 @@ It is recommended that this be done during off hours.
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="warningBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ 8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY 2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
ud8AKwnMnBpmYFAAAAAASUVORK5CYII= zJwL4b/EAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="swUpdateROVals.SuperTooltip" xml:space="preserve"> <data name="swUpdateROVals.SuperTooltip" xml:space="preserve">
@@ -230,36 +230,36 @@ If more than one procedure is selected, it is recommended that this be performed
</data> </data>
<data name="warningBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="warningBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ 8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY 2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
ud8AKwnMnBpmYFAAAAAASUVORK5CYII= zJwL4b/EAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ 8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY 2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
ud8AKwnMnBpmYFAAAAAASUVORK5CYII= zJwL4b/EAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="swCkObsoleteROData.SuperTooltip" xml:space="preserve"> <data name="swCkObsoleteROData.SuperTooltip" xml:space="preserve">
@@ -324,36 +324,36 @@ This function will remove all of the saved attachment PDFS stored in the databas
</data> </data>
<data name="warningBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="warningBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ 8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY 2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
ud8AKwnMnBpmYFAAAAAASUVORK5CYII= zJwL4b/EAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="warningBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="warningBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ 8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY 2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
ud8AKwnMnBpmYFAAAAAASUVORK5CYII= zJwL4b/EAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="swRmObsoleteROData.SuperTooltip" xml:space="preserve"> <data name="swRmObsoleteROData.SuperTooltip" xml:space="preserve">

View File

@@ -88,12 +88,6 @@ namespace VEPROMS
this.btnFormat = new DevComponents.DotNetBar.ButtonX(); this.btnFormat = new DevComponents.DotNetBar.ButtonX();
this.btnGeneral = new DevComponents.DotNetBar.ButtonX(); this.btnGeneral = new DevComponents.DotNetBar.ButtonX();
this.tcSectionProp = new DevComponents.DotNetBar.TabControl(); this.tcSectionProp = new DevComponents.DotNetBar.TabControl();
this.tcpFormat = new DevComponents.DotNetBar.TabControlPanel();
this.ppCbShowRplWords = new System.Windows.Forms.CheckBox();
this.rbWordSect = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.rbStepSect = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.ppGpbxSignoffCheckoff = new DevComponents.DotNetBar.Controls.GroupPanel();
this.tiFormat = new DevComponents.DotNetBar.TabItem(this.components);
this.tcpGeneral = new DevComponents.DotNetBar.TabControlPanel(); this.tcpGeneral = new DevComponents.DotNetBar.TabControlPanel();
this.ppCbAutoIndent = new System.Windows.Forms.CheckBox(); this.ppCbAutoIndent = new System.Windows.Forms.CheckBox();
this.ppCbEditableData = new System.Windows.Forms.CheckBox(); this.ppCbEditableData = new System.Windows.Forms.CheckBox();
@@ -101,6 +95,11 @@ namespace VEPROMS
this.ppSectNumberStpRTB = new Volian.Controls.Library.StepRTB(this.components); this.ppSectNumberStpRTB = new Volian.Controls.Library.StepRTB(this.components);
this.ppSectTitleStpRTB = new Volian.Controls.Library.StepRTB(this.components); this.ppSectTitleStpRTB = new Volian.Controls.Library.StepRTB(this.components);
this.tiGeneral = new DevComponents.DotNetBar.TabItem(this.components); this.tiGeneral = new DevComponents.DotNetBar.TabItem(this.components);
this.tcpFormat = new DevComponents.DotNetBar.TabControlPanel();
this.rbWordSect = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.rbStepSect = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.ppGpbxSignoffCheckoff = new DevComponents.DotNetBar.Controls.GroupPanel();
this.tiFormat = new DevComponents.DotNetBar.TabItem(this.components);
this.tcpAutomation = new DevComponents.DotNetBar.TabControlPanel(); this.tcpAutomation = new DevComponents.DotNetBar.TabControlPanel();
this.ppCbNoDuplexFoldout = new System.Windows.Forms.CheckBox(); this.ppCbNoDuplexFoldout = new System.Windows.Forms.CheckBox();
this.gpTOC = new DevComponents.DotNetBar.Controls.GroupPanel(); this.gpTOC = new DevComponents.DotNetBar.Controls.GroupPanel();
@@ -121,9 +120,9 @@ namespace VEPROMS
this.panSectBtns.SuspendLayout(); this.panSectBtns.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tcSectionProp)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tcSectionProp)).BeginInit();
this.tcSectionProp.SuspendLayout(); this.tcSectionProp.SuspendLayout();
this.tcpGeneral.SuspendLayout();
this.tcpFormat.SuspendLayout(); this.tcpFormat.SuspendLayout();
this.ppGpbxSignoffCheckoff.SuspendLayout(); this.ppGpbxSignoffCheckoff.SuspendLayout();
this.tcpGeneral.SuspendLayout();
this.tcpAutomation.SuspendLayout(); this.tcpAutomation.SuspendLayout();
this.gpTOC.SuspendLayout(); this.gpTOC.SuspendLayout();
this.grpLnkEnh.SuspendLayout(); this.grpLnkEnh.SuspendLayout();
@@ -872,8 +871,8 @@ namespace VEPROMS
this.tcSectionProp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tcSectionProp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.tcSectionProp.BackColor = System.Drawing.Color.Transparent; this.tcSectionProp.BackColor = System.Drawing.Color.Transparent;
this.tcSectionProp.CanReorderTabs = true; this.tcSectionProp.CanReorderTabs = true;
this.tcSectionProp.Controls.Add(this.tcpFormat);
this.tcSectionProp.Controls.Add(this.tcpGeneral); this.tcSectionProp.Controls.Add(this.tcpGeneral);
this.tcSectionProp.Controls.Add(this.tcpFormat);
this.tcSectionProp.Controls.Add(this.tcpAutomation); this.tcSectionProp.Controls.Add(this.tcpAutomation);
this.tcSectionProp.Controls.Add(this.tcpLibDoc); this.tcSectionProp.Controls.Add(this.tcpLibDoc);
this.tcSectionProp.Controls.Add(this.tabControlPanel4); this.tcSectionProp.Controls.Add(this.tabControlPanel4);
@@ -893,151 +892,6 @@ namespace VEPROMS
this.tcSectionProp.TabsVisible = false; this.tcSectionProp.TabsVisible = false;
this.tcSectionProp.Text = "tabControl2"; this.tcSectionProp.Text = "tabControl2";
// //
// tcpFormat
//
this.tcpFormat.Controls.Add(this.ppCbShowRplWords);
this.tcpFormat.Controls.Add(this.cbIsFoldoutSection);
this.tcpFormat.Controls.Add(this.ppCbDefaultStepSection);
this.tcpFormat.Controls.Add(this.cbKeepWordDocMargins);
this.tcpFormat.Controls.Add(this.ppLblDefaultNumColumns);
this.tcpFormat.Controls.Add(this.ppLblDefPaginationStyle);
this.tcpFormat.Controls.Add(this.ppBtnDefaultNumColumns);
this.tcpFormat.Controls.Add(this.ppBtnDefaultPaginationStyle);
this.tcpFormat.Controls.Add(this.rbWordSect);
this.tcpFormat.Controls.Add(this.rbStepSect);
this.tcpFormat.Controls.Add(this.ppGpbxSignoffCheckoff);
this.tcpFormat.Controls.Add(this.lblFormat);
this.tcpFormat.Controls.Add(this.ppCmbxNumColumns);
this.tcpFormat.Controls.Add(this.lblColumns);
this.tcpFormat.Controls.Add(this.ppCmbxSectPagination);
this.tcpFormat.Controls.Add(this.lblSectType);
this.tcpFormat.Controls.Add(this.ppCmbxStyleSectionType);
this.tcpFormat.Controls.Add(this.lblPagination);
this.tcpFormat.Controls.Add(this.ppBtnDefaultFmt);
this.tcpFormat.Controls.Add(this.ppCmbxFormat);
this.tcpFormat.Controls.Add(this.ppLblFormatDefault);
this.tcpFormat.DisabledBackColor = System.Drawing.Color.Empty;
this.tcpFormat.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcpFormat.Location = new System.Drawing.Point(0, 22);
this.tcpFormat.Margin = new System.Windows.Forms.Padding(2);
this.tcpFormat.Name = "tcpFormat";
this.tcpFormat.Padding = new System.Windows.Forms.Padding(1);
this.tcpFormat.Size = new System.Drawing.Size(557, 318);
this.tcpFormat.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254)))));
this.tcpFormat.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227)))));
this.tcpFormat.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.tcpFormat.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199)))));
this.tcpFormat.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
| DevComponents.DotNetBar.eBorderSide.Bottom)));
this.tcpFormat.Style.GradientAngle = 90;
this.tcpFormat.TabIndex = 2;
this.tcpFormat.TabItem = this.tiFormat;
this.tcpFormat.Enter += new System.EventHandler(this.tabpage_Enter);
//
// ppCbShowRplWords
//
this.ppCbShowRplWords.AutoSize = true;
this.ppCbShowRplWords.BackColor = System.Drawing.Color.Transparent;
this.ppCbShowRplWords.Location = new System.Drawing.Point(272, 252);
this.ppCbShowRplWords.Name = "ppCbShowRplWords";
this.ppCbShowRplWords.Size = new System.Drawing.Size(130, 17);
this.ppCbShowRplWords.TabIndex = 62;
this.ppCbShowRplWords.Text = "Show Replace Words";
this.ppCbShowRplWords.UseVisualStyleBackColor = false;
this.ppCbShowRplWords.CheckedChanged += new System.EventHandler(this.ppCbShowRplWords_CheckedChanged);
//
// rbWordSect
//
this.rbWordSect.BackColor = System.Drawing.Color.Transparent;
//
//
//
this.rbWordSect.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.rbWordSect.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton;
this.rbWordSect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rbWordSect.Location = new System.Drawing.Point(247, 60);
this.rbWordSect.Margin = new System.Windows.Forms.Padding(2);
this.rbWordSect.Name = "rbWordSect";
this.rbWordSect.Size = new System.Drawing.Size(88, 19);
this.rbWordSect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.rbWordSect.TabIndex = 23;
this.rbWordSect.TabStop = false;
this.rbWordSect.Text = "Word Section";
//
// rbStepSect
//
this.rbStepSect.BackColor = System.Drawing.Color.Transparent;
//
//
//
this.rbStepSect.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.rbStepSect.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton;
this.rbStepSect.Checked = true;
this.rbStepSect.CheckState = System.Windows.Forms.CheckState.Checked;
this.rbStepSect.CheckValue = "Y";
this.rbStepSect.FocusCuesEnabled = false;
this.rbStepSect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rbStepSect.Location = new System.Drawing.Point(138, 60);
this.rbStepSect.Margin = new System.Windows.Forms.Padding(2);
this.rbStepSect.Name = "rbStepSect";
this.rbStepSect.Size = new System.Drawing.Size(86, 19);
this.rbStepSect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.rbStepSect.TabIndex = 22;
this.rbStepSect.TabStop = false;
this.rbStepSect.Text = "Step Section";
this.rbStepSect.CheckedChanged += new System.EventHandler(this.rbStepSect_CheckedChanged);
//
// ppGpbxSignoffCheckoff
//
this.ppGpbxSignoffCheckoff.BackColor = System.Drawing.Color.Transparent;
this.ppGpbxSignoffCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
this.ppGpbxSignoffCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.ppGpbxSignoffCheckoff.Controls.Add(this.ppCmbxCheckoffHeading);
this.ppGpbxSignoffCheckoff.Controls.Add(this.lblCheckoffType);
this.ppGpbxSignoffCheckoff.Controls.Add(this.ppCmbxCheckoffType);
this.ppGpbxSignoffCheckoff.Controls.Add(this.lblCheckoffHeading);
this.ppGpbxSignoffCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.ppGpbxSignoffCheckoff.Location = new System.Drawing.Point(272, 123);
this.ppGpbxSignoffCheckoff.Margin = new System.Windows.Forms.Padding(2);
this.ppGpbxSignoffCheckoff.Name = "ppGpbxSignoffCheckoff";
this.ppGpbxSignoffCheckoff.Size = new System.Drawing.Size(206, 117);
//
//
//
this.ppGpbxSignoffCheckoff.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.ppGpbxSignoffCheckoff.Style.BackColorGradientAngle = 90;
this.ppGpbxSignoffCheckoff.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.ppGpbxSignoffCheckoff.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderBottomWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.ppGpbxSignoffCheckoff.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderLeftWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderRightWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderTopWidth = 1;
this.ppGpbxSignoffCheckoff.Style.CornerDiameter = 4;
this.ppGpbxSignoffCheckoff.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.ppGpbxSignoffCheckoff.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.ppGpbxSignoffCheckoff.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.ppGpbxSignoffCheckoff.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
//
//
//
this.ppGpbxSignoffCheckoff.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
//
//
this.ppGpbxSignoffCheckoff.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.ppGpbxSignoffCheckoff.TabIndex = 51;
this.ppGpbxSignoffCheckoff.Text = "Signoffs / Checkoffs";
//
// tiFormat
//
this.tiFormat.AttachedControl = this.tcpFormat;
this.tiFormat.Name = "tiFormat";
this.tiFormat.Text = "Format";
//
// tcpGeneral // tcpGeneral
// //
this.tcpGeneral.Controls.Add(this.ppCbAutoIndent); this.tcpGeneral.Controls.Add(this.ppCbAutoIndent);
@@ -1192,6 +1046,138 @@ namespace VEPROMS
this.tiGeneral.Name = "tiGeneral"; this.tiGeneral.Name = "tiGeneral";
this.tiGeneral.Text = "General"; this.tiGeneral.Text = "General";
// //
// tcpFormat
//
this.tcpFormat.Controls.Add(this.cbIsFoldoutSection);
this.tcpFormat.Controls.Add(this.ppCbDefaultStepSection);
this.tcpFormat.Controls.Add(this.cbKeepWordDocMargins);
this.tcpFormat.Controls.Add(this.ppLblDefaultNumColumns);
this.tcpFormat.Controls.Add(this.ppLblDefPaginationStyle);
this.tcpFormat.Controls.Add(this.ppBtnDefaultNumColumns);
this.tcpFormat.Controls.Add(this.ppBtnDefaultPaginationStyle);
this.tcpFormat.Controls.Add(this.rbWordSect);
this.tcpFormat.Controls.Add(this.rbStepSect);
this.tcpFormat.Controls.Add(this.ppGpbxSignoffCheckoff);
this.tcpFormat.Controls.Add(this.lblFormat);
this.tcpFormat.Controls.Add(this.ppCmbxNumColumns);
this.tcpFormat.Controls.Add(this.lblColumns);
this.tcpFormat.Controls.Add(this.ppCmbxSectPagination);
this.tcpFormat.Controls.Add(this.lblSectType);
this.tcpFormat.Controls.Add(this.ppCmbxStyleSectionType);
this.tcpFormat.Controls.Add(this.lblPagination);
this.tcpFormat.Controls.Add(this.ppBtnDefaultFmt);
this.tcpFormat.Controls.Add(this.ppCmbxFormat);
this.tcpFormat.Controls.Add(this.ppLblFormatDefault);
this.tcpFormat.DisabledBackColor = System.Drawing.Color.Empty;
this.tcpFormat.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcpFormat.Location = new System.Drawing.Point(0, 22);
this.tcpFormat.Margin = new System.Windows.Forms.Padding(2);
this.tcpFormat.Name = "tcpFormat";
this.tcpFormat.Padding = new System.Windows.Forms.Padding(1);
this.tcpFormat.Size = new System.Drawing.Size(557, 318);
this.tcpFormat.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254)))));
this.tcpFormat.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227)))));
this.tcpFormat.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.tcpFormat.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199)))));
this.tcpFormat.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
| DevComponents.DotNetBar.eBorderSide.Bottom)));
this.tcpFormat.Style.GradientAngle = 90;
this.tcpFormat.TabIndex = 2;
this.tcpFormat.TabItem = this.tiFormat;
this.tcpFormat.Enter += new System.EventHandler(this.tabpage_Enter);
//
// rbWordSect
//
this.rbWordSect.BackColor = System.Drawing.Color.Transparent;
//
//
//
this.rbWordSect.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.rbWordSect.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton;
this.rbWordSect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rbWordSect.Location = new System.Drawing.Point(247, 60);
this.rbWordSect.Margin = new System.Windows.Forms.Padding(2);
this.rbWordSect.Name = "rbWordSect";
this.rbWordSect.Size = new System.Drawing.Size(88, 19);
this.rbWordSect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.rbWordSect.TabIndex = 23;
this.rbWordSect.TabStop = false;
this.rbWordSect.Text = "Word Section";
//
// rbStepSect
//
this.rbStepSect.BackColor = System.Drawing.Color.Transparent;
//
//
//
this.rbStepSect.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.rbStepSect.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton;
this.rbStepSect.Checked = true;
this.rbStepSect.CheckState = System.Windows.Forms.CheckState.Checked;
this.rbStepSect.CheckValue = "Y";
this.rbStepSect.FocusCuesEnabled = false;
this.rbStepSect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rbStepSect.Location = new System.Drawing.Point(138, 60);
this.rbStepSect.Margin = new System.Windows.Forms.Padding(2);
this.rbStepSect.Name = "rbStepSect";
this.rbStepSect.Size = new System.Drawing.Size(86, 19);
this.rbStepSect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.rbStepSect.TabIndex = 22;
this.rbStepSect.TabStop = false;
this.rbStepSect.Text = "Step Section";
this.rbStepSect.CheckedChanged += new System.EventHandler(this.rbStepSect_CheckedChanged);
//
// ppGpbxSignoffCheckoff
//
this.ppGpbxSignoffCheckoff.BackColor = System.Drawing.Color.Transparent;
this.ppGpbxSignoffCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
this.ppGpbxSignoffCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.ppGpbxSignoffCheckoff.Controls.Add(this.ppCmbxCheckoffHeading);
this.ppGpbxSignoffCheckoff.Controls.Add(this.lblCheckoffType);
this.ppGpbxSignoffCheckoff.Controls.Add(this.ppCmbxCheckoffType);
this.ppGpbxSignoffCheckoff.Controls.Add(this.lblCheckoffHeading);
this.ppGpbxSignoffCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.ppGpbxSignoffCheckoff.Location = new System.Drawing.Point(272, 123);
this.ppGpbxSignoffCheckoff.Margin = new System.Windows.Forms.Padding(2);
this.ppGpbxSignoffCheckoff.Name = "ppGpbxSignoffCheckoff";
this.ppGpbxSignoffCheckoff.Size = new System.Drawing.Size(206, 117);
//
//
//
this.ppGpbxSignoffCheckoff.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.ppGpbxSignoffCheckoff.Style.BackColorGradientAngle = 90;
this.ppGpbxSignoffCheckoff.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.ppGpbxSignoffCheckoff.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderBottomWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.ppGpbxSignoffCheckoff.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderLeftWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderRightWidth = 1;
this.ppGpbxSignoffCheckoff.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.ppGpbxSignoffCheckoff.Style.BorderTopWidth = 1;
this.ppGpbxSignoffCheckoff.Style.CornerDiameter = 4;
this.ppGpbxSignoffCheckoff.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.ppGpbxSignoffCheckoff.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.ppGpbxSignoffCheckoff.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.ppGpbxSignoffCheckoff.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
//
//
//
this.ppGpbxSignoffCheckoff.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
//
//
this.ppGpbxSignoffCheckoff.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.ppGpbxSignoffCheckoff.TabIndex = 51;
this.ppGpbxSignoffCheckoff.Text = "Signoffs / Checkoffs";
//
// tiFormat
//
this.tiFormat.AttachedControl = this.tcpFormat;
this.tiFormat.Name = "tiFormat";
this.tiFormat.Text = "Format";
//
// tcpAutomation // tcpAutomation
// //
this.tcpAutomation.Controls.Add(this.ppCbNoDuplexFoldout); this.tcpAutomation.Controls.Add(this.ppCbNoDuplexFoldout);
@@ -1479,7 +1465,7 @@ namespace VEPROMS
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CaptionFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.CaptionFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ClientSize = new System.Drawing.Size(722, 390); this.ClientSize = new System.Drawing.Size(730, 398);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.tcSectionProp); this.Controls.Add(this.tcSectionProp);
this.Controls.Add(this.panSectBtns); this.Controls.Add(this.panSectBtns);
@@ -1503,12 +1489,12 @@ namespace VEPROMS
this.panSectBtns.ResumeLayout(false); this.panSectBtns.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.tcSectionProp)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tcSectionProp)).EndInit();
this.tcSectionProp.ResumeLayout(false); this.tcSectionProp.ResumeLayout(false);
this.tcpGeneral.ResumeLayout(false);
this.tcpGeneral.PerformLayout();
this.tcpFormat.ResumeLayout(false); this.tcpFormat.ResumeLayout(false);
this.tcpFormat.PerformLayout(); this.tcpFormat.PerformLayout();
this.ppGpbxSignoffCheckoff.ResumeLayout(false); this.ppGpbxSignoffCheckoff.ResumeLayout(false);
this.ppGpbxSignoffCheckoff.PerformLayout(); this.ppGpbxSignoffCheckoff.PerformLayout();
this.tcpGeneral.ResumeLayout(false);
this.tcpGeneral.PerformLayout();
this.tcpAutomation.ResumeLayout(false); this.tcpAutomation.ResumeLayout(false);
this.tcpAutomation.PerformLayout(); this.tcpAutomation.PerformLayout();
this.gpTOC.ResumeLayout(false); this.gpTOC.ResumeLayout(false);
@@ -1612,6 +1598,5 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonX ppBtnConvertToDocX; private DevComponents.DotNetBar.ButtonX ppBtnConvertToDocX;
private System.Windows.Forms.CheckBox cbIsFoldoutSection; private System.Windows.Forms.CheckBox cbIsFoldoutSection;
private System.Windows.Forms.CheckBox ppCbNoDuplexFoldout; private System.Windows.Forms.CheckBox ppCbNoDuplexFoldout;
private System.Windows.Forms.CheckBox ppCbShowRplWords; }
}
} }

View File

@@ -523,23 +523,6 @@ namespace VEPROMS
else else
ppCbDefaultStepSection.Text = "Make this the Default Step Section"; ppCbDefaultStepSection.Text = "Make this the Default Step Section";
} }
// Show Replace Words
ppCbShowRplWords.Visible = false;
if (_isStepSection && _SectionConfig.MySection.MySectionInfo.MyActiveParent.IsProcedure)
{
ppCbShowRplWords.Visible = true;
ppCbShowRplWords.Checked = _SectionConfig.Section_ShwRplWords == "Y";
// Use checkbox text to clarify what is case for this section, i.e. is it already
// the default or can it be set. Note that this is used when printing of page numbers
// that use the 'WithSteps' numbering sequence.
if (_SectionConfig.Section_OriginalSteps == "Y")
{
ppCbShowRplWords.Text = "Show Replace Words"; // C2020-021 add the word "the"
_isDefaultStepSection = true;
}
else
ppCbShowRplWords.Text = "Show Replace Words";
}
// if the parent has enhanced documents (and is not an enhanced document, i.e. the test // if the parent has enhanced documents (and is not an enhanced document, i.e. the test
// ed.Type != 0 proves that) put up the group panel on the automation tab that allows for setting of // ed.Type != 0 proves that) put up the group panel on the automation tab that allows for setting of
@@ -1228,7 +1211,6 @@ namespace VEPROMS
ppGpbxSignoffCheckoff.Visible = _isStepSection; ppGpbxSignoffCheckoff.Visible = _isStepSection;
cbKeepWordDocMargins.Visible = !_isStepSection; cbKeepWordDocMargins.Visible = !_isStepSection;
ppCbDefaultStepSection.Visible = _isStepSection; ppCbDefaultStepSection.Visible = _isStepSection;
ppCbShowRplWords.Visible = _isStepSection;
} }
private void rbStepSect_CheckedChanged(object sender, EventArgs e) private void rbStepSect_CheckedChanged(object sender, EventArgs e)
@@ -1398,8 +1380,7 @@ namespace VEPROMS
_SectionConfig.Section_OriginalSteps = ppCbDefaultStepSection.Checked ? "Y" : "N"; _SectionConfig.Section_OriginalSteps = ppCbDefaultStepSection.Checked ? "Y" : "N";
} }
} }
private void ppBtnConvertToDocX_Click(object sender, EventArgs e)
private void ppBtnConvertToDocX_Click(object sender, EventArgs e)
{ {
// Get Document as file // Get Document as file
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID); ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
@@ -1466,14 +1447,6 @@ namespace VEPROMS
{ {
_SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked; _SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked;
} }
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
private void ppCbShowRplWords_CheckedChanged(object sender, EventArgs e)
{
if (!_Initializing)
{
_SectionConfig.Section_ShwRplWords = ppCbShowRplWords.Checked ? "Y" : "N";
}
}
//private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e) //private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e)
//{ //{

View File

@@ -142,11 +142,8 @@ When a format other than the inherited one is selected, a button labeled "Defaul
Pressing the "Default" button will revert back to using the inherited format for this section. Pressing the "Default" button will revert back to using the inherited format for this section.
</value> </value>
</data> </data>
<metadata name="sectionConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>128, 18</value>
</metadata>
<data name="cbIsFoldoutSection.SuperTooltip" xml:space="preserve"> <data name="cbIsFoldoutSection.SuperTooltip" xml:space="preserve">
<value>If the format supports duplex Foldouts: <value>If the format supports duplex Foldouts:
- This can be used to turn On duplexing of the Foldout instead - This can be used to turn On duplexing of the Foldout instead
of using "FOLDOUT" as the section number of using "FOLDOUT" as the section number

View File

@@ -77,10 +77,8 @@ namespace VEPROMS
this.btnReset = new DevComponents.DotNetBar.ButtonX(); this.btnReset = new DevComponents.DotNetBar.ButtonX();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.cbOTRemember = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbOTRemember = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbShwRplWrdsColor = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbOTAutoOpen = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbOTAutoOpen = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.gpOpenTabs = new DevComponents.DotNetBar.Controls.GroupPanel(); this.gpOpenTabs = new DevComponents.DotNetBar.Controls.GroupPanel();
this.gpShwRplWords = new DevComponents.DotNetBar.Controls.GroupPanel();
this.gpSystemColor.SuspendLayout(); this.gpSystemColor.SuspendLayout();
this.panButtons.SuspendLayout(); this.panButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit();
@@ -97,7 +95,6 @@ namespace VEPROMS
this.gpTransRangeColor.SuspendLayout(); this.gpTransRangeColor.SuspendLayout();
this.gpPropPageStyle.SuspendLayout(); this.gpPropPageStyle.SuspendLayout();
this.gpOpenTabs.SuspendLayout(); this.gpOpenTabs.SuspendLayout();
this.gpShwRplWords.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnCancel // btnCancel
@@ -304,7 +301,6 @@ namespace VEPROMS
// tabControlPanel3 // tabControlPanel3
// //
this.tabControlPanel3.Controls.Add(this.gpOpenTabs); this.tabControlPanel3.Controls.Add(this.gpOpenTabs);
this.tabControlPanel3.Controls.Add(this.gpShwRplWords);
this.tabControlPanel3.Controls.Add(this.grPanUCFImpOpt); this.tabControlPanel3.Controls.Add(this.grPanUCFImpOpt);
this.tabControlPanel3.Controls.Add(this.gpVisioPath); this.tabControlPanel3.Controls.Add(this.gpVisioPath);
this.tabControlPanel3.Controls.Add(this.gpSeparateWindows); this.tabControlPanel3.Controls.Add(this.gpSeparateWindows);
@@ -1124,20 +1120,6 @@ namespace VEPROMS
this.cbOTRemember.Text = "Remember Setting"; this.cbOTRemember.Text = "Remember Setting";
this.cbOTRemember.CheckedChanged += new System.EventHandler(this.cbOTRemember_CheckedChanged); this.cbOTRemember.CheckedChanged += new System.EventHandler(this.cbOTRemember_CheckedChanged);
// //
// cbShwRplWrdsColor
//
//
this.cbShwRplWrdsColor.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbShwRplWrdsColor.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cbShwRplWrdsColor.Location = new System.Drawing.Point(8, 5);
this.cbShwRplWrdsColor.Margin = new System.Windows.Forms.Padding(2);
this.cbShwRplWrdsColor.Name = "cbShwRplWrdsColor";
this.cbShwRplWrdsColor.Size = new System.Drawing.Size(119, 19);
this.cbShwRplWrdsColor.TabIndex = 9;
this.cbShwRplWrdsColor.Text = "Color Replace Words";
this.cbShwRplWrdsColor.CheckedChanged += new System.EventHandler(this.cbShwRplWrdsColor_CheckedChanged);
//this.cbShwRplWrdsColor.Checked;
//
// cbOTAutoOpen // cbOTAutoOpen
// //
// //
@@ -1197,48 +1179,6 @@ namespace VEPROMS
this.gpOpenTabs.TabIndex = 13; this.gpOpenTabs.TabIndex = 13;
this.gpOpenTabs.Text = "Open Tabs"; this.gpOpenTabs.Text = "Open Tabs";
// //
// gpShwRplWords
//
this.gpShwRplWords.BackColor = System.Drawing.Color.Transparent;
this.gpShwRplWords.CanvasColor = System.Drawing.SystemColors.Control;
this.gpShwRplWords.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.gpShwRplWords.Controls.Add(this.cbShwRplWrdsColor);
this.gpShwRplWords.DisabledBackColor = System.Drawing.Color.Empty;
this.gpShwRplWords.Location = new System.Drawing.Point(462, 165);
this.gpShwRplWords.Margin = new System.Windows.Forms.Padding(2);
this.gpShwRplWords.Name = "gpShwRplWords";
this.gpShwRplWords.Size = new System.Drawing.Size(139, 72);
//
//
//
this.gpShwRplWords.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.gpShwRplWords.Style.BackColorGradientAngle = 90;
this.gpShwRplWords.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.gpShwRplWords.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.gpShwRplWords.Style.BorderBottomWidth = 1;
this.gpShwRplWords.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.gpShwRplWords.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.gpShwRplWords.Style.BorderLeftWidth = 1;
this.gpShwRplWords.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.gpShwRplWords.Style.BorderRightWidth = 1;
this.gpShwRplWords.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.gpShwRplWords.Style.BorderTopWidth = 1;
this.gpShwRplWords.Style.CornerDiameter = 4;
this.gpShwRplWords.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.gpShwRplWords.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.gpShwRplWords.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.gpShwRplWords.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
//
//
//
this.gpShwRplWords.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
//
//
//
this.gpShwRplWords.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.gpShwRplWords.TabIndex = 13;
this.gpShwRplWords.Text = "Replace Words";
//
// frmSysOptions // frmSysOptions
// //
this.AcceptButton = this.btnOK; this.AcceptButton = this.btnOK;
@@ -1274,8 +1214,6 @@ namespace VEPROMS
this.gpTransRangeColor.ResumeLayout(false); this.gpTransRangeColor.ResumeLayout(false);
this.gpPropPageStyle.ResumeLayout(false); this.gpPropPageStyle.ResumeLayout(false);
this.gpOpenTabs.ResumeLayout(false); this.gpOpenTabs.ResumeLayout(false);
this.gpShwRplWords.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -1330,9 +1268,7 @@ namespace VEPROMS
private DevComponents.DotNetBar.Controls.CheckBoxX cbUCFLNotUsed; private DevComponents.DotNetBar.Controls.CheckBoxX cbUCFLNotUsed;
private DevComponents.DotNetBar.Controls.CheckBoxX cbUCFIgnore; private DevComponents.DotNetBar.Controls.CheckBoxX cbUCFIgnore;
private DevComponents.DotNetBar.Controls.GroupPanel gpOpenTabs; private DevComponents.DotNetBar.Controls.GroupPanel gpOpenTabs;
private DevComponents.DotNetBar.Controls.GroupPanel gpShwRplWords;
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTRemember; private DevComponents.DotNetBar.Controls.CheckBoxX cbOTRemember;
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTAutoOpen; private DevComponents.DotNetBar.Controls.CheckBoxX cbOTAutoOpen;
private DevComponents.DotNetBar.Controls.CheckBoxX cbShwRplWrdsColor;
} }
} }

View File

@@ -68,7 +68,6 @@ namespace VEPROMS
colorPickerButton1.SelectedColor = Settings.Default.TransitionRangeColor; colorPickerButton1.SelectedColor = Settings.Default.TransitionRangeColor;
cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations; cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations;
cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip; cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip;
cbShwRplWrdsColor.Checked = Settings.Default.cbShwRplWrdsColor;
cbTVExpand.Checked = Settings.Default.SaveTreeviewExpanded; cbTVExpand.Checked = Settings.Default.SaveTreeviewExpanded;
cbPasteNoReturns.Checked = Settings.Default.PasteNoReturns; cbPasteNoReturns.Checked = Settings.Default.PasteNoReturns;
cbPastePlainText.Checked = Settings.Default.PastePlainText; cbPastePlainText.Checked = Settings.Default.PastePlainText;
@@ -181,7 +180,6 @@ namespace VEPROMS
private Color ss_TransRangeColor; private Color ss_TransRangeColor;
private bool ss_PopUPAnnotations; private bool ss_PopUPAnnotations;
private bool ss_StepTypeToolTip; private bool ss_StepTypeToolTip;
private bool ss_cbShwRplWrdsColor;
private bool ss_SaveTreeviewExpanded; private bool ss_SaveTreeviewExpanded;
private bool ss_PasteNoReturns; private bool ss_PasteNoReturns;
private bool ss_PastePlainText; private bool ss_PastePlainText;
@@ -197,8 +195,6 @@ namespace VEPROMS
ss_TransRangeColor = Settings.Default.TransitionRangeColor; ss_TransRangeColor = Settings.Default.TransitionRangeColor;
ss_PopUPAnnotations = Settings.Default.AutoPopUpAnnotations; ss_PopUPAnnotations = Settings.Default.AutoPopUpAnnotations;
ss_StepTypeToolTip = Settings.Default.StepTypeToolTip; ss_StepTypeToolTip = Settings.Default.StepTypeToolTip;
ss_cbShwRplWrdsColor = Settings.Default.cbShwRplWrdsColor;
ss_SaveTreeviewExpanded = Settings.Default.SaveTreeviewExpanded; ss_SaveTreeviewExpanded = Settings.Default.SaveTreeviewExpanded;
ss_PasteNoReturns = Settings.Default.PasteNoReturns; ss_PasteNoReturns = Settings.Default.PasteNoReturns;
ss_PastePlainText = Settings.Default.PastePlainText; ss_PastePlainText = Settings.Default.PastePlainText;
@@ -215,7 +211,6 @@ namespace VEPROMS
Settings.Default.TransitionRangeColor = ss_TransRangeColor; Settings.Default.TransitionRangeColor = ss_TransRangeColor;
Settings.Default.AutoPopUpAnnotations = ss_PopUPAnnotations; Settings.Default.AutoPopUpAnnotations = ss_PopUPAnnotations;
Settings.Default.StepTypeToolTip = ss_StepTypeToolTip; Settings.Default.StepTypeToolTip = ss_StepTypeToolTip;
Settings.Default.cbShwRplWrdsColor = ss_cbShwRplWrdsColor;
Settings.Default.SaveTreeviewExpanded = ss_SaveTreeviewExpanded; Settings.Default.SaveTreeviewExpanded = ss_SaveTreeviewExpanded;
Settings.Default.PasteNoReturns = ss_PasteNoReturns; Settings.Default.PasteNoReturns = ss_PasteNoReturns;
Settings.Default.PastePlainText = ss_PastePlainText; Settings.Default.PastePlainText = ss_PastePlainText;
@@ -349,16 +344,10 @@ namespace VEPROMS
Settings.Default.UCFImportOpt = 4; Settings.Default.UCFImportOpt = 4;
} }
} }
private void cbOTRemember_CheckedChanged(object sender, EventArgs e)
{ private void cbOTRemember_CheckedChanged(object sender, EventArgs e)
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbShwRplWrdsColor.Checked;
}
private void cbShwRplWrdsColor_CheckedChanged(object sender, EventArgs e)
{ {
Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked; cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked;
VlnSettings.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked; }
Properties.Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked; // update setting value
Properties.Settings.Default.Save(); // save settings
}
} }
} }

View File

@@ -524,7 +524,6 @@ namespace VEPROMS
this.Activated += new EventHandler(frmVEPROMS_Activated); this.Activated += new EventHandler(frmVEPROMS_Activated);
VlnSettings.StepTypeToolType = Settings.Default.StepTypeToolTip; VlnSettings.StepTypeToolType = Settings.Default.StepTypeToolTip;
VlnSettings.cbShwRplWrdsColor = Settings.Default.cbShwRplWrdsColor;
displayLibDocs.PrintRequest += new DisplayLibDocEvent(displayLibDocs_PrintRequest); displayLibDocs.PrintRequest += new DisplayLibDocEvent(displayLibDocs_PrintRequest);
ContentInfo.InfoChanged += new ContentInfoEvent(RefreshDisplayHistory); ContentInfo.InfoChanged += new ContentInfoEvent(RefreshDisplayHistory);
AnnotationInfo.InfoChanged += new AnnotationInfoEvent(RefreshDisplayHistory); AnnotationInfo.InfoChanged += new AnnotationInfoEvent(RefreshDisplayHistory);
@@ -817,11 +816,6 @@ namespace VEPROMS
set { frmVEPROMS._ErrorLogFileName = value; } set { frmVEPROMS._ErrorLogFileName = value; }
} }
public static bool colorReplaceWords()
{
return Properties.Settings.Default.cbShwRplWrdsColor;
}
static bool ChangeLogFileName(string AppenderName, string NewFilename) static bool ChangeLogFileName(string AppenderName, string NewFilename)
{ {
log4net.Repository.ILoggerRepository RootRep; log4net.Repository.ILoggerRepository RootRep;

View File

@@ -517,57 +517,6 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion CheckOff #endregion CheckOff
#region ShwRplWds
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ShwRplWds
{
private string _MenuItem;
[XmlAttribute("MenuItem")]
[Browsable(false)]
public string MenuItem
{
get { return _MenuItem; }
set { _MenuItem = value; }
}
private string _Index;
[XmlAttribute("Index")]
[Browsable(false)] // Don't show in the property grid
public string Index
{
get { return _Index; }
set { _Index = value; }
}
private bool? _Active;
[DisplayName("Active ShwRplWds")]
[Description("Allow use of this ShwRplWds")]
public bool? Active
{
get { return _Active; }
set { _Active = value; }
}
private bool? _OrigActive;
[XmlIgnore]
[Browsable(false)]
public bool? OrigActive
{
get { return _OrigActive; }
set { _OrigActive = value; }
}
public ShwRplWds()
{
}
public string ConvertToString()
{
return GenericSerializer<ShwRplWds>.StringSerialize(this);
}
public override string ToString()
{
return MenuItem;
}
}
#endregion ShwRplWds
#region StepData (list) #region StepData (list)
[Serializable] [Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))] [TypeConverter(typeof(ExpandableObjectConverter))]

View File

@@ -528,24 +528,6 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Section_OriginalSteps"); OnPropertyChanged("Section_OriginalSteps");
} }
} }
[Browsable(false)]
[DisplayName("Section ShowReplaceWords")]
[RefreshProperties(RefreshProperties.All)]
[Description("Section ShowReplaceWords")]
public string Section_ShwRplWords
{
get
{
//return _Xp["Section", "ShwRplWords"];
string tmp = _Xp["Section", "ShwRplWords"];
return tmp == null || tmp == "" ? "Y" : tmp;
}
set
{
_Xp["Section", "ShwRplWords"] = value;
OnPropertyChanged("Section_ShwRplWords");
}
}
[Category("Section")] [Category("Section")]
//PROPGRID: Hide Section NumPages //PROPGRID: Hide Section NumPages
[Browsable(false)] [Browsable(false)]

View File

@@ -493,34 +493,6 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Step_DisableInitialLine"); OnPropertyChanged("Step_DisableInitialLine");
} }
} }
//C2019-025 Ability to Toggle Replace Words
public int Step_ShwRplWdsIndex
{
get
{
string s = _Xp["Step", "ShwRplWdsIndex"];
if (s == string.Empty) return 0;
if (s == "0") return 0;
if (s == "1") return 1;
if (s == "2") return 2;
if (s == "3") return 3;
return 0;
}
set
{
string s = _Xp["Step", ""];
if (value.ToString() == s) return;
_Xp["Step", "ShwRplWdsIndex"] = value.ToString();
OnPropertyChanged("Step_ShwRplWdsIndex");
}
}
#region RO image sizing #region RO image sizing
// if the RO image (figure) is resized, save it in the step config, not in the ROImageConfig. If stored in ROImageConfig // if the RO image (figure) is resized, save it in the step config, not in the ROImageConfig. If stored in ROImageConfig
// the size is set for ALL uses. // the size is set for ALL uses.

View File

@@ -687,46 +687,19 @@ namespace VEPROMS.CSLA.Library
myLength += mg.Groups[3].Length; myLength += mg.Groups[3].Length;
} }
string gg = MyGrid.Data.Substring(myIndex, myLength); string gg = MyGrid.Data.Substring(myIndex, myLength);
//CSM B2024-003 Updating RO Values inside a text Grid, adding a karat
// and/or dash into the RO value changes to question marks in the UI,
if (newvalue.Contains(@"\u8209?")) if (newvalue.Contains(@"\u8209?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m == null) if (m == null)
newvalue = newvalue.Replace(@"\u8209?", "-"); newvalue = newvalue.Replace(@"\u8209?", "-");
else if (m.Groups[1].Value == "")
newvalue = newvalue.Replace(@"\u8209?", "-");
else else
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
} }
int indx_to_addfont = -1;
if (newvalue.Contains(@"\u916?"))
{
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m == null)
newvalue = newvalue.Replace(@"\u916?", "^");
else if (m.Groups[1].Value == "" && !ContentItems[0].MyItem.MyItemInfo.MyDocVersion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta)
newvalue = newvalue.Replace(@"\u916?", "^");
else if (m.Groups[1].Value == "")
{
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
// adding a caret and/or dash into the RO value and then updating RO values changed to question marks in the UI.
// This is to handle if ConvertCaretToDelta is true
// since delta is not part of the standard ascii
// may need to add a font to handle it.
newvalue = newvalue.Replace(@"\u916?", @"\f9\u916?\f0 ");
indx_to_addfont = GetLocationToInsertFontInGrid(myIndex);
}
else
newvalue = newvalue.Replace(@"\u916?", m.Groups[1].Value + @"\u916?" + m.Groups[3].Value);
}
if (newvalue.Contains(@"\u8593?")) if (newvalue.Contains(@"\u8593?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m == null) if (m == null)
newvalue = newvalue.Replace(@"\u8593?", "^"); newvalue = newvalue.Replace(@"\u8593?", "^");
else if (m.Groups[1].Value == "")
newvalue = newvalue.Replace(@"\u8593?", "^");
else else
newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8593?", m.Groups[1].Value + @"\u8593?" + m.Groups[3].Value);
} }
@@ -735,8 +708,6 @@ namespace VEPROMS.CSLA.Library
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m == null) if (m == null)
newvalue = newvalue.Replace(@"\u9586?", @"\\"); newvalue = newvalue.Replace(@"\u9586?", @"\\");
else if (m.Groups[1].Value == "")
newvalue = newvalue.Replace(@"\u9586?", @"\\");
else else
newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value);
} }
@@ -748,17 +719,7 @@ namespace VEPROMS.CSLA.Library
if (gg != newvalue) if (gg != newvalue)
{ {
retval = gg; retval = gg;
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid, MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength);
// adding a caret and/or dash into the RO value and then updating RO values changed to question marks in the UI.
// This is to handle if ConvertCaretToDelta is true
// since delta is not part of the standard ascii
// may need to add a font to handle it.
string begin_str = MyGrid.Data.Substring(0, myIndex);
if (indx_to_addfont > -1)
begin_str = begin_str.Insert(indx_to_addfont, @"{\f9\fnil\fcharset0 FreeMono;}");
MyGrid.Data = begin_str + newvalue + MyGrid.Data.Substring(myIndex + myLength);
MyGrid.Save();
break; break;
} }
} }
@@ -768,64 +729,6 @@ namespace VEPROMS.CSLA.Library
return retval; return retval;
} }
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
// adding a caret and/or dash into the RO value and then updating RO values changed to question marks in the UI.
// This is to handle if ConvertCaretToDelta is true
// since delta is not part of the standard ascii
// may need to add a font to handle it.
// startIndex = Index in the Grid at which the text we want to replace is starting
//basic Grid data partitioning using the variables in this sub is as follows:
//
// [indexOfPrefix] [indx]
// | |
// [text before last occurrence of prefix] {prefix} [rest of fonts] [text after fonts]
private int GetLocationToInsertFontInGrid(int startIndex)
{
//searches backwards from the srtIndex for the last previous occurrence of the prefix
string prefix = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{";
int indexOfPrefix = MyGrid.Data.LastIndexOf(prefix, startIndex);
//find the end of the font section
//by passing in the Grid data
//with the following removed:
// - Everything before the last occurrence of the prefix
// - the prefix itself removed
int indx = GetIndexOfCloseBracket(MyGrid.Data.Substring(indexOfPrefix + prefix.Length, startIndex - indexOfPrefix - prefix.Length));
if (indx > -1)
{
indx += indexOfPrefix;
indx += prefix.Length;
}
//indx will contain last spot inside the font section
return indx;
}
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
// this function will find the corresponding occurrence of a closing bracket :
// usage is you pass in some text after an opening bracket, and it will tell you what the index is for it closing
private int GetIndexOfCloseBracket(string text)
{
int indx = 0;
Stack<char> stk = new System.Collections.Generic.Stack<char>();
foreach (char c in text)
{
if (c == '{')
stk.Push('{');
else if (c == '}' && stk.Count == 0)
return indx;
else if (c == '}')
stk.Pop();
indx++;
}
return -1;
}
public static string MakeConsistentFormat(string gg) public static string MakeConsistentFormat(string gg)
{ {
// replace degree, bullet dash, hardspace // replace degree, bullet dash, hardspace
@@ -1352,16 +1255,6 @@ namespace VEPROMS.CSLA.Library
{ {
gg = ItemInfo.ConvertToDisplayText(gg); gg = ItemInfo.ConvertToDisplayText(gg);
newvalue = ItemInfo.ConvertToDisplayText(newvalue); newvalue = ItemInfo.ConvertToDisplayText(newvalue);
//CSM B2024-094 - Carats (as Deltas) print as question marks in tables when unit <u> is used in RO Definition Value
//If there is a grid, need to keep these as the \u code
//Otherwise they will not use the correct font and end up as question marks
if (MyGrid != null)
{
gg = gg.Replace($"{(char)916}", @"\u916?");
newvalue = newvalue.Replace($"{(char)916}", @"\u916?");
}
// Debug - jsj 5-19-2017 - left in for initial check-in // Debug - jsj 5-19-2017 - left in for initial check-in
//string xx_gg = gg_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " "); //string xx_gg = gg_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
//string xx_nv = newval_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " "); //string xx_nv = newval_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
@@ -1414,19 +1307,7 @@ namespace VEPROMS.CSLA.Library
else else
newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value);
} }
//B2024-003, B2023-113, B2024-093 - Updating RO Values inside a text Grid,
// This will handle if there is a delta and the column/row of the grid is removed
//then restored from history
if (newvalue.Contains(@"\u916?"))
{
Match m = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");
if (m.Groups.Count < 3 && !ContentItems[0].MyDocVersion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta)
newvalue = newvalue.Replace(@"\u916?", "^");
else if (m.Groups.Count < 3)
newvalue = newvalue.Replace(@"\u916?", $"{(char)916}");
else
newvalue = newvalue.Replace(@"\u916?", m.Groups[1].Value + @"\u916?" + m.Groups[3].Value);
}
if (newvalue.Contains(@"\u8593?")) if (newvalue.Contains(@"\u8593?"))
{ {
Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)");

View File

@@ -6,18 +6,11 @@ using System.Text.RegularExpressions;
using System.Drawing; using System.Drawing;
using Volian.Base.Library; using Volian.Base.Library;
using JR.Utils.GUI.Forms; using JR.Utils.GUI.Forms;
//using VEPROMS.colorReplaceWords;
// This was moved from volian.controls.library // This was moved from volian.controls.library
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public enum E_FieldToEdit { StepText, Text, Number, PSI }; public enum E_FieldToEdit { StepText, Text, Number, PSI };
public enum ReplaceWords
{
Inherit = 0,
Show = 1,
DoNotShow = 2
}
public class DisplayText public class DisplayText
{ {
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -53,45 +46,6 @@ namespace VEPROMS.CSLA.Library
return string.Empty; return string.Empty;
} }
} }
private string ShwRplWords(ItemInfo _MyItemInfo)
{
//if (_Initalizing) return "N";
//_MyItemInfo.
SectionConfig sc = _MyItemInfo.MyConfig as SectionConfig;
if (sc == null) return "N";
return sc.Section_ShwRplWords;
}
// C2019-025 c2025-010 Ability-to-Toggle-Replace-Words
private bool ShwRplWdsIndex(ItemInfo _MyItemInfo)
{
StepConfig sc = _MyItemInfo.MyConfig as StepConfig;
int setting = sc.Step_ShwRplWdsIndex;
switch (setting)
{
case (int)ReplaceWords.DoNotShow:
return false;
break;
case (int)ReplaceWords.Show:
return true;
break;
case (int)ReplaceWords.Inherit:
//SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig;
SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig;
if (sc2 == null || sc2.Section_ShwRplWords == "Y")
{
return true;
}
else
{
return false;
}
break;
default:
return false;
break;
}
}
private Item _MyItem; private Item _MyItem;
private string EditText private string EditText
{ {
@@ -403,34 +357,9 @@ namespace VEPROMS.CSLA.Library
// But don't do ReplaceWords if the TurnOffReplaceWords format flag is set // But don't do ReplaceWords if the TurnOffReplaceWords format flag is set
if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords) if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords)
{ {
int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2"); int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2");
// C2029-025 Show or hide replace words. Can highlight replace words in editor. text = DoReplaceWords2(text);
if (_MyItemInfo.IsSection)
{
string ShwRplWrds = ShwRplWords(_MyItemInfo);
if (ShwRplWrds == "Y")
{
text = DoReplaceWords2(text, epMode);
}
}
if (_MyItemInfo.IsStep)
{
bool ShwRplWrds = ShwRplWdsIndex(_MyItemInfo);
if (ShwRplWrds == true)
{
text = DoReplaceWords2(text, epMode);
}
}
if (_MyItemInfo.IsFolder || _MyItemInfo.IsProcedure)
{
text = DoReplaceWords2(text, epMode);
}
ProfileTimer.Pop(profileDepth1); ProfileTimer.Pop(profileDepth1);
} }
if (_MyItemInfo != null && ROsShouldBeAdjusted) // B2017-019 - added check for ROsShouldBeAdjusted so that these token are not "cooked" on property pages if (_MyItemInfo != null && ROsShouldBeAdjusted) // B2017-019 - added check for ROsShouldBeAdjusted so that these token are not "cooked" on property pages
@@ -2172,7 +2101,7 @@ namespace VEPROMS.CSLA.Library
return (bool) _ProcessReplaceWords; return (bool) _ProcessReplaceWords;
} }
} }
private string DoReplaceWords2(string Text, E_EditPrintMode epMode) private string DoReplaceWords2(string Text)
{ {
if(!ProcessReplaceWords) return Text; if(!ProcessReplaceWords) return Text;
// F2021-053: BNPP Alarm - need ability to have super/sub scripts in the text of Alarm Tables (ROs). // F2021-053: BNPP Alarm - need ability to have super/sub scripts in the text of Alarm Tables (ROs).
@@ -2233,7 +2162,6 @@ namespace VEPROMS.CSLA.Library
// CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is
//RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline;
string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0");
// if first or last character in replaceword is a non-word character, for example, ',', ')', or '.', // if first or last character in replaceword is a non-word character, for example, ',', ')', or '.',
// don't use the \W, i.e. don't bother to look for a non-word character. // don't use the \W, i.e. don't bother to look for a non-word character.
string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)"; string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)";
@@ -2260,7 +2188,7 @@ namespace VEPROMS.CSLA.Library
} }
//ProfileTimer.Pop(profileDepth); //ProfileTimer.Pop(profileDepth);
//int profileDepth5 = ProfileTimer.Push(">>>> DoReplaceWords2.ReplaceMatches"); //int profileDepth5 = ProfileTimer.Push(">>>> DoReplaceWords2.ReplaceMatches");
Text = myMatches.ReplaceMatches(epMode); Text = myMatches.ReplaceMatches();
//ProfileTimer.Pop(profileDepth5); //ProfileTimer.Pop(profileDepth5);
Text = Text.Replace(@"\xA0", @"\u160?"); //replace hard space Text = Text.Replace(@"\xA0", @"\u160?"); //replace hard space
return Text; return Text;
@@ -2552,8 +2480,7 @@ namespace VEPROMS.CSLA.Library
if (str.Length == index && str == text.Substring(0, str.Length)) return true; if (str.Length == index && str == text.Substring(0, str.Length)) return true;
return false; return false;
} }
public string ReplaceMatches()
public string ReplaceMatches(E_EditPrintMode epMode)
{ {
int offset = 0; int offset = 0;
string text = _Text; string text = _Text;
@@ -2645,11 +2572,6 @@ namespace VEPROMS.CSLA.Library
with = with.Replace(@"\ul ", ""); with = with.Replace(@"\ul ", "");
with = with.Replace(@"\ulnone ", ""); with = with.Replace(@"\ulnone ", "");
} }
//if (Properties.Settings.Default.cbShwRplWrdsColor && !(epMode == E_EditPrintMode.Print))
if (Properties.Settings.Default.cbShwRplWrdsColor && !(epMode == E_EditPrintMode.Print))
{
with = $@"\cf2{with}\cf0 ";
}
text = text.Substring(0, offset + foundMatch.MyMatch.Index) + with + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); text = text.Substring(0, offset + foundMatch.MyMatch.Index) + with + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length);
//offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length; //offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length;

View File

@@ -49,35 +49,29 @@ namespace VEPROMS.CSLA.Library
{ {
if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false; if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false;
using (ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID)) ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID);
{
using (RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID))
{
string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return false;
FileInfo fiRofst = new FileInfo(rofstPath); RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID);
string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return false;
// if the database Ro.Fst is newer or if the files have identical DTS, FileInfo fiRofst = new FileInfo(rofstPath);
// assume that they are the same file.
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false;
// next see if the data is the same size, i.e. byte count of record and byte count // if the database Ro.Fst is newer or if the files have identical DTS,
// of file. If different sizes, the date/time stamp check will hold. // assume that they are the same file.
// B2022-026 RO Memory reduction - new logic if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false;
var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID);
if (bytes != null && fiRofst.Length != bytes.Length) // next see if the data is the same size, i.e. byte count of record and byte count
return fiRofst.LastWriteTimeUtc > roFstInfo.DTS; // of file. If different sizes, the date/time stamp check will hold.
// B2022-026 RO Memory reduction - new logic
// if we can't tell by the DTS or size, compare the contents. Get all of the rodb's var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID);
// rofsts of the size of the file & compare bytes.
return ROFstInfoList.ROFstDiffBySize(rofstPath, rdi.RODbID, (int)fiRofst.Length);
}
}
if (bytes != null && fiRofst.Length != bytes.Length)
return fiRofst.LastWriteTimeUtc > roFstInfo.DTS;
// if we can't tell by the DTS or size, compare the contents. Get all of the rodb's
// rofsts of the size of the file & compare bytes.
return ROFstInfoList.ROFstDiffBySize(rofstPath, rdi.RODbID, (int)fiRofst.Length);
} }
} }
public bool ROfstLastCompleted public bool ROfstLastCompleted

View File

@@ -11,7 +11,6 @@ using System.Xml;
using System.Drawing; using System.Drawing;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Volian.Base.Library; using Volian.Base.Library;
using System.Linq;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
@@ -40,17 +39,6 @@ namespace VEPROMS.CSLA.Library
Console.WriteLine("- - - - - -"); Console.WriteLine("- - - - - -");
} }
//C2025-011 RO Update Admin Tool Memory Enhancements
//clears everything in cache - to run between sections in the Admin Tool to reclaim memory
public static void ClearItemCache()
{
_CacheByPrimaryKey.Clear();
while (_CacheList.Count > 0)
{
_CacheList[0].DisposeOfContent = true;
_CacheList[0].Dispose();
}
}
public override string ToString() public override string ToString()
{ {
return string.Format("{0} {1}", MyContent.Number, MyContent.Text).Trim(); return string.Format("{0} {1}", MyContent.Number, MyContent.Text).Trim();
@@ -337,32 +325,6 @@ namespace VEPROMS.CSLA.Library
#region ItemInfo #region ItemInfo
public partial class ItemInfo : IVEDrillDownReadOnly public partial class ItemInfo : IVEDrillDownReadOnly
{ {
//C2025-011 RO Update Admin Tool Memory Enhancements
//clears everything in cache - to run between sections in the Admin Tool to reclaim memory
public static void ClearItemInfoCache()
{
while (_CacheByPrimaryKey.Count > 0)
{
var ii = _CacheByPrimaryKey.FirstOrDefault();
while (ii.Value.Count > 0)
{
if (ii.Value[0]?.MyContent?.ContentParts != null)
{ foreach (PartInfo pi in ii.Value[0]?.MyContent?.ContentParts) pi.Dispose(); }
ii.Value[0].Dispose();
}
_CacheByPrimaryKey.Remove(ii.Key);
}
while (_CacheList.Count > 0)
{
if (_CacheList[0]?.MyContent?.ContentParts != null)
{foreach (PartInfo pi in _CacheList[0]?.MyContent?.ContentParts) pi.Dispose(); }
_CacheList[0].Dispose();
}
}
private bool _PrintAllAtOnce = false; private bool _PrintAllAtOnce = false;
public bool PrintAllAtOnce public bool PrintAllAtOnce
@@ -440,99 +402,6 @@ namespace VEPROMS.CSLA.Library
return tmpForLink; return tmpForLink;
} }
//CSM B2021-043 Step numbering is out of order in RO usage report if RO values exist on steps 10 or higher.
// This will be used to simulate the non-high level part of a tab
// for case where sorting and all other fields match
// Note: This is cut down to improve the sort's performance
// but congruent to Volian.Print.Library.PDFReport-> BuildStepTab(ItemInfo item)
public string BuildStepTab()
{
StringBuilder sret = new StringBuilder();
ItemInfo pitem = this;
while (!pitem.IsSection && !pitem.IsHigh)
{
using (StepInfo stpinfo = StepInfo.Get(pitem.ItemID))
{
string thisTab = stpinfo.MyTab.CleanText;
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;
if (!string.IsNullOrEmpty(thisTab))
{
thisTab = thisTab.Trim();
}
// if the tab is null or
// if the the tab is not a letter or number OR
// the tab is an AND or OR type and is the letter "o"
// then reset the tab an empty string so that the type name along with the count of that type
// (ex. "AND 2", "OR 3")
if (string.IsNullOrEmpty(thisTab) || (thisTab != string.Empty && (!(char.IsLetterOrDigit(thisTab[0])) || ((pitem.IsAnd || pitem.IsOr || pitem.IsCaution || pitem.IsNote) && thisTab.Contains("o")))))
{
thisTab = string.Empty;
}
if (pitem.IsRNOPart)
{
if (string.IsNullOrEmpty(thisTab))
{
sret.Insert(0, "RNO.");
}
else
{
thisTab = thisTab.Trim();
if (!thisTab.EndsWith(".") && !thisTab.EndsWith(")"))
{
thisTab += ".";
}
sret.Insert(0, "RNO." + thisTab);
}
}
else if (pitem.IsCaution || pitem.IsNote)
{
// add the Caution or Note count to the tab (ex "Caution 1", "Note 2")
if (string.IsNullOrEmpty(thisTab))
{
sret.Append("{" + typeName + " " + pitem.Ordinal.ToString() + "}");
}
else
{
thisTab = thisTab.Trim(" ".ToCharArray());
sret.Append(thisTab + " " + pitem.Ordinal.ToString() + sret);
}
}
else
{
if (!string.IsNullOrEmpty(thisTab))
{
thisTab = thisTab.Trim(" ".ToCharArray());
if (!thisTab.EndsWith(".") && !thisTab.EndsWith(")"))
{
thisTab += ".";
}
}
else
{
thisTab = "{" + typeName + " " + pitem.Ordinal.ToString() + "}.";
}
sret.Insert(0, thisTab);
}
}
pitem = pitem.ActiveParent as ItemInfo;
if (pitem == null)
break;
}
return sret.ToString().Trim(" .)".ToCharArray());
}
public void SetHeader(VE_Font myFont, string myText) public void SetHeader(VE_Font myFont, string myText)
{ {
_MyHeader = new MetaTag(myFont); _MyHeader = new MetaTag(myFont);
@@ -750,14 +619,12 @@ namespace VEPROMS.CSLA.Library
{ {
TranCheckCount = 0; TranCheckCount = 0;
TranFixCount = 0; TranFixCount = 0;
TranCantFixCount = 0;
TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count
} }
public static int TranCheckCount = 0; public static int TranCheckCount = 0;
public static int TranFixCount = 0; public static int TranFixCount = 0;
public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count
public static int TranCantFixCount = 0;
internal static TransitionInfoList TransitionsToDisconnected; internal static TransitionInfoList TransitionsToDisconnected;
internal static TransitionInfoList TransitionsToNonEditable; internal static TransitionInfoList TransitionsToNonEditable;
@@ -864,15 +731,6 @@ namespace VEPROMS.CSLA.Library
content.Save(); content.Save();
} }
} }
else if (newText.Contains("<CTID=-"))
{
//CSM C2024-028 - Bad Transition Link - Make an annotation
using (Item itm = Item.Get(itemInfo.ItemID))
{
TranCantFixCount++;
Annotation.MakeAnnotation(itm, AnnotationType.GetByNameOrCreate("Bad Transition Link"), "", $"Invalid Transition Link: ({ItemInfo.ConvertToDisplayText(newValue)})", null);
}
}
} }
} }
} }
@@ -2528,19 +2386,15 @@ namespace VEPROMS.CSLA.Library
} }
public ItemInfo LastChild(E_FromType partType) public ItemInfo LastChild(E_FromType partType)
{ {
using (ItemInfoList myitems = Lookup((int)partType)) ItemInfoList myitems = Lookup((int)partType);
{ if (myitems != null) return myitems[myitems.Count - 1];
if (myitems != null) return myitems[myitems.Count - 1]; return null;
return null;
}
} }
public ItemInfo FirstChild(E_FromType partType) public ItemInfo FirstChild(E_FromType partType)
{ {
using (ItemInfoList myitems = Lookup((int)partType)) ItemInfoList myitems = Lookup((int)partType);
{ if (myitems != null) return myitems[0];
if (myitems != null) return myitems[0]; return null;
return null;
}
} }
public bool HasAncestor(ItemInfo ancestor) public bool HasAncestor(ItemInfo ancestor)
{ {
@@ -3280,24 +3134,6 @@ namespace VEPROMS.CSLA.Library
//get { return ConvertToDisplayText(MyContent.Number); } //get { return ConvertToDisplayText(MyContent.Number); }
} }
//CSM B2021-043 Step numbering is out of order in RO usage report if RO values exist on steps 10 or higher.
//Get Numeric part of HLS Tab
//Used for Certain sorting situations
//If no numeric part then use 999 (will be at end of that level of the sort if there are other items with numbered HLS)
public int NumericSortNumber
{
get
{
string numericpart = null;
if (MyHLS != null)
numericpart = new string(MyHLS?.MyTab?.CleanTextNoSymbols.TakeWhile(Char.IsDigit).ToArray());
if (!string.IsNullOrEmpty(numericpart) && numericpart.All(char.IsNumber))
return int.Parse(numericpart);
else
return 999;
}
}
// for step designators (a redefined caution type used in Comanche Peak with the SameRowAsParentMultiLines format flag) // for step designators (a redefined caution type used in Comanche Peak with the SameRowAsParentMultiLines format flag)
// we what to allow for a hard return to allow for multiple designator lines - jsj 5/21/2015 // we what to allow for a hard return to allow for multiple designator lines - jsj 5/21/2015
public static string ConvertToMulitLineStepDesignatorDisplayText(string txt) public static string ConvertToMulitLineStepDesignatorDisplayText(string txt)
@@ -3904,33 +3740,30 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region IVEReadOnlyItem #region IVEReadOnlyItem
PartInfoList _PartInfoList;
public System.Collections.IList GetChildren() public System.Collections.IList GetChildren()
{ {
using (PartInfoList _PartInfoList = this.MyContent.ContentParts) _PartInfoList = this.MyContent.ContentParts;
{ if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps"))
if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps")) return _PartInfoList[0].GetChildren();
return _PartInfoList[0].GetChildren(); return _PartInfoList;
return _PartInfoList;
}
} }
public System.Collections.IList GetChildren(bool allParts) public System.Collections.IList GetChildren(bool allParts)
{ {
using (PartInfoList _PartInfoList = this.MyContent.ContentParts) _PartInfoList = this.MyContent.ContentParts;
{ if (allParts)
if (allParts) {
{ if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps"))
if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps"))
return _PartInfoList[0].GetChildren(); return _PartInfoList[0].GetChildren();
return _PartInfoList; return _PartInfoList;
} }
else // Steps and Sections only else // Steps and Sections only
{ {
for (int i = 0; i < _PartInfoList.Count; i++) for (int i = 0; i < _PartInfoList.Count; i++)
if (_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps") if (_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps")
return _PartInfoList[i].GetChildren(); return _PartInfoList[i].GetChildren();
return null; return null;
}
} }
} }
//public bool ChildrenAreLoaded //public bool ChildrenAreLoaded
@@ -6229,8 +6062,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new MoveItemCriteria(itemID, index))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new MoveItemCriteria(itemID, index));
{ return tmp; } return tmp;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6242,15 +6075,13 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListCriteria(itemID, type))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListCriteria(itemID, type));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList ContentInfoList.GetList(itemID); // Performance - Load All Content
ContentInfoList.GetList(itemID); // Performance - Load All Content #endif
#endif return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6261,16 +6092,13 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranToListCriteria())) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranToListCriteria());
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList ContentInfoList.GetList(itemID); // Performance - Load All Content
ContentInfoList.GetList(itemID); // Performance - Load All Content #endif
#endif return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6281,15 +6109,13 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranFromListCriteria())) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranFromListCriteria());
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList ContentInfoList.GetList(itemID); // Performance - Load All Content
ContentInfoList.GetList(itemID); // Performance - Load All Content #endif
#endif return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6300,183 +6126,19 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListPartTypeCriteria(fromType))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListPartTypeCriteria(fromType));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList ContentInfoList.GetList(itemID); // Performance - Load All Content
ContentInfoList.GetList(itemID); // Performance - Load All Content #endif
#endif return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
} }
} }
//CSM B2021-043 Step numbering is out of order in RO usage report if RO values exist on steps 10 or higher.
// Found various inconsistencies in the reports so adding this to manually sort
//instead of binding the sort to 1 or 2 individual fields
public List<ItemInfo> SortedList(bool sortbyFoundRoid = false)
{
List<ItemInfo> tmp = new List<ItemInfo>(this);
if (sortbyFoundRoid)
{
// Priority of Sorting order:
// 1. FoundRoid (by Referenced Object ID)
// 2. SearchDVPath_clean (Which Procedure Set it is in - I.E. EOPs, Background, SAMGs, etc...)
// 3. Keep in order of the Procedures within the set
// 4. Keep in the order of the Section within the Procedure
// 5. NumericSortNumber - numeric part of the HLS if there is one
// 6. Substep Tab - will sort as a string since combined numbers/text
tmp.Sort(comparison: delegate (ItemInfo x, ItemInfo y)
{
int cmp = 0;
int FoundROID_cmp = x.FoundROID.CompareTo(y.FoundROID);
switch (FoundROID_cmp)
{
case int result when result < 0:
cmp -= 10000000;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 10000000;
break;
default:
break;
}
int DVPath_cmp = x.SearchDVPath_clean.CompareTo(y.SearchDVPath_clean);
switch (DVPath_cmp)
{
case int result when result < 0:
cmp -= 1000000;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 1000000;
break;
default:
break;
}
if (x.MyProcedure != null && y.MyProcedure != null)
{
cmp += (x.MyProcedure.Ordinal.CompareTo(y.MyProcedure.Ordinal) * 100000);
}
if (x.ActiveSection != null && y.ActiveSection != null)
{
cmp += (x.ActiveSection.Ordinal.CompareTo(y.ActiveSection.Ordinal) * 100000);
}
cmp += x.NumericSortNumber.CompareTo(y.NumericSortNumber) * 10;
if (cmp == 0)
{
int StepTab_cmp = (x.BuildStepTab()).CompareTo(y.BuildStepTab());
switch (StepTab_cmp)
{
case int result when result < 0:
cmp -= 1;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 1;
break;
default:
break;
}
}
return cmp;
});
}
else
{
// Priority of Sorting order:
// 1. SearchDVPath_clean (Which Procedure Set it is in - I.E. EOPs, Background, SAMGs, etc...)
// 2. Keep in order of the Procedures within the set
// 3. Keep in the order of the Section within the Procedure
// 4. NumericSortNumber - numeric part of the HLS if there is one
// 5. Substep Tab - will sort as a string since combined numbers/text
// 6. FoundRoid (by Referenced Object ID)
tmp.Sort(comparison: delegate (ItemInfo x, ItemInfo y)
{
int cmp = 0;
int DVPath_cmp = x.SearchDVPath_clean.CompareTo(y.SearchDVPath_clean);
switch (DVPath_cmp)
{
case int result when result < 0:
cmp -= 10000000;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 10000000;
break;
default:
break;
}
if (x.MyProcedure != null && y.MyProcedure != null)
{
cmp += (x.MyProcedure.Ordinal.CompareTo(y.MyProcedure.Ordinal) * 1000000);
}
if (x.ActiveSection != null && y.ActiveSection != null)
{
cmp += (x.ActiveSection.Ordinal.CompareTo(y.ActiveSection.Ordinal) * 100000);
}
cmp += (x.NumericSortNumber.CompareTo(y.NumericSortNumber) * 100);
if (cmp == 0)
{
int StepTab_cmp = (x.BuildStepTab()).CompareTo(y.BuildStepTab());
switch (StepTab_cmp)
{
case int result when result < 0:
cmp -= 10;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 10;
break;
default:
break;
}
}
int FoundROID_cmp = x.FoundROID.CompareTo(y.FoundROID);
switch (FoundROID_cmp)
{
case int result when result < 0:
cmp -= 1;
break;
case int result when result == 0:
break;
case int result when result > 0:
cmp += 1;
break;
default:
break;
}
return cmp;
});
}
return tmp;
}
[Serializable()] [Serializable()]
private class MoveItemCriteria private class MoveItemCriteria
{ {
@@ -6793,8 +6455,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedTextDifferencesCriteria(procItem.ItemID))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedTextDifferencesCriteria(procItem.ItemID));
{ return tmp; } return tmp;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6862,8 +6524,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedMissingCriteria(srcItem.ItemID, enhType))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedMissingCriteria(srcItem.ItemID, enhType));
{ return tmp; } return tmp;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6932,13 +6594,11 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, byWordPrefix, byWordSuffix))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, byWordPrefix, byWordSuffix));
{ tmp.SourceOfList = "Search";
tmp.SourceOfList = "Search"; ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7093,12 +6753,10 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7199,12 +6857,10 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive, unitPrefix))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive, unitPrefix));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7325,12 +6981,10 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListTransitionSearchCriteria(docVersionList, tranType, tranCategory, stepTypeList))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListTransitionSearchCriteria(docVersionList, tranType, tranCategory, stepTypeList));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7416,12 +7070,10 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROReportCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROReportCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix));
{ ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7523,13 +7175,11 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListApplicabilitySearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, applicSetting))) ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListApplicabilitySearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, applicSetting));
{ tmp.SourceOfList = "Search";
tmp.SourceOfList = "Search"; ItemInfo.AddList(tmp);
ItemInfo.AddList(tmp); tmp.AddEvents();
tmp.AddEvents(); return tmp;
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7664,11 +7314,11 @@ namespace VEPROMS.CSLA.Library
} }
this.RaiseListChangedEvents = true; this.RaiseListChangedEvents = true;
} }
#endregion #endregion
} }
#endregion #endregion
#region new class TransitionLookup #region new class TransitionLookup
public delegate ProcedureInfo TransitionLookupEvent(object sender, TransitionLookupEventArgs args); public delegate ProcedureInfo TransitionLookupEvent(object sender, TransitionLookupEventArgs args);
public class TransitionLookupEventArgs public class TransitionLookupEventArgs
{ {
private int _ProcID; private int _ProcID;
@@ -8179,30 +7829,27 @@ namespace VEPROMS.CSLA.Library
// get list of differences from sql. This list does not resolve links and may have other rtf commands. // get list of differences from sql. This list does not resolve links and may have other rtf commands.
// also this list is source items, not enhanced. // also this list is source items, not enhanced.
ItemInfoList iil = ItemInfoList.GetListEnhancedTextDifferences(this);
if (iil == null || iil.Count == 0) return null; // no differences were found.
using (ItemInfoList iil = ItemInfoList.GetListEnhancedTextDifferences(this)) // from sql list, get display text of source items & compare to this procedure's items. This
// will determine true 'text' differences. Then return this list.
ItemInfoList retiil = null; // new ItemInfoList(null);
foreach (ItemInfo ii in iil)
{ {
if (iil == null || iil.Count == 0) return null; // no differences were found. EnhancedDocuments seds = ii.GetMyEnhancedDocuments();
if (seds != null && seds.Count != 0)
// from sql list, get display text of source items & compare to this procedure's items. This
// will determine true 'text' differences. Then return this list.
ItemInfoList retiil = null; // new ItemInfoList(null);
foreach (ItemInfo ii in iil)
{ {
EnhancedDocuments seds = ii.GetMyEnhancedDocuments();
if (seds != null && seds.Count != 0)
{
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID); ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
// B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced. Null reference check // B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced. Null reference check
if (srcItem != null && srcItem.DisplayTextKeepSpecialChars != ii.DisplayTextKeepSpecialChars) if (srcItem != null && srcItem.DisplayTextKeepSpecialChars != ii.DisplayTextKeepSpecialChars)
{ {
if (retiil == null) retiil = new ItemInfoList(ii); if (retiil == null) retiil = new ItemInfoList(ii);
else retiil.AddItem(ii); else retiil.AddItem(ii);
}
} }
} }
return retiil;
} }
return retiil;
} }
public void EnhancedProcedureRefreshTextDifferences(ItemInfoList iil) public void EnhancedProcedureRefreshTextDifferences(ItemInfoList iil)
{ {
@@ -8515,7 +8162,97 @@ namespace VEPROMS.CSLA.Library
Dr = dr; Dr = dr;
} }
} }
public static DataTable GetDisplayTabs(int itemID) //, string displayTabID, string displayTabName)
{
try
{
DataTable tmp = DataPortal.Fetch<DataTable>(new DisplayTabs(itemID, "", "")); //, displayTabID, displayTabName));
//ItemInfo.AddList(tmp);
//tmp.AddEvents();
return tmp;
}
catch (Exception ex)
{
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
}
}
private DataTable dt = new DataTable();
private DataTable DataPortal_Fetch(DisplayTabs criteria)
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
try
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "GetDisplayTabData";
cm.CommandTimeout = Database.DefaultTimeout;
SqlDataAdapter da = new SqlDataAdapter(cm);
da.Fill(dt);
cn.Close();
da.Dispose();
return dt;
}
catch (Exception ex)
{
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
}
}
}
}
//public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
//{
// try
// {
// //DisplayTabs tmp =
// DataPortal.Fetch<DisplayTabs>(new DisplayTabs(itemID, displayTabID, displayTabName)); //, displayTabID, displayTabName));
// //ItemInfo.AddList(tmp);
// //tmp.AddEvents();
// //return tmp;
// }
// catch (Exception ex)
// {
// throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
// }
//}
//private DataTable dt = new DataTable();
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
//{
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
// {
// using (SqlCommand cm = cn.CreateCommand())
// {
// try
// {
// cm.CommandType = CommandType.StoredProcedure;
// cm.CommandText = "AddDisplayTabState";
// cm.CommandTimeout = Database.DefaultTimeout;
// cm.Parameters.AddWithValue("@ItemID", ItemID);
// cm.Parameters.AddWithValue("@displayTabID", displayTabID);
// cm.Parameters.AddWithValue("@displayTabName", displayTabName);
// cm.ExecuteNonQuery();
// //SqlDataAdapter da = new SqlDataAdapter(cm);
// //da.Fill(dt);
// //cn.Close();
// //da.Dispose();
// //return dt; // fix
// }
// catch (Exception ex)
// {
// //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
// throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
// }
// }
// }
//}
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName) public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName) //private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
{ {

View File

@@ -2650,174 +2650,97 @@ namespace VEPROMS.CSLA.Library
firstTrans = false; firstTrans = false;
if (!CanDeleteObject()) if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Item"); throw new System.Security.SecurityException("User not authorized to remove a Item");
// B2016-009 check source and destination types and display message box if needed // B2016-009 check source and desintation types and display message box if needed
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon // C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
// B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case // B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case
ItemInfo newItemInfo = null; ItemInfo newItemInfo = null;
using (ItemInfo copyItemInfo = ItemInfo.Get(copyStartID)) try
{ {
try // C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query
if (itemInfo.IsEnhancedStep)
{ {
// C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo);
if (itemInfo.IsEnhancedStep) if (newItemInfo == null) return null;
{
newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo);
if (newItemInfo == null) return null;
}
//C2025-003 Enhanced Copy/Paste Upgrade - Added support for paste/replace on a master step
else if (itemInfo.HasEnhancedLinkedStep || copyItemInfo.HasEnhancedLinkedStep)
{
DialogResult rslt = DialogResult.No;
SectionConfig secCfg = itemInfo.ActiveSection.MyConfig as SectionConfig;
if (copyItemInfo.HasEnhancedLinkedStep && secCfg.MyEnhancedDocuments.Count > 0)
rslt = FlexibleMessageBox.Show("The step you are copying contains linked background documents." +
"\r\n\r\nDo you also wish to make a copy of the background documents?",
"Paste background documents", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
//unlink and remove any background documents attached to where you are copying to
//and then delete them
//if selected want to replace BG step (DialogResult.Yes)
if (itemInfo.HasEnhancedLinkedStep && rslt == DialogResult.Yes)
{
foreach (EnhancedDocument ed in itemInfo.GetMyEnhancedDocuments())
{
using (ItemInfo exEnh = ItemInfo.Get(ed.ItemID))
{
exEnh.DoUnlinkEnhanced(exEnh, 0, false);
DeleteItemAndChildren(exEnh);
}
}
}
//do copy/paste replace of the master step
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo);
if (newItemInfo == null) return null;
//copy any background documents
//if selected want to replace BG step (DialogResult.Yes)
if (copyItemInfo.HasEnhancedLinkedStep && rslt == DialogResult.Yes)
{
foreach (EnhancedDocument ed in copyItemInfo.GetMyEnhancedDocuments())
{
using (ItemInfo exEnh = newItemInfo.DoAddMissingEnhancedItems(ed.Type))
{
PasteReplace(exEnh, ed.ItemID, chgid, ref firstTrans);
}
}
}
else if (rslt == DialogResult.No)
{
//if selected didn't want to copy BG documents (DialogResult.No)
//need to unlink BG doc from old removed content (what was pasted over top of)
//re-link BG document to new paste replace master doc
//this should also auto update the text of the main linked item
//to match the new master doc wording
//get original BG documents
EnhancedDocuments orig_eds = itemInfo.GetMyEnhancedDocuments();
//remove link from pre-existing BG docs
foreach (EnhancedDocument ed in orig_eds)
{
using (ItemInfo exEnh = ItemInfo.Get(ed.ItemID))
{ exEnh.DoUnlinkEnhanced(exEnh, 0, false); }
}
//remove link from steps just copied
ItemInfo.PasteClearEnhanced(newItemInfo);
//re-link pre-existing BG docs to newly replaced master step
foreach (EnhancedDocument ed in orig_eds)
{
using (ItemInfo orig_ed_item = ItemInfo.Get(ed.ItemID))
{ newItemInfo.DoCreateLinksEnhancedSingleItem(orig_ed_item, ed.Type); }
}
}
}
else
{
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); if (newItemInfo == null) return null;
}
} }
catch (Exception ex1) else
{ {
if (ex1.Message.Contains("has External Transitions and has no next step") newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); if (newItemInfo == null) return null;
}
}
catch (Exception ex1)
{
if (ex1.Message.Contains("has External Transitions and has no next step")
|| ex1.Message.Contains("has External Transitions to Procedure") || ex1.Message.Contains("has External Transitions to Procedure")
|| ex1.Message.Contains("has External Transitions to it's children")) || ex1.Message.Contains("has External Transitions to it's children"))
{
FlexibleMessageBox.Show("This procedure has external transition references to it that must be resolved before doing the Paste/Replace.\r\nRight Click on the procedure and select the Incoming Transitions menu option to find these references and resolve them.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
return null;
}
}
try
{ {
// Delete business objects, including remove from tree FlexibleMessageBox.Show("This procedure has external transition references to it that must be resolved before doing the Paste/Replace.\r\nRight Click on the procedure and select the Incoming Transitions menu option to find these references and resolve them.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children return null;
using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item);
ItemInfo.PasteSetChangeId(newItemInfo, chgid);
if (!copyItemInfo.HasEnhancedLinkedStep && !itemInfo.HasEnhancedLinkedStep) ItemInfo.PasteClearEnhanced(newItemInfo);
if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item);
newItemInfo.RefreshNextItems();
// if inserting after a caution or note, refreshes tabs. This will adjust bullets
// of any previous cautions or notes.
if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal();
newItemInfo.UpdateTransitionText();
newItemInfo.UpdateROText();
newItemInfo.UpdatePastedStepTransitionText();
// Add to tree
if (newItemInfo.NextItem != null)
{
using (ItemInfo itm = ItemInfo.GetNonCached(newItemInfo.NextItem.ItemID))
{
itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before));
}
}
else if (newItemInfo.PreviousID != null)
{
using (ItemInfo itm2 = ItemInfo.GetNonCached((int)newItemInfo.PreviousID))
{
itm2.OnNewSiblingAfter(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.After));
}
}
else
{
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
// For the single procedure case, the user interface code in vlntreeview will update the tree.
if (newItemInfo.MyParent != null)
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
}
return newItemInfo;
} }
catch (Exception ex) }
try
{
// Delete business objects, including remove from tree
ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children
using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item);
ItemInfo.PasteSetChangeId(newItemInfo, chgid);
ItemInfo.PasteClearEnhanced(newItemInfo);
if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item);
newItemInfo.RefreshNextItems();
// if inserting after a caution or note, refreshes tabs. This will adjust bullets
// of any previous cautions or notes.
if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal();
newItemInfo.UpdateTransitionText();
newItemInfo.UpdateROText();
newItemInfo.UpdatePastedStepTransitionText();
// Add to tree
if (newItemInfo.NextItem != null)
{ {
ItemInfo iii = itemInfo.HandleSqlExceptionOnDelete(ex); using (ItemInfo itm = ItemInfo.GetNonCached(newItemInfo.NextItem.ItemID))
if (iii == itemInfo) return null;// If self returned then return null
if (iii != null)
{ {
firstTrans = true; // B2017-179 set the firstTrans to true and return the itminfo of the first transition location that needs resolved itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before));
return iii;
} }
if (!HandleSqlExceptionOnCopy(ex))
{
if (ex.Message.Contains("has External Transitions and has no next step")
|| ex.Message.Contains("has External Transitions to Procedure")
|| ex.Message.Contains("has External Transitions to it's children")
|| ex.Message.Contains("This step has been deleted"))
throw ex;
FlexibleMessageBox.Show("Details were written to the Error Log.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
return itemInfo;
}
else
return itemInfo;
} }
else if (newItemInfo.PreviousID != null)
{
using (ItemInfo itm2 = ItemInfo.GetNonCached((int)newItemInfo.PreviousID))
{
itm2.OnNewSiblingAfter(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.After));
}
}
else
{
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
// For the single procedure case, the user interface code in vlntreeview will update the tree.
if (newItemInfo.MyParent != null)
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
}
return newItemInfo;
}
catch (Exception ex)
{
ItemInfo iii = itemInfo.HandleSqlExceptionOnDelete(ex);
if (iii == itemInfo) return null;// If self returned then return null
if (iii != null)
{
firstTrans = true; // B2017-179 set the firstTrans to true and return the itminfo of the first transition location that needs resolved
return iii;
}
if (!HandleSqlExceptionOnCopy(ex))
{
if (ex.Message.Contains("has External Transitions and has no next step")
|| ex.Message.Contains("has External Transitions to Procedure")
|| ex.Message.Contains("has External Transitions to it's children")
|| ex.Message.Contains("This step has been deleted")
)
throw ex;
FlexibleMessageBox.Show("Details were written to the Error Log.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
return itemInfo;
}
else
return itemInfo;
} }
} }
#endregion #endregion

View File

@@ -84,6 +84,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("LastChanged", true);
return _LastChanged; return _LastChanged;
} }
set { _LastChanged = value; } set { _LastChanged = value; }

View File

@@ -80,6 +80,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("LastChanged", true);
return _LastChanged; return _LastChanged;
} }
set { _LastChanged = value; } set { _LastChanged = value; }

View File

@@ -2173,7 +2173,6 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
#endregion #endregion
#region CheckOff #region CheckOff
[TypeConverter(typeof(ExpandableObjectConverter))] [TypeConverter(typeof(ExpandableObjectConverter))]
@@ -2285,49 +2284,6 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion #endregion
#region ShwRplWds
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
public class ShwRplWds : vlnFormatItem, IVlnIndexedFormatItem
{
public ShwRplWds(XmlNode xmlNode) : base(xmlNode) { }
public ShwRplWds() : base() { }
private LazyLoad<int?> _Index;
public int? Index
{
get
{
return LazyLoad(ref _Index, "@Index");
}
}
// User Interface Mark (UIMark) is the deimal number of an ASCII character that is desplayed in the step editor
// to indicate the selected checkoff
private LazyLoad<int?> _UIMark;
public int? UIMark
{
get
{
return LazyLoad(ref _UIMark, "@UIMark");
}
}
//Descriptive text shown in the checkoff selection list
private LazyLoad<string> _MenuItem;
public string MenuItem
{
get
{
return LazyLoad(ref _MenuItem, "@MenuItem");
}
}
public override string ToString()
{
return MenuItem;
}
}
#endregion
#region CheckOffList #region CheckOffList
[TypeConverter(typeof(vlnIndexedListConverter<CheckOffList, CheckOff>))] [TypeConverter(typeof(vlnIndexedListConverter<CheckOffList, CheckOff>))]
public class CheckOffList : vlnIndexedFormatList<CheckOff> public class CheckOffList : vlnIndexedFormatList<CheckOff>
@@ -6257,36 +6213,6 @@ public StepData Equation // equation has a parent of embedded object.
} }
} }
// F2024-078 adjusts the the spacing before the Note/Caution tab - the space betwee the top of the box and the tab text
private LazyLoad<float?> _AdjSpB4Tab;
public float? AdjSpB4Tab
{
get
{
return LazyLoad(ref _AdjSpB4Tab, "@AdjSpB4Tab");
}
}
// F2024-078 adjusts the the spacing after the Note/Caution tab - the space betwee the tab text and the first line of of Note/Caution text
private LazyLoad<float?> _AdjSpAftTab;
public float? AdjSpAftTab
{
get
{
return LazyLoad(ref _AdjSpAftTab, "@AdjSpAftTab");
}
}
// F2024-078 adjusts the the spacing after the last line of Note/Caution text - between the last line of text and the bottom of the box
private LazyLoad<float?> _AdjLastBlnkLn;
public float? AdjLastBlnkLn
{
get
{
return LazyLoad(ref _AdjLastBlnkLn, "@AdjLastBlnkLn");
}
}
// this will adjust the line spacing when an extra thick line is used for a box, so that the text below the box doesn't hit up against the bottom of the box // this will adjust the line spacing when an extra thick line is used for a box, so that the text below the box doesn't hit up against the bottom of the box
private LazyLoad<bool> _ThickDouble; // F2021-026: Barakah single column 2 thick double lines around Warnings private LazyLoad<bool> _ThickDouble; // F2021-026: Barakah single column 2 thick double lines around Warnings
public bool ThickDouble public bool ThickDouble

View File

@@ -108,6 +108,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationID", true);
return _AnnotationID; return _AnnotationID;
} }
} }
@@ -117,6 +118,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ItemID", true);
if (_MyItem != null) _ItemID = _MyItem.ItemID; if (_MyItem != null) _ItemID = _MyItem.ItemID;
return _ItemID; return _ItemID;
} }
@@ -127,12 +129,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyItem", true);
if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID);
return _MyItem; return _MyItem;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyItem", true);
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
@@ -147,6 +151,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID; if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID;
return _TypeID; return _TypeID;
} }
@@ -157,12 +162,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyAnnotationType", true);
if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationType.Get(_TypeID); if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationType.Get(_TypeID);
return _MyAnnotationType; return _MyAnnotationType;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyAnnotationType", true);
if (_MyAnnotationType != value) if (_MyAnnotationType != value)
{ {
_MyAnnotationType = value; _MyAnnotationType = value;
@@ -177,11 +184,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RtfText", true);
return _RtfText; return _RtfText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("RtfText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_RtfText != value) if (_RtfText != value)
{ {
@@ -196,11 +205,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("SearchText", true);
return _SearchText; return _SearchText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("SearchText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_SearchText != value) if (_SearchText != value)
{ {
@@ -215,11 +226,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("Config", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_Config != value) if (_Config != value)
{ {
@@ -234,11 +247,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DTS", true);
if (_DTS != value) if (_DTS != value)
{ {
_DTS = value; _DTS = value;
@@ -252,11 +267,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("UserID", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_UserID != value) if (_UserID != value)
{ {

View File

@@ -106,6 +106,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AuditID", true);
return _AuditID; return _AuditID;
} }
} }
@@ -115,11 +116,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationID", true);
return _AnnotationID; return _AnnotationID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("AnnotationID", true);
if (_AnnotationID != value) if (_AnnotationID != value)
{ {
_AnnotationID = value; _AnnotationID = value;
@@ -133,11 +136,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ItemID", true);
return _ItemID; return _ItemID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("ItemID", true);
if (_ItemID != value) if (_ItemID != value)
{ {
_ItemID = value; _ItemID = value;
@@ -151,11 +156,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
return _TypeID; return _TypeID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("TypeID", true);
if (_TypeID != value) if (_TypeID != value)
{ {
_TypeID = value; _TypeID = value;
@@ -169,11 +176,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RtfText", true);
return _RtfText; return _RtfText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("RtfText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_RtfText != value) if (_RtfText != value)
{ {
@@ -188,11 +197,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("SearchText", true);
return _SearchText; return _SearchText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("SearchText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_SearchText != value) if (_SearchText != value)
{ {
@@ -207,11 +218,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("Config", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_Config != value) if (_Config != value)
{ {
@@ -226,11 +239,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DTS", true);
if (_DTS != value) if (_DTS != value)
{ {
_DTS = value; _DTS = value;
@@ -244,11 +259,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("UserID", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_UserID != value) if (_UserID != value)
{ {
@@ -263,11 +280,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DeleteStatus", true);
return _DeleteStatus; return _DeleteStatus;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DeleteStatus", true);
if (_DeleteStatus != value) if (_DeleteStatus != value)
{ {
_DeleteStatus = value; _DeleteStatus = value;

View File

@@ -96,6 +96,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AuditID", true);
return _AuditID; return _AuditID;
} }
} }
@@ -105,6 +106,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationID", true);
return _AnnotationID; return _AnnotationID;
} }
} }
@@ -114,6 +116,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ItemID", true);
return _ItemID; return _ItemID;
} }
} }
@@ -123,6 +126,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
return _TypeID; return _TypeID;
} }
} }
@@ -132,6 +136,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RtfText", true);
return _RtfText; return _RtfText;
} }
} }
@@ -141,6 +146,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("SearchText", true);
return _SearchText; return _SearchText;
} }
} }
@@ -150,6 +156,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
} }
@@ -159,6 +166,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
} }
@@ -168,6 +176,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
} }
@@ -177,6 +186,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DeleteStatus", true);
return _DeleteStatus; return _DeleteStatus;
} }
} }

View File

@@ -109,6 +109,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationID", true);
return _AnnotationID; return _AnnotationID;
} }
} }
@@ -118,6 +119,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ItemID", true);
if (_MyItem != null) _ItemID = _MyItem.ItemID; if (_MyItem != null) _ItemID = _MyItem.ItemID;
return _ItemID; return _ItemID;
} }
@@ -128,6 +130,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyItem", true);
if (_MyItem == null && _ItemID != 0) _MyItem = ItemInfo.Get(_ItemID); if (_MyItem == null && _ItemID != 0) _MyItem = ItemInfo.Get(_ItemID);
return _MyItem; return _MyItem;
} }
@@ -138,6 +141,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID; if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID;
return _TypeID; return _TypeID;
} }
@@ -148,6 +152,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyAnnotationType", true);
if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationTypeInfo.Get(_TypeID); if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationTypeInfo.Get(_TypeID);
return _MyAnnotationType; return _MyAnnotationType;
} }
@@ -158,6 +163,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RtfText", true);
return _RtfText; return _RtfText;
} }
} }
@@ -167,6 +173,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("SearchText", true);
return _SearchText; return _SearchText;
} }
} }
@@ -176,6 +183,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
} }
@@ -185,6 +193,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
} }
@@ -194,6 +203,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
} }

View File

@@ -129,6 +129,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
return _TypeID; return _TypeID;
} }
} }
@@ -138,11 +139,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Name", true);
return _Name; return _Name;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("Name", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_Name != value) if (_Name != value)
{ {
@@ -157,11 +160,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("Config", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_Config != value) if (_Config != value)
{ {
@@ -176,11 +181,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DTS", true);
if (_DTS != value) if (_DTS != value)
{ {
_DTS = value; _DTS = value;
@@ -194,11 +201,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("UserID", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_UserID != value) if (_UserID != value)
{ {
@@ -217,6 +226,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationTypeAnnotationCount", true);
return _AnnotationTypeAnnotationCount; return _AnnotationTypeAnnotationCount;
} }
} }
@@ -230,6 +240,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationTypeAnnotations", true);
if (_AnnotationTypeAnnotationCount < 0 || (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null)) if (_AnnotationTypeAnnotationCount < 0 || (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null))
_AnnotationTypeAnnotations = AnnotationTypeAnnotations.GetByTypeID(TypeID); _AnnotationTypeAnnotations = AnnotationTypeAnnotations.GetByTypeID(TypeID);
if (_AnnotationTypeAnnotationCount < 0 ) if (_AnnotationTypeAnnotationCount < 0 )

View File

@@ -43,6 +43,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationID", true);
if (_MyAnnotation != null) _AnnotationID = _MyAnnotation.AnnotationID; if (_MyAnnotation != null) _AnnotationID = _MyAnnotation.AnnotationID;
return _AnnotationID; return _AnnotationID;
} }
@@ -54,6 +55,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyAnnotation", true);
if (_MyAnnotation == null && _AnnotationID != 0) _MyAnnotation = Annotation.Get(_AnnotationID); if (_MyAnnotation == null && _AnnotationID != 0) _MyAnnotation = Annotation.Get(_AnnotationID);
return _MyAnnotation; return _MyAnnotation;
} }
@@ -64,6 +66,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("ItemID", true);
if (_MyItem != null) _ItemID = _MyItem.ItemID; if (_MyItem != null) _ItemID = _MyItem.ItemID;
return _ItemID; return _ItemID;
} }
@@ -74,12 +77,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyItem", true);
if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID);
return _MyItem; return _MyItem;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyItem", true);
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
@@ -94,11 +99,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RtfText", true);
return _RtfText; return _RtfText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("RtfText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_RtfText != value) if (_RtfText != value)
{ {
@@ -113,11 +120,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("SearchText", true);
return _SearchText; return _SearchText;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("SearchText", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_SearchText != value) if (_SearchText != value)
{ {
@@ -132,11 +141,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("Config", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_Config != value) if (_Config != value)
{ {
@@ -151,11 +162,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DTS", true);
if (_DTS != value) if (_DTS != value)
{ {
_DTS = value; _DTS = value;
@@ -169,11 +182,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("UserID", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_UserID != value) if (_UserID != value)
{ {
@@ -189,6 +204,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Item_PreviousID", true);
return _Item_PreviousID; return _Item_PreviousID;
} }
} }
@@ -198,6 +214,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Item_ContentID", true);
return _Item_ContentID; return _Item_ContentID;
} }
} }
@@ -207,6 +224,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Item_DTS", true);
return _Item_DTS; return _Item_DTS;
} }
} }
@@ -216,6 +234,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Item_UserID", true);
return _Item_UserID; return _Item_UserID;
} }
} }

View File

@@ -96,6 +96,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("TypeID", true);
return _TypeID; return _TypeID;
} }
} }
@@ -105,6 +106,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Name", true);
return _Name; return _Name;
} }
} }
@@ -114,6 +116,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Config", true);
return _Config; return _Config;
} }
} }
@@ -123,6 +126,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
} }
@@ -132,6 +136,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UserID", true);
return _UserID; return _UserID;
} }
} }
@@ -144,6 +149,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationTypeAnnotationCount", true);
if (_AnnotationTypeAnnotationCount < 0) if (_AnnotationTypeAnnotationCount < 0)
_AnnotationTypeAnnotationCount = AnnotationTypeAnnotations.Count; _AnnotationTypeAnnotationCount = AnnotationTypeAnnotations.Count;
return _AnnotationTypeAnnotationCount; return _AnnotationTypeAnnotationCount;
@@ -156,6 +162,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AnnotationTypeAnnotations", true);
if (_AnnotationTypeAnnotationCount < 0 || (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null)) if (_AnnotationTypeAnnotationCount < 0 || (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null))
_AnnotationTypeAnnotations = AnnotationInfoList.GetByTypeID(_TypeID); _AnnotationTypeAnnotations = AnnotationInfoList.GetByTypeID(_TypeID);
if (_AnnotationTypeAnnotationCount < 0) if (_AnnotationTypeAnnotationCount < 0)

View File

@@ -109,6 +109,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("AID", true);
return _AID; return _AID;
} }
} }
@@ -118,6 +119,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("GID", true);
if (_MyGroup != null) _GID = _MyGroup.GID; if (_MyGroup != null) _GID = _MyGroup.GID;
return _GID; return _GID;
} }
@@ -128,12 +130,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyGroup", true);
if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID);
return _MyGroup; return _MyGroup;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyGroup", true);
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
@@ -148,6 +152,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("RID", true);
if (_MyRole != null) _RID = _MyRole.RID; if (_MyRole != null) _RID = _MyRole.RID;
return _RID; return _RID;
} }
@@ -158,12 +163,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyRole", true);
if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID); if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID);
return _MyRole; return _MyRole;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyRole", true);
if (_MyRole != value) if (_MyRole != value)
{ {
_MyRole = value; _MyRole = value;
@@ -178,6 +185,7 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("FolderID", true);
if (_MyFolder != null) _FolderID = _MyFolder.FolderID; if (_MyFolder != null) _FolderID = _MyFolder.FolderID;
return _FolderID; return _FolderID;
} }
@@ -188,12 +196,14 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("MyFolder", true);
if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID);
return _MyFolder; return _MyFolder;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("MyFolder", true);
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
@@ -208,11 +218,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("StartDate", true);
return _StartDate; return _StartDate;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("StartDate", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
_StartDate = value; _StartDate = value;
try try
@@ -236,11 +248,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("EndDate", true);
return _EndDate; return _EndDate;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("EndDate", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
_EndDate = value; _EndDate = value;
try try
@@ -264,11 +278,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DTS", true);
return _DTS; return _DTS;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("DTS", true);
if (_DTS != value) if (_DTS != value)
{ {
_DTS = value; _DTS = value;
@@ -282,11 +298,13 @@ namespace VEPROMS.CSLA.Library
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("UsrID", true);
return _UsrID; return _UsrID;
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set set
{ {
CanWriteProperty("UsrID", true);
if (value == null) value = string.Empty; if (value == null) value = string.Empty;
if (_UsrID != value) if (_UsrID != value)
{ {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,424 +19,432 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void AssociationInfoEvent(object sender); public delegate void AssociationInfoEvent(object sender);
/// <summary> /// <summary>
/// AssociationInfo Generated by MyGeneration using the CSLA Object Mapping template /// AssociationInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(AssociationInfoConverter))] [TypeConverter(typeof(AssociationInfoConverter))]
public partial class AssociationInfo : ReadOnlyBase<AssociationInfo>, IDisposable public partial class AssociationInfo : ReadOnlyBase<AssociationInfo>, IDisposable
{ {
public event AssociationInfoEvent Changed; public event AssociationInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<AssociationInfo> _CacheList = new List<AssociationInfo>(); private static List<AssociationInfo> _CacheList = new List<AssociationInfo>();
protected static void AddToCache(AssociationInfo associationInfo) protected static void AddToCache(AssociationInfo associationInfo)
{ {
if (!_CacheList.Contains(associationInfo)) _CacheList.Add(associationInfo); // In AddToCache if (!_CacheList.Contains(associationInfo)) _CacheList.Add(associationInfo); // In AddToCache
} }
protected static void RemoveFromCache(AssociationInfo associationInfo) protected static void RemoveFromCache(AssociationInfo associationInfo)
{ {
while (_CacheList.Contains(associationInfo)) _CacheList.Remove(associationInfo); // In RemoveFromCache while (_CacheList.Contains(associationInfo)) _CacheList.Remove(associationInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<AssociationInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AssociationInfo>>(); private static Dictionary<string, List<AssociationInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AssociationInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move AssociationInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move AssociationInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
AssociationInfo tmp = _CacheList[0]; // Get the first AssociationInfo AssociationInfo tmp = _CacheList[0]; // Get the first AssociationInfo
string pKey = tmp.AssociationID.ToString(); string pKey = tmp.AssociationID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<AssociationInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<AssociationInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first AssociationInfo _CacheList.RemoveAt(0); // Remove the first AssociationInfo
} }
} }
internal static void AddList(AssociationInfoList lst) internal static void AddList(AssociationInfoList lst)
{ {
foreach (AssociationInfo item in lst) AddToCache(item); foreach (AssociationInfo item in lst) AddToCache(item);
} }
protected static AssociationInfo GetCachedByPrimaryKey(int associationID) protected static AssociationInfo GetCachedByPrimaryKey(int associationID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = associationID.ToString(); string key = associationID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Association _Editable; protected Association _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _AssociationID; private int _AssociationID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int AssociationID public int AssociationID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AssociationID; CanReadProperty("AssociationID", true);
} return _AssociationID;
} }
private int _VersionID; }
public int VersionID private int _VersionID;
{ public int VersionID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; {
return _VersionID; CanReadProperty("VersionID", true);
} if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID;
} return _VersionID;
private DocVersionInfo _MyDocVersion; }
public DocVersionInfo MyDocVersion }
{ private DocVersionInfo _MyDocVersion;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public DocVersionInfo MyDocVersion
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersionInfo.Get(_VersionID); get
return _MyDocVersion; {
} CanReadProperty("MyDocVersion", true);
} if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersionInfo.Get(_VersionID);
private int _ROFstID; return _MyDocVersion;
public int ROFstID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _ROFstID;
get public int ROFstID
{ {
if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _ROFstID; get
} {
} CanReadProperty("ROFstID", true);
private ROFstInfo _MyROFst; if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID;
public ROFstInfo MyROFst return _ROFstID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private ROFstInfo _MyROFst;
{ public ROFstInfo MyROFst
//if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); {
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.GetJustROFst(_ROFstID);// Improve performance by not loading all ROImages [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _MyROFst; get
} {
} CanReadProperty("MyROFst", true);
private string _Config = string.Empty; //if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
public string Config if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.GetJustROFst(_ROFstID);// Improve performance by not loading all ROImages
{ return _MyROFst;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
// CSLATODO: Replace base AssociationInfo.ToString function as necessary {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Overrides Base ToString get
/// </summary> {
/// <returns>A string representation of current AssociationInfo</returns> CanReadProperty("UserID", true);
//public override string ToString() return _UserID;
//{ }
// return base.ToString(); }
//} // CSLATODO: Replace base AssociationInfo.ToString function as necessary
// CSLATODO: Check AssociationInfo.GetIdValue to assure that the ID returned is unique /// <summary>
/// <summary> /// Overrides Base ToString
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// </summary>
/// </summary> /// <returns>A string representation of current AssociationInfo</returns>
/// <returns>A Unique ID for the current AssociationInfo</returns> //public override string ToString()
protected override object GetIdValue() //{
{ // return base.ToString();
return MyAssociationInfoUnique; // Absolutely Unique ID //}
} // CSLATODO: Check AssociationInfo.GetIdValue to assure that the ID returned is unique
#endregion /// <summary>
#region Factory Methods /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private static int _AssociationInfoUnique = 0; /// </summary>
private static int AssociationInfoUnique /// <returns>A Unique ID for the current AssociationInfo</returns>
{ get { return ++_AssociationInfoUnique; } } protected override object GetIdValue()
private int _MyAssociationInfoUnique = AssociationInfoUnique; {
public int MyAssociationInfoUnique // Absolutely Unique ID - Info return MyAssociationInfoUnique; // Absolutely Unique ID
{ get { return _MyAssociationInfoUnique; } } }
protected AssociationInfo() #endregion
{/* require use of factory methods */ #region Factory Methods
AddToCache(this); private static int _AssociationInfoUnique = 0;
} private static int AssociationInfoUnique
private bool _Disposed = false; { get { return ++_AssociationInfoUnique; } }
private static int _CountCreated = 0; private int _MyAssociationInfoUnique = AssociationInfoUnique;
private static int _CountDisposed = 0; public int MyAssociationInfoUnique // Absolutely Unique ID - Info
private static int _CountFinalized = 0; { get { return _MyAssociationInfoUnique; } }
private static int IncrementCountCreated protected AssociationInfo()
{ get { return ++_CountCreated; } } {/* require use of factory methods */
private int _CountWhenCreated = IncrementCountCreated; AddToCache(this);
public static int CountCreated }
{ get { return _CountCreated; } } private bool _Disposed = false;
public static int CountNotDisposed private static int _CountCreated = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountDisposed = 0;
public static int CountNotFinalized private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int IncrementCountCreated
~AssociationInfo() { get { return ++_CountCreated; } }
{ private int _CountWhenCreated = IncrementCountCreated;
_CountFinalized++; public static int CountCreated
} { get { return _CountCreated; } }
public void Dispose() public static int CountNotDisposed
{ { get { return _CountCreated - _CountDisposed; } }
if (_Disposed) return; public static int CountNotFinalized
_CountDisposed++; { get { return _CountCreated - _CountFinalized; } }
_Disposed = true; ~AssociationInfo()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(AssociationID.ToString())) return; _CountFinalized++;
List<AssociationInfo> listAssociationInfo = _CacheByPrimaryKey[AssociationID.ToString()]; // Get the list of items }
while (listAssociationInfo.Contains(this)) listAssociationInfo.Remove(this); // Remove the item from the list public void Dispose()
if (listAssociationInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(AssociationID.ToString()); // remove the list if (_Disposed) return;
} _CountDisposed++;
public virtual Association Get() _Disposed = true;
{ RemoveFromCache(this);
return _Editable = Association.Get(_AssociationID); if (!_CacheByPrimaryKey.ContainsKey(AssociationID.ToString())) return;
} List<AssociationInfo> listAssociationInfo = _CacheByPrimaryKey[AssociationID.ToString()]; // Get the list of items
public static void Refresh(Association tmp) while (listAssociationInfo.Contains(this)) listAssociationInfo.Remove(this); // Remove the item from the list
{ if (listAssociationInfo.Count == 0) // If there are no items left in the list
string key = tmp.AssociationID.ToString(); _CacheByPrimaryKey.Remove(AssociationID.ToString()); // remove the list
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) public virtual Association Get()
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) {
tmpInfo.RefreshFields(tmp); return _Editable = Association.Get(_AssociationID);
} }
protected virtual void RefreshFields(Association tmp) public static void Refresh(Association tmp)
{ {
if (_VersionID != tmp.VersionID) string key = tmp.AssociationID.ToString();
{ ConvertListToDictionary();
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_VersionID = tmp.VersionID; // Update the value foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyDocVersion = null; // Reset list so that the next line gets a new list }
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value protected virtual void RefreshFields(Association tmp)
if (_ROFstID != tmp.ROFstID) {
{ if (_VersionID != tmp.VersionID)
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value {
_ROFstID = tmp.ROFstID; // Update the value if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value
} _VersionID = tmp.VersionID; // Update the value
_MyROFst = null; // Reset list so that the next line gets a new list }
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value _MyDocVersion = null; // Reset list so that the next line gets a new list
_Config = tmp.Config; if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value
_DTS = tmp.DTS; if (_ROFstID != tmp.ROFstID)
_UserID = tmp.UserID; {
_AssociationInfoExtension.Refresh(this); if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value
OnChange();// raise an event _ROFstID = tmp.ROFstID; // Update the value
} }
public static void Refresh(DocVersionAssociation tmp) _MyROFst = null; // Reset list so that the next line gets a new list
{ if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value
string key = tmp.AssociationID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) _AssociationInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(DocVersionAssociation tmp) public static void Refresh(DocVersionAssociation tmp)
{ {
if (_ROFstID != tmp.ROFstID) string key = tmp.AssociationID.ToString();
{ ConvertListToDictionary();
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_ROFstID = tmp.ROFstID; // Update the value foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyROFst = null; // Reset list so that the next line gets a new list }
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value protected virtual void RefreshFields(DocVersionAssociation tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_ROFstID != tmp.ROFstID)
_UserID = tmp.UserID; {
_AssociationInfoExtension.Refresh(this); if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value
OnChange();// raise an event _ROFstID = tmp.ROFstID; // Update the value
} }
public static void Refresh(ROFstAssociation tmp) _MyROFst = null; // Reset list so that the next line gets a new list
{ if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value
string key = tmp.AssociationID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) _AssociationInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(ROFstAssociation tmp) public static void Refresh(ROFstAssociation tmp)
{ {
if (_VersionID != tmp.VersionID) string key = tmp.AssociationID.ToString();
{ ConvertListToDictionary();
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_VersionID = tmp.VersionID; // Update the value foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyDocVersion = null; // Reset list so that the next line gets a new list }
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value protected virtual void RefreshFields(ROFstAssociation tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_VersionID != tmp.VersionID)
_UserID = tmp.UserID; {
_AssociationInfoExtension.Refresh(this); if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value
OnChange();// raise an event _VersionID = tmp.VersionID; // Update the value
} }
public static AssociationInfo Get(int associationID) _MyDocVersion = null; // Reset list so that the next line gets a new list
{ if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value
//if (!CanGetObject()) _Config = tmp.Config;
// throw new System.Security.SecurityException("User not authorized to view a Association"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _AssociationInfoExtension.Refresh(this);
AssociationInfo tmp = GetCachedByPrimaryKey(associationID); OnChange();// raise an event
if (tmp == null) }
{ public static AssociationInfo Get(int associationID)
tmp = DataPortal.Fetch<AssociationInfo>(new PKCriteria(associationID)); {
AddToCache(tmp); //if (!CanGetObject())
} // throw new System.Security.SecurityException("User not authorized to view a Association");
if (tmp.ErrorMessage == "No Record Found") try
{ {
tmp.Dispose(); // Clean-up AssociationInfo AssociationInfo tmp = GetCachedByPrimaryKey(associationID);
tmp = null; if (tmp == null)
} {
return tmp; tmp = DataPortal.Fetch<AssociationInfo>(new PKCriteria(associationID));
} AddToCache(tmp);
catch (Exception ex) }
{ if (tmp.ErrorMessage == "No Record Found")
throw new DbCslaException("Error on AssociationInfo.Get", ex); {
} tmp.Dispose(); // Clean-up AssociationInfo
} tmp = null;
#endregion }
#region Data Access Portal return tmp;
internal AssociationInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.Constructor", GetHashCode()); {
try throw new DbCslaException("Error on AssociationInfo.Get", ex);
{ }
ReadData(dr); }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal AssociationInfo(SafeDataReader dr)
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.Constructor", ex); {
throw new DbCslaException("AssociationInfo.Constructor", ex); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.Constructor", GetHashCode());
} try
} {
[Serializable()] ReadData(dr);
protected class PKCriteria }
{ catch (Exception ex)
private int _AssociationID; {
public int AssociationID if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.Constructor", ex);
{ get { return _AssociationID; } } throw new DbCslaException("AssociationInfo.Constructor", ex);
public PKCriteria(int associationID) }
{ }
_AssociationID = associationID; [Serializable()]
} protected class PKCriteria
} {
private void ReadData(SafeDataReader dr) private int _AssociationID;
{ public int AssociationID
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.ReadData", GetHashCode()); { get { return _AssociationID; } }
try public PKCriteria(int associationID)
{ {
_AssociationID = dr.GetInt32("AssociationID"); _AssociationID = associationID;
_VersionID = dr.GetInt32("VersionID"); }
_ROFstID = dr.GetInt32("ROFstID"); }
_Config = dr.GetString("Config"); private void ReadData(SafeDataReader dr)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.ReadData", GetHashCode());
} try
catch (Exception ex) {
{ _AssociationID = dr.GetInt32("AssociationID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.ReadData", ex); _VersionID = dr.GetInt32("VersionID");
_ErrorMessage = ex.Message; _ROFstID = dr.GetInt32("ROFstID");
throw new DbCslaException("AssociationInfo.ReadData", ex); _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.DataPortal_Fetch", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
using (SqlConnection cn = Database.VEPROMS_SqlConnection) throw new DbCslaException("AssociationInfo.ReadData", ex);
{ }
ApplicationContext.LocalContext["cn"] = cn; }
using (SqlCommand cm = cn.CreateCommand()) private void DataPortal_Fetch(PKCriteria criteria)
{ {
cm.CommandType = CommandType.StoredProcedure; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.DataPortal_Fetch", GetHashCode());
cm.CommandText = "getAssociation"; try
cm.Parameters.AddWithValue("@AssociationID", criteria.AssociationID); {
cm.CommandTimeout = Database.DefaultTimeout; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ ApplicationContext.LocalContext["cn"] = cn;
if (!dr.Read()) using (SqlCommand cm = cn.CreateCommand())
{ {
_ErrorMessage = "No Record Found"; cm.CommandType = CommandType.StoredProcedure;
return; cm.CommandText = "getAssociation";
} cm.Parameters.AddWithValue("@AssociationID", criteria.AssociationID);
ReadData(dr); cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
} {
// removing of item only needed for local data portal if (!dr.Read())
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); _ErrorMessage = "No Record Found";
} return;
} }
catch (Exception ex) ReadData(dr);
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; // removing of item only needed for local data portal
throw new DbCslaException("AssociationInfo.DataPortal_Fetch", ex); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
} }
#endregion }
// Standard Refresh catch (Exception ex)
#region extension {
AssociationInfoExtension _AssociationInfoExtension = new AssociationInfoExtension(); if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
partial class AssociationInfoExtension : extensionBase { } throw new DbCslaException("AssociationInfo.DataPortal_Fetch", ex);
[Serializable()] }
class extensionBase }
{ #endregion
// Default Refresh // Standard Refresh
public virtual void Refresh(AssociationInfo tmp) { } #region extension
} AssociationInfoExtension _AssociationInfoExtension = new AssociationInfoExtension();
#endregion [Serializable()]
} // Class partial class AssociationInfoExtension : extensionBase { }
#region Converter [Serializable()]
internal class AssociationInfoConverter : ExpandableObjectConverter class extensionBase
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) // Default Refresh
{ public virtual void Refresh(AssociationInfo tmp) { }
if (destType == typeof(string) && value is AssociationInfo) }
{ #endregion
// Return the ToString value } // Class
return ((AssociationInfo)value).ToString(); #region Converter
} internal class AssociationInfoConverter : ExpandableObjectConverter
return base.ConvertTo(context, culture, value, destType); {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
} {
#endregion if (destType == typeof(string) && value is AssociationInfo)
{
// Return the ToString value
return ((AssociationInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -19,423 +19,431 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void CheckInfoEvent(object sender); public delegate void CheckInfoEvent(object sender);
/// <summary> /// <summary>
/// CheckInfo Generated by MyGeneration using the CSLA Object Mapping template /// CheckInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(CheckInfoConverter))] [TypeConverter(typeof(CheckInfoConverter))]
public partial class CheckInfo : ReadOnlyBase<CheckInfo>, IDisposable public partial class CheckInfo : ReadOnlyBase<CheckInfo>, IDisposable
{ {
public event CheckInfoEvent Changed; public event CheckInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<CheckInfo> _CacheList = new List<CheckInfo>(); private static List<CheckInfo> _CacheList = new List<CheckInfo>();
protected static void AddToCache(CheckInfo checkInfo) protected static void AddToCache(CheckInfo checkInfo)
{ {
if (!_CacheList.Contains(checkInfo)) _CacheList.Add(checkInfo); // In AddToCache if (!_CacheList.Contains(checkInfo)) _CacheList.Add(checkInfo); // In AddToCache
} }
protected static void RemoveFromCache(CheckInfo checkInfo) protected static void RemoveFromCache(CheckInfo checkInfo)
{ {
while (_CacheList.Contains(checkInfo)) _CacheList.Remove(checkInfo); // In RemoveFromCache while (_CacheList.Contains(checkInfo)) _CacheList.Remove(checkInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<CheckInfo>> _CacheByPrimaryKey = new Dictionary<string, List<CheckInfo>>(); private static Dictionary<string, List<CheckInfo>> _CacheByPrimaryKey = new Dictionary<string, List<CheckInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move CheckInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move CheckInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
CheckInfo tmp = _CacheList[0]; // Get the first CheckInfo CheckInfo tmp = _CacheList[0]; // Get the first CheckInfo
string pKey = tmp.CheckID.ToString(); string pKey = tmp.CheckID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<CheckInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<CheckInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first CheckInfo _CacheList.RemoveAt(0); // Remove the first CheckInfo
} }
} }
internal static void AddList(CheckInfoList lst) internal static void AddList(CheckInfoList lst)
{ {
foreach (CheckInfo item in lst) AddToCache(item); foreach (CheckInfo item in lst) AddToCache(item);
} }
protected static CheckInfo GetCachedByPrimaryKey(int checkID) protected static CheckInfo GetCachedByPrimaryKey(int checkID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = checkID.ToString(); string key = checkID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Check _Editable; protected Check _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _CheckID; private int _CheckID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int CheckID public int CheckID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _CheckID; CanReadProperty("CheckID", true);
} return _CheckID;
} }
private int _RevisionID; }
public int RevisionID private int _RevisionID;
{ public int RevisionID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyRevision != null) _RevisionID = _MyRevision.RevisionID; {
return _RevisionID; CanReadProperty("RevisionID", true);
} if (_MyRevision != null) _RevisionID = _MyRevision.RevisionID;
} return _RevisionID;
private RevisionInfo _MyRevision; }
public RevisionInfo MyRevision }
{ private RevisionInfo _MyRevision;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public RevisionInfo MyRevision
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyRevision == null && _RevisionID != 0) _MyRevision = RevisionInfo.Get(_RevisionID); get
return _MyRevision; {
} CanReadProperty("MyRevision", true);
} if (_MyRevision == null && _RevisionID != 0) _MyRevision = RevisionInfo.Get(_RevisionID);
private int _StageID; return _MyRevision;
public int StageID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _StageID;
get public int StageID
{ {
if (_MyStage != null) _StageID = _MyStage.StageID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _StageID; get
} {
} CanReadProperty("StageID", true);
private StageInfo _MyStage; if (_MyStage != null) _StageID = _MyStage.StageID;
public StageInfo MyStage return _StageID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private StageInfo _MyStage;
{ public StageInfo MyStage
if (_MyStage == null && _StageID != 0) _MyStage = StageInfo.GetJustStage(_StageID); {
return _MyStage; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _ConsistencyChecks = string.Empty; CanReadProperty("MyStage", true);
public string ConsistencyChecks if (_MyStage == null && _StageID != 0) _MyStage = StageInfo.GetJustStage(_StageID);
{ return _MyStage;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _ConsistencyChecks = string.Empty;
return _ConsistencyChecks; public string ConsistencyChecks
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("ConsistencyChecks", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _ConsistencyChecks;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
// CSLATODO: Replace base CheckInfo.ToString function as necessary {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Overrides Base ToString get
/// </summary> {
/// <returns>A string representation of current CheckInfo</returns> CanReadProperty("UserID", true);
//public override string ToString() return _UserID;
//{ }
// return base.ToString(); }
//} // CSLATODO: Replace base CheckInfo.ToString function as necessary
// CSLATODO: Check CheckInfo.GetIdValue to assure that the ID returned is unique /// <summary>
/// <summary> /// Overrides Base ToString
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// </summary>
/// </summary> /// <returns>A string representation of current CheckInfo</returns>
/// <returns>A Unique ID for the current CheckInfo</returns> //public override string ToString()
protected override object GetIdValue() //{
{ // return base.ToString();
return MyCheckInfoUnique; // Absolutely Unique ID //}
} // CSLATODO: Check CheckInfo.GetIdValue to assure that the ID returned is unique
#endregion /// <summary>
#region Factory Methods /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private static int _CheckInfoUnique = 0; /// </summary>
private static int CheckInfoUnique /// <returns>A Unique ID for the current CheckInfo</returns>
{ get { return ++_CheckInfoUnique; } } protected override object GetIdValue()
private int _MyCheckInfoUnique = CheckInfoUnique; {
public int MyCheckInfoUnique // Absolutely Unique ID - Info return MyCheckInfoUnique; // Absolutely Unique ID
{ get { return _MyCheckInfoUnique; } } }
protected CheckInfo() #endregion
{/* require use of factory methods */ #region Factory Methods
AddToCache(this); private static int _CheckInfoUnique = 0;
} private static int CheckInfoUnique
private bool _Disposed = false; { get { return ++_CheckInfoUnique; } }
private static int _CountCreated = 0; private int _MyCheckInfoUnique = CheckInfoUnique;
private static int _CountDisposed = 0; public int MyCheckInfoUnique // Absolutely Unique ID - Info
private static int _CountFinalized = 0; { get { return _MyCheckInfoUnique; } }
private static int IncrementCountCreated protected CheckInfo()
{ get { return ++_CountCreated; } } {/* require use of factory methods */
private int _CountWhenCreated = IncrementCountCreated; AddToCache(this);
public static int CountCreated }
{ get { return _CountCreated; } } private bool _Disposed = false;
public static int CountNotDisposed private static int _CountCreated = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountDisposed = 0;
public static int CountNotFinalized private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int IncrementCountCreated
~CheckInfo() { get { return ++_CountCreated; } }
{ private int _CountWhenCreated = IncrementCountCreated;
_CountFinalized++; public static int CountCreated
} { get { return _CountCreated; } }
public void Dispose() public static int CountNotDisposed
{ { get { return _CountCreated - _CountDisposed; } }
if (_Disposed) return; public static int CountNotFinalized
_CountDisposed++; { get { return _CountCreated - _CountFinalized; } }
_Disposed = true; ~CheckInfo()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) return; _CountFinalized++;
List<CheckInfo> listCheckInfo = _CacheByPrimaryKey[CheckID.ToString()]; // Get the list of items }
while (listCheckInfo.Contains(this)) listCheckInfo.Remove(this); // Remove the item from the list public void Dispose()
if (listCheckInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list if (_Disposed) return;
} _CountDisposed++;
public virtual Check Get() _Disposed = true;
{ RemoveFromCache(this);
return _Editable = Check.Get(_CheckID); if (!_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) return;
} List<CheckInfo> listCheckInfo = _CacheByPrimaryKey[CheckID.ToString()]; // Get the list of items
public static void Refresh(Check tmp) while (listCheckInfo.Contains(this)) listCheckInfo.Remove(this); // Remove the item from the list
{ if (listCheckInfo.Count == 0) // If there are no items left in the list
string key = tmp.CheckID.ToString(); _CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) public virtual Check Get()
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) {
tmpInfo.RefreshFields(tmp); return _Editable = Check.Get(_CheckID);
} }
protected virtual void RefreshFields(Check tmp) public static void Refresh(Check tmp)
{ {
if (_RevisionID != tmp.RevisionID) string key = tmp.CheckID.ToString();
{ ConvertListToDictionary();
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_RevisionID = tmp.RevisionID; // Update the value foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyRevision = null; // Reset list so that the next line gets a new list }
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value protected virtual void RefreshFields(Check tmp)
if (_StageID != tmp.StageID) {
{ if (_RevisionID != tmp.RevisionID)
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value {
_StageID = tmp.StageID; // Update the value if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value
} _RevisionID = tmp.RevisionID; // Update the value
_MyStage = null; // Reset list so that the next line gets a new list }
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value _MyRevision = null; // Reset list so that the next line gets a new list
_ConsistencyChecks = tmp.ConsistencyChecks; if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value
_DTS = tmp.DTS; if (_StageID != tmp.StageID)
_UserID = tmp.UserID; {
_CheckInfoExtension.Refresh(this); if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value
OnChange();// raise an event _StageID = tmp.StageID; // Update the value
} }
public static void Refresh(RevisionCheck tmp) _MyStage = null; // Reset list so that the next line gets a new list
{ if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value
string key = tmp.CheckID.ToString(); _ConsistencyChecks = tmp.ConsistencyChecks;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) _CheckInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(RevisionCheck tmp) public static void Refresh(RevisionCheck tmp)
{ {
if (_StageID != tmp.StageID) string key = tmp.CheckID.ToString();
{ ConvertListToDictionary();
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_StageID = tmp.StageID; // Update the value foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyStage = null; // Reset list so that the next line gets a new list }
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value protected virtual void RefreshFields(RevisionCheck tmp)
_ConsistencyChecks = tmp.ConsistencyChecks; {
_DTS = tmp.DTS; if (_StageID != tmp.StageID)
_UserID = tmp.UserID; {
_CheckInfoExtension.Refresh(this); if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value
OnChange();// raise an event _StageID = tmp.StageID; // Update the value
} }
public static void Refresh(StageCheck tmp) _MyStage = null; // Reset list so that the next line gets a new list
{ if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value
string key = tmp.CheckID.ToString(); _ConsistencyChecks = tmp.ConsistencyChecks;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) _CheckInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(StageCheck tmp) public static void Refresh(StageCheck tmp)
{ {
if (_RevisionID != tmp.RevisionID) string key = tmp.CheckID.ToString();
{ ConvertListToDictionary();
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_RevisionID = tmp.RevisionID; // Update the value foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyRevision = null; // Reset list so that the next line gets a new list }
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value protected virtual void RefreshFields(StageCheck tmp)
_ConsistencyChecks = tmp.ConsistencyChecks; {
_DTS = tmp.DTS; if (_RevisionID != tmp.RevisionID)
_UserID = tmp.UserID; {
_CheckInfoExtension.Refresh(this); if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value
OnChange();// raise an event _RevisionID = tmp.RevisionID; // Update the value
} }
public static CheckInfo Get(int checkID) _MyRevision = null; // Reset list so that the next line gets a new list
{ if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value
//if (!CanGetObject()) _ConsistencyChecks = tmp.ConsistencyChecks;
// throw new System.Security.SecurityException("User not authorized to view a Check"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _CheckInfoExtension.Refresh(this);
CheckInfo tmp = GetCachedByPrimaryKey(checkID); OnChange();// raise an event
if (tmp == null) }
{ public static CheckInfo Get(int checkID)
tmp = DataPortal.Fetch<CheckInfo>(new PKCriteria(checkID)); {
AddToCache(tmp); //if (!CanGetObject())
} // throw new System.Security.SecurityException("User not authorized to view a Check");
if (tmp.ErrorMessage == "No Record Found") try
{ {
tmp.Dispose(); // Clean-up CheckInfo CheckInfo tmp = GetCachedByPrimaryKey(checkID);
tmp = null; if (tmp == null)
} {
return tmp; tmp = DataPortal.Fetch<CheckInfo>(new PKCriteria(checkID));
} AddToCache(tmp);
catch (Exception ex) }
{ if (tmp.ErrorMessage == "No Record Found")
throw new DbCslaException("Error on CheckInfo.Get", ex); {
} tmp.Dispose(); // Clean-up CheckInfo
} tmp = null;
#endregion }
#region Data Access Portal return tmp;
internal CheckInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.Constructor", GetHashCode()); {
try throw new DbCslaException("Error on CheckInfo.Get", ex);
{ }
ReadData(dr); }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal CheckInfo(SafeDataReader dr)
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.Constructor", ex); {
throw new DbCslaException("CheckInfo.Constructor", ex); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.Constructor", GetHashCode());
} try
} {
[Serializable()] ReadData(dr);
protected class PKCriteria }
{ catch (Exception ex)
private int _CheckID; {
public int CheckID if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.Constructor", ex);
{ get { return _CheckID; } } throw new DbCslaException("CheckInfo.Constructor", ex);
public PKCriteria(int checkID) }
{ }
_CheckID = checkID; [Serializable()]
} protected class PKCriteria
} {
private void ReadData(SafeDataReader dr) private int _CheckID;
{ public int CheckID
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.ReadData", GetHashCode()); { get { return _CheckID; } }
try public PKCriteria(int checkID)
{ {
_CheckID = dr.GetInt32("CheckID"); _CheckID = checkID;
_RevisionID = dr.GetInt32("RevisionID"); }
_StageID = dr.GetInt32("StageID"); }
_ConsistencyChecks = dr.GetString("ConsistencyChecks"); private void ReadData(SafeDataReader dr)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.ReadData", GetHashCode());
} try
catch (Exception ex) {
{ _CheckID = dr.GetInt32("CheckID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.ReadData", ex); _RevisionID = dr.GetInt32("RevisionID");
_ErrorMessage = ex.Message; _StageID = dr.GetInt32("StageID");
throw new DbCslaException("CheckInfo.ReadData", ex); _ConsistencyChecks = dr.GetString("ConsistencyChecks");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.DataPortal_Fetch", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
using (SqlConnection cn = Database.VEPROMS_SqlConnection) throw new DbCslaException("CheckInfo.ReadData", ex);
{ }
ApplicationContext.LocalContext["cn"] = cn; }
using (SqlCommand cm = cn.CreateCommand()) private void DataPortal_Fetch(PKCriteria criteria)
{ {
cm.CommandType = CommandType.StoredProcedure; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.DataPortal_Fetch", GetHashCode());
cm.CommandText = "getCheck"; try
cm.Parameters.AddWithValue("@CheckID", criteria.CheckID); {
cm.CommandTimeout = Database.DefaultTimeout; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ ApplicationContext.LocalContext["cn"] = cn;
if (!dr.Read()) using (SqlCommand cm = cn.CreateCommand())
{ {
_ErrorMessage = "No Record Found"; cm.CommandType = CommandType.StoredProcedure;
return; cm.CommandText = "getCheck";
} cm.Parameters.AddWithValue("@CheckID", criteria.CheckID);
ReadData(dr); cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
} {
// removing of item only needed for local data portal if (!dr.Read())
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); _ErrorMessage = "No Record Found";
} return;
} }
catch (Exception ex) ReadData(dr);
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; // removing of item only needed for local data portal
throw new DbCslaException("CheckInfo.DataPortal_Fetch", ex); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
} }
#endregion }
// Standard Refresh catch (Exception ex)
#region extension {
CheckInfoExtension _CheckInfoExtension = new CheckInfoExtension(); if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
partial class CheckInfoExtension : extensionBase { } throw new DbCslaException("CheckInfo.DataPortal_Fetch", ex);
[Serializable()] }
class extensionBase }
{ #endregion
// Default Refresh // Standard Refresh
public virtual void Refresh(CheckInfo tmp) { } #region extension
} CheckInfoExtension _CheckInfoExtension = new CheckInfoExtension();
#endregion [Serializable()]
} // Class partial class CheckInfoExtension : extensionBase { }
#region Converter [Serializable()]
internal class CheckInfoConverter : ExpandableObjectConverter class extensionBase
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) // Default Refresh
{ public virtual void Refresh(CheckInfo tmp) { }
if (destType == typeof(string) && value is CheckInfo) }
{ #endregion
// Return the ToString value } // Class
return ((CheckInfo)value).ToString(); #region Converter
} internal class CheckInfoConverter : ExpandableObjectConverter
return base.ConvertTo(context, culture, value, destType); {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
} {
#endregion if (destType == typeof(string) && value is CheckInfo)
{
// Return the ToString value
return ((CheckInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,405 +19,415 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void ConnectionInfoEvent(object sender); public delegate void ConnectionInfoEvent(object sender);
/// <summary> /// <summary>
/// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template /// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ConnectionInfoConverter))] [TypeConverter(typeof(ConnectionInfoConverter))]
public partial class ConnectionInfo : ReadOnlyBase<ConnectionInfo>, IDisposable public partial class ConnectionInfo : ReadOnlyBase<ConnectionInfo>, IDisposable
{ {
public event ConnectionInfoEvent Changed; public event ConnectionInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<ConnectionInfo> _CacheList = new List<ConnectionInfo>(); private static List<ConnectionInfo> _CacheList = new List<ConnectionInfo>();
protected static void AddToCache(ConnectionInfo connectionInfo) protected static void AddToCache(ConnectionInfo connectionInfo)
{ {
if (!_CacheList.Contains(connectionInfo)) _CacheList.Add(connectionInfo); // In AddToCache if (!_CacheList.Contains(connectionInfo)) _CacheList.Add(connectionInfo); // In AddToCache
} }
protected static void RemoveFromCache(ConnectionInfo connectionInfo) protected static void RemoveFromCache(ConnectionInfo connectionInfo)
{ {
while (_CacheList.Contains(connectionInfo)) _CacheList.Remove(connectionInfo); // In RemoveFromCache while (_CacheList.Contains(connectionInfo)) _CacheList.Remove(connectionInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<ConnectionInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ConnectionInfo>>(); private static Dictionary<string, List<ConnectionInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ConnectionInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move ConnectionInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move ConnectionInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
ConnectionInfo tmp = _CacheList[0]; // Get the first ConnectionInfo ConnectionInfo tmp = _CacheList[0]; // Get the first ConnectionInfo
string pKey = tmp.DBID.ToString(); string pKey = tmp.DBID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<ConnectionInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<ConnectionInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first ConnectionInfo _CacheList.RemoveAt(0); // Remove the first ConnectionInfo
} }
} }
internal static void AddList(ConnectionInfoList lst) internal static void AddList(ConnectionInfoList lst)
{ {
foreach (ConnectionInfo item in lst) AddToCache(item); foreach (ConnectionInfo item in lst) AddToCache(item);
} }
protected static ConnectionInfo GetCachedByPrimaryKey(int dbid) protected static ConnectionInfo GetCachedByPrimaryKey(int dbid)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = dbid.ToString(); string key = dbid.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Connection _Editable; protected Connection _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _DBID; private int _DBID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DBID public int DBID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DBID; CanReadProperty("DBID", true);
} return _DBID;
} }
private string _Name = string.Empty; }
public string Name private string _Name = string.Empty;
{ public string Name
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _Name; {
} CanReadProperty("Name", true);
} return _Name;
private string _Title = string.Empty; }
public string Title }
{ private string _Title = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string Title
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _Title; get
} {
} CanReadProperty("Title", true);
private string _ConnectionString = string.Empty; return _Title;
public string ConnectionString }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _ConnectionString = string.Empty;
get public string ConnectionString
{ {
return _ConnectionString; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private int _ServerType; CanReadProperty("ConnectionString", true);
/// <summary> return _ConnectionString;
/// 0 SQL Server }
/// </summary> }
public int ServerType private int _ServerType;
{ /// <summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// 0 SQL Server
get /// </summary>
{ public int ServerType
return _ServerType; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _Config = string.Empty; {
public string Config CanReadProperty("ServerType", true);
{ return _ServerType;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UsrID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UsrID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UsrID; }
} private string _UsrID = string.Empty;
} public string UsrID
private int _ConnectionFolderCount = 0; {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Count of ConnectionFolders for this Connection get
/// </summary> {
public int ConnectionFolderCount CanReadProperty("UsrID", true);
{ return _UsrID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int _ConnectionFolderCount = 0;
if (_ConnectionFolderCount < 0) /// <summary>
_ConnectionFolderCount = ConnectionFolders.Count; /// Count of ConnectionFolders for this Connection
return _ConnectionFolderCount; /// </summary>
} public int ConnectionFolderCount
} {
private FolderInfoList _ConnectionFolders = null; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[TypeConverter(typeof(FolderInfoListConverter))] get
public FolderInfoList ConnectionFolders {
{ CanReadProperty("ConnectionFolderCount", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_ConnectionFolderCount < 0)
get _ConnectionFolderCount = ConnectionFolders.Count;
{ return _ConnectionFolderCount;
if (_ConnectionFolderCount < 0 || (_ConnectionFolderCount > 0 && _ConnectionFolders == null)) }
_ConnectionFolders = FolderInfoList.GetByDBID(_DBID); }
if (_ConnectionFolderCount < 0) private FolderInfoList _ConnectionFolders = null;
_ConnectionFolderCount = _ConnectionFolders.Count; [TypeConverter(typeof(FolderInfoListConverter))]
return _ConnectionFolders; public FolderInfoList ConnectionFolders
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public void RefreshConnectionFolders() get
{ {
_ConnectionFolderCount = -1; CanReadProperty("ConnectionFolders", true);
ConvertListToDictionary(); if (_ConnectionFolderCount < 0 || (_ConnectionFolderCount > 0 && _ConnectionFolders == null))
if (_CacheByPrimaryKey.ContainsKey(_DBID.ToString())) _ConnectionFolders = FolderInfoList.GetByDBID(_DBID);
foreach (ConnectionInfo tmp in _CacheByPrimaryKey[_DBID.ToString()]) if (_ConnectionFolderCount < 0)
tmp._ConnectionFolderCount = -1; // This will cause the data to be requeried _ConnectionFolderCount = _ConnectionFolders.Count;
} return _ConnectionFolders;
// CSLATODO: Replace base ConnectionInfo.ToString function as necessary }
/// <summary> }
/// Overrides Base ToString public void RefreshConnectionFolders()
/// </summary> {
/// <returns>A string representation of current ConnectionInfo</returns> _ConnectionFolderCount = -1;
//public override string ToString() ConvertListToDictionary();
//{ if (_CacheByPrimaryKey.ContainsKey(_DBID.ToString()))
// return base.ToString(); foreach (ConnectionInfo tmp in _CacheByPrimaryKey[_DBID.ToString()])
//} tmp._ConnectionFolderCount = -1; // This will cause the data to be requeried
// CSLATODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> // CSLATODO: Replace base ConnectionInfo.ToString function as necessary
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// <summary>
/// </summary> /// Overrides Base ToString
/// <returns>A Unique ID for the current ConnectionInfo</returns> /// </summary>
protected override object GetIdValue() /// <returns>A string representation of current ConnectionInfo</returns>
{ //public override string ToString()
return MyConnectionInfoUnique; // Absolutely Unique ID //{
} // return base.ToString();
#endregion //}
#region Factory Methods // CSLATODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique
private static int _ConnectionInfoUnique = 0; /// <summary>
private static int ConnectionInfoUnique /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
{ get { return ++_ConnectionInfoUnique; } } /// </summary>
private int _MyConnectionInfoUnique = ConnectionInfoUnique; /// <returns>A Unique ID for the current ConnectionInfo</returns>
public int MyConnectionInfoUnique // Absolutely Unique ID - Info protected override object GetIdValue()
{ get { return _MyConnectionInfoUnique; } } {
protected ConnectionInfo() return MyConnectionInfoUnique; // Absolutely Unique ID
{/* require use of factory methods */ }
AddToCache(this); #endregion
} #region Factory Methods
private bool _Disposed = false; private static int _ConnectionInfoUnique = 0;
private static int _CountCreated = 0; private static int ConnectionInfoUnique
private static int _CountDisposed = 0; { get { return ++_ConnectionInfoUnique; } }
private static int _CountFinalized = 0; private int _MyConnectionInfoUnique = ConnectionInfoUnique;
private static int IncrementCountCreated public int MyConnectionInfoUnique // Absolutely Unique ID - Info
{ get { return ++_CountCreated; } } { get { return _MyConnectionInfoUnique; } }
private int _CountWhenCreated = IncrementCountCreated; protected ConnectionInfo()
public static int CountCreated {/* require use of factory methods */
{ get { return _CountCreated; } } AddToCache(this);
public static int CountNotDisposed }
{ get { return _CountCreated - _CountDisposed; } } private bool _Disposed = false;
public static int CountNotFinalized private static int _CountCreated = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int _CountDisposed = 0;
~ConnectionInfo() private static int _CountFinalized = 0;
{ private static int IncrementCountCreated
_CountFinalized++; { get { return ++_CountCreated; } }
} private int _CountWhenCreated = IncrementCountCreated;
public void Dispose() public static int CountCreated
{ { get { return _CountCreated; } }
if (_Disposed) return; public static int CountNotDisposed
_CountDisposed++; { get { return _CountCreated - _CountDisposed; } }
_Disposed = true; public static int CountNotFinalized
RemoveFromCache(this); { get { return _CountCreated - _CountFinalized; } }
if (!_CacheByPrimaryKey.ContainsKey(DBID.ToString())) return; ~ConnectionInfo()
List<ConnectionInfo> listConnectionInfo = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items {
while (listConnectionInfo.Contains(this)) listConnectionInfo.Remove(this); // Remove the item from the list _CountFinalized++;
if (listConnectionInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list public void Dispose()
} {
public virtual Connection Get() if (_Disposed) return;
{ _CountDisposed++;
return _Editable = Connection.Get(_DBID); _Disposed = true;
} RemoveFromCache(this);
public static void Refresh(Connection tmp) if (!_CacheByPrimaryKey.ContainsKey(DBID.ToString())) return;
{ List<ConnectionInfo> listConnectionInfo = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items
string key = tmp.DBID.ToString(); while (listConnectionInfo.Contains(this)) listConnectionInfo.Remove(this); // Remove the item from the list
ConvertListToDictionary(); if (listConnectionInfo.Count == 0) // If there are no items left in the list
if (_CacheByPrimaryKey.ContainsKey(key)) _CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list
foreach (ConnectionInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public virtual Connection Get()
} {
protected virtual void RefreshFields(Connection tmp) return _Editable = Connection.Get(_DBID);
{ }
_Name = tmp.Name; public static void Refresh(Connection tmp)
_Title = tmp.Title; {
_ConnectionString = tmp.ConnectionString; string key = tmp.DBID.ToString();
_ServerType = tmp.ServerType; ConvertListToDictionary();
_Config = tmp.Config; if (_CacheByPrimaryKey.ContainsKey(key))
_DTS = tmp.DTS; foreach (ConnectionInfo tmpInfo in _CacheByPrimaryKey[key])
_UsrID = tmp.UsrID; tmpInfo.RefreshFields(tmp);
_ConnectionInfoExtension.Refresh(this); }
OnChange();// raise an event protected virtual void RefreshFields(Connection tmp)
} {
public static ConnectionInfo Get(int dbid) _Name = tmp.Name;
{ _Title = tmp.Title;
//if (!CanGetObject()) _ConnectionString = tmp.ConnectionString;
// throw new System.Security.SecurityException("User not authorized to view a Connection"); _ServerType = tmp.ServerType;
try _Config = tmp.Config;
{ _DTS = tmp.DTS;
ConnectionInfo tmp = GetCachedByPrimaryKey(dbid); _UsrID = tmp.UsrID;
if (tmp == null) _ConnectionInfoExtension.Refresh(this);
{ OnChange();// raise an event
tmp = DataPortal.Fetch<ConnectionInfo>(new PKCriteria(dbid)); }
AddToCache(tmp); public static ConnectionInfo Get(int dbid)
} {
if (tmp.ErrorMessage == "No Record Found") //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a Connection");
tmp.Dispose(); // Clean-up ConnectionInfo try
tmp = null; {
} ConnectionInfo tmp = GetCachedByPrimaryKey(dbid);
return tmp; if (tmp == null)
} {
catch (Exception ex) tmp = DataPortal.Fetch<ConnectionInfo>(new PKCriteria(dbid));
{ AddToCache(tmp);
throw new DbCslaException("Error on ConnectionInfo.Get", ex); }
} if (tmp.ErrorMessage == "No Record Found")
} {
#endregion tmp.Dispose(); // Clean-up ConnectionInfo
#region Data Access Portal tmp = null;
internal ConnectionInfo(SafeDataReader dr) }
{ return tmp;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.Constructor", GetHashCode()); }
try catch (Exception ex)
{ {
ReadData(dr); throw new DbCslaException("Error on ConnectionInfo.Get", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.Constructor", ex); #region Data Access Portal
throw new DbCslaException("ConnectionInfo.Constructor", ex); internal ConnectionInfo(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.Constructor", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ ReadData(dr);
private int _DBID; }
public int DBID catch (Exception ex)
{ get { return _DBID; } } {
public PKCriteria(int dbid) if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.Constructor", ex);
{ throw new DbCslaException("ConnectionInfo.Constructor", ex);
_DBID = dbid; }
} }
} [Serializable()]
private void ReadData(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.ReadData", GetHashCode()); private int _DBID;
try public int DBID
{ { get { return _DBID; } }
_DBID = dr.GetInt32("DBID"); public PKCriteria(int dbid)
_Name = dr.GetString("Name"); {
_Title = dr.GetString("Title"); _DBID = dbid;
_ConnectionString = dr.GetString("ConnectionString"); }
_ServerType = dr.GetInt32("ServerType"); }
_Config = dr.GetString("Config"); private void ReadData(SafeDataReader dr)
_DTS = dr.GetDateTime("DTS"); {
_UsrID = dr.GetString("UsrID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.ReadData", GetHashCode());
_ConnectionFolderCount = dr.GetInt32("FolderCount"); try
} {
catch (Exception ex) _DBID = dr.GetInt32("DBID");
{ _Name = dr.GetString("Name");
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.ReadData", ex); _Title = dr.GetString("Title");
_ErrorMessage = ex.Message; _ConnectionString = dr.GetString("ConnectionString");
throw new DbCslaException("ConnectionInfo.ReadData", ex); _ServerType = dr.GetInt32("ServerType");
} _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
private void DataPortal_Fetch(PKCriteria criteria) _UsrID = dr.GetString("UsrID");
{ _ConnectionFolderCount = dr.GetInt32("FolderCount");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.DataPortal_Fetch", GetHashCode()); }
try catch (Exception ex)
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
ApplicationContext.LocalContext["cn"] = cn; throw new DbCslaException("ConnectionInfo.ReadData", ex);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandText = "getConnection"; {
cm.Parameters.AddWithValue("@DBID", criteria.DBID); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.DataPortal_Fetch", GetHashCode());
cm.CommandTimeout = Database.DefaultTimeout; try
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ using (SqlConnection cn = Database.VEPROMS_SqlConnection)
if (!dr.Read()) {
{ ApplicationContext.LocalContext["cn"] = cn;
_ErrorMessage = "No Record Found"; using (SqlCommand cm = cn.CreateCommand())
return; {
} cm.CommandType = CommandType.StoredProcedure;
ReadData(dr); cm.CommandText = "getConnection";
} cm.Parameters.AddWithValue("@DBID", criteria.DBID);
} cm.CommandTimeout = Database.DefaultTimeout;
// removing of item only needed for local data portal using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); if (!dr.Read())
} {
} _ErrorMessage = "No Record Found";
catch (Exception ex) return;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.DataPortal_Fetch", ex); ReadData(dr);
_ErrorMessage = ex.Message; }
throw new DbCslaException("ConnectionInfo.DataPortal_Fetch", ex); }
} // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
#endregion ApplicationContext.LocalContext.Remove("cn");
// Standard Refresh }
#region extension }
ConnectionInfoExtension _ConnectionInfoExtension = new ConnectionInfoExtension(); catch (Exception ex)
[Serializable()] {
partial class ConnectionInfoExtension : extensionBase { } if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
class extensionBase throw new DbCslaException("ConnectionInfo.DataPortal_Fetch", ex);
{ }
// Default Refresh }
public virtual void Refresh(ConnectionInfo tmp) { } #endregion
} // Standard Refresh
#endregion #region extension
} // Class ConnectionInfoExtension _ConnectionInfoExtension = new ConnectionInfoExtension();
#region Converter [Serializable()]
internal class ConnectionInfoConverter : ExpandableObjectConverter partial class ConnectionInfoExtension : extensionBase { }
{ [Serializable()]
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) class extensionBase
{ {
if (destType == typeof(string) && value is ConnectionInfo) // Default Refresh
{ public virtual void Refresh(ConnectionInfo tmp) { }
// Return the ToString value }
return ((ConnectionInfo)value).ToString(); #endregion
} } // Class
return base.ConvertTo(context, culture, value, destType); #region Converter
} internal class ConnectionInfoConverter : ExpandableObjectConverter
} {
#endregion public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is ConnectionInfo)
{
// Return the ToString value
return ((ConnectionInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,387 +19,397 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void ContentAuditInfoEvent(object sender); public delegate void ContentAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// ContentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// ContentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ContentAuditInfoConverter))] [TypeConverter(typeof(ContentAuditInfoConverter))]
public partial class ContentAuditInfo : ReadOnlyBase<ContentAuditInfo>, IDisposable public partial class ContentAuditInfo : ReadOnlyBase<ContentAuditInfo>, IDisposable
{ {
public event ContentAuditInfoEvent Changed; public event ContentAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<ContentAuditInfo> _CacheList = new List<ContentAuditInfo>(); private static List<ContentAuditInfo> _CacheList = new List<ContentAuditInfo>();
protected static void AddToCache(ContentAuditInfo contentAuditInfo) protected static void AddToCache(ContentAuditInfo contentAuditInfo)
{ {
if (!_CacheList.Contains(contentAuditInfo)) _CacheList.Add(contentAuditInfo); // In AddToCache if (!_CacheList.Contains(contentAuditInfo)) _CacheList.Add(contentAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(ContentAuditInfo contentAuditInfo) protected static void RemoveFromCache(ContentAuditInfo contentAuditInfo)
{ {
while (_CacheList.Contains(contentAuditInfo)) _CacheList.Remove(contentAuditInfo); // In RemoveFromCache while (_CacheList.Contains(contentAuditInfo)) _CacheList.Remove(contentAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<ContentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ContentAuditInfo>>(); private static Dictionary<string, List<ContentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ContentAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move ContentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move ContentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
ContentAuditInfo tmp = _CacheList[0]; // Get the first ContentAuditInfo ContentAuditInfo tmp = _CacheList[0]; // Get the first ContentAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<ContentAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<ContentAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first ContentAuditInfo _CacheList.RemoveAt(0); // Remove the first ContentAuditInfo
} }
} }
internal static void AddList(ContentAuditInfoList lst) internal static void AddList(ContentAuditInfoList lst)
{ {
foreach (ContentAuditInfo item in lst) AddToCache(item); foreach (ContentAuditInfo item in lst) AddToCache(item);
} }
protected static ContentAuditInfo GetCachedByPrimaryKey(long auditID) protected static ContentAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected ContentAudit _Editable; protected ContentAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _ContentID; }
public int ContentID private int _ContentID;
{ public int ContentID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _ContentID; {
} CanReadProperty("ContentID", true);
} return _ContentID;
private string _Number = string.Empty; }
public string Number }
{ private string _Number = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string Number
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _Number; get
} {
} CanReadProperty("Number", true);
private string _Text = string.Empty; return _Number;
public string Text }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _Text = string.Empty;
get public string Text
{ {
return _Text; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private int? _Type; CanReadProperty("Text", true);
public int? Type return _Text;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private int? _Type;
{ public int? Type
return _Type; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int? _FormatID; {
public int? FormatID CanReadProperty("Type", true);
{ return _Type;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int? _FormatID;
return _FormatID; public int? FormatID
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _Config = string.Empty; get
public string Config {
{ CanReadProperty("FormatID", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _FormatID;
get }
{ }
return _Config; private string _Config = string.Empty;
} public string Config
} {
private DateTime _DTS = new DateTime(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public DateTime DTS get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("Config", true);
get return _Config;
{ }
return _DTS; }
} private DateTime _DTS = new DateTime();
} public DateTime DTS
private string _UserID = string.Empty; {
public string UserID [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("DTS", true);
{ return _DTS;
return _UserID; }
} }
} private string _UserID = string.Empty;
private int _DeleteStatus; public string UserID
public int DeleteStatus {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("UserID", true);
return _DeleteStatus; return _UserID;
} }
} }
// CSLATODO: Replace base ContentAuditInfo.ToString function as necessary private int _DeleteStatus;
/// <summary> public int DeleteStatus
/// Overrides Base ToString {
/// </summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <returns>A string representation of current ContentAuditInfo</returns> get
//public override string ToString() {
//{ CanReadProperty("DeleteStatus", true);
// return base.ToString(); return _DeleteStatus;
//} }
// CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> // CSLATODO: Replace base ContentAuditInfo.ToString function as necessary
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// <summary>
/// </summary> /// Overrides Base ToString
/// <returns>A Unique ID for the current ContentAuditInfo</returns> /// </summary>
protected override object GetIdValue() /// <returns>A string representation of current ContentAuditInfo</returns>
{ //public override string ToString()
return MyContentAuditInfoUnique; // Absolutely Unique ID //{
} // return base.ToString();
#endregion //}
#region Factory Methods // CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique
private static int _ContentAuditInfoUnique = 0; /// <summary>
private static int ContentAuditInfoUnique /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
{ get { return ++_ContentAuditInfoUnique; } } /// </summary>
private int _MyContentAuditInfoUnique = ContentAuditInfoUnique; /// <returns>A Unique ID for the current ContentAuditInfo</returns>
public int MyContentAuditInfoUnique // Absolutely Unique ID - Info protected override object GetIdValue()
{ get { return _MyContentAuditInfoUnique; } } {
protected ContentAuditInfo() return MyContentAuditInfoUnique; // Absolutely Unique ID
{/* require use of factory methods */ }
AddToCache(this); #endregion
} #region Factory Methods
private bool _Disposed = false; private static int _ContentAuditInfoUnique = 0;
private static int _CountCreated = 0; private static int ContentAuditInfoUnique
private static int _CountDisposed = 0; { get { return ++_ContentAuditInfoUnique; } }
private static int _CountFinalized = 0; private int _MyContentAuditInfoUnique = ContentAuditInfoUnique;
private static int IncrementCountCreated public int MyContentAuditInfoUnique // Absolutely Unique ID - Info
{ get { return ++_CountCreated; } } { get { return _MyContentAuditInfoUnique; } }
private int _CountWhenCreated = IncrementCountCreated; protected ContentAuditInfo()
public static int CountCreated {/* require use of factory methods */
{ get { return _CountCreated; } } AddToCache(this);
public static int CountNotDisposed }
{ get { return _CountCreated - _CountDisposed; } } private bool _Disposed = false;
public static int CountNotFinalized private static int _CountCreated = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int _CountDisposed = 0;
~ContentAuditInfo() private static int _CountFinalized = 0;
{ private static int IncrementCountCreated
_CountFinalized++; { get { return ++_CountCreated; } }
} private int _CountWhenCreated = IncrementCountCreated;
public void Dispose() public static int CountCreated
{ { get { return _CountCreated; } }
if (_Disposed) return; public static int CountNotDisposed
_CountDisposed++; { get { return _CountCreated - _CountDisposed; } }
_Disposed = true; public static int CountNotFinalized
RemoveFromCache(this); { get { return _CountCreated - _CountFinalized; } }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; ~ContentAuditInfo()
List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list _CountFinalized++;
if (listContentAuditInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list public void Dispose()
} {
public virtual ContentAudit Get() if (_Disposed) return;
{ _CountDisposed++;
return _Editable = ContentAudit.Get(_AuditID); _Disposed = true;
} RemoveFromCache(this);
public static void Refresh(ContentAudit tmp) if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
string key = tmp.AuditID.ToString(); while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list
ConvertListToDictionary(); if (listContentAuditInfo.Count == 0) // If there are no items left in the list
if (_CacheByPrimaryKey.ContainsKey(key)) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public virtual ContentAudit Get()
} {
protected virtual void RefreshFields(ContentAudit tmp) return _Editable = ContentAudit.Get(_AuditID);
{ }
_ContentID = tmp.ContentID; public static void Refresh(ContentAudit tmp)
_Number = tmp.Number; {
_Text = tmp.Text; string key = tmp.AuditID.ToString();
_Type = tmp.Type; ConvertListToDictionary();
_FormatID = tmp.FormatID; if (_CacheByPrimaryKey.ContainsKey(key))
_Config = tmp.Config; foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_DTS = tmp.DTS; tmpInfo.RefreshFields(tmp);
_UserID = tmp.UserID; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(ContentAudit tmp)
_ContentAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _ContentID = tmp.ContentID;
} _Number = tmp.Number;
public static ContentAuditInfo Get(long auditID) _Text = tmp.Text;
{ _Type = tmp.Type;
//if (!CanGetObject()) _FormatID = tmp.FormatID;
// throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); _Config = tmp.Config;
try _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID); _DeleteStatus = tmp.DeleteStatus;
if (tmp == null) _ContentAuditInfoExtension.Refresh(this);
{ OnChange();// raise an event
tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID)); }
AddToCache(tmp); public static ContentAuditInfo Get(long auditID)
} {
if (tmp.ErrorMessage == "No Record Found") //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a ContentAudit");
tmp.Dispose(); // Clean-up ContentAuditInfo try
tmp = null; {
} ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
return tmp; if (tmp == null)
} {
catch (Exception ex) tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID));
{ AddToCache(tmp);
throw new DbCslaException("Error on ContentAuditInfo.Get", ex); }
} if (tmp.ErrorMessage == "No Record Found")
} {
#endregion tmp.Dispose(); // Clean-up ContentAuditInfo
#region Data Access Portal tmp = null;
internal ContentAuditInfo(SafeDataReader dr) }
{ return tmp;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode()); }
try catch (Exception ex)
{ {
ReadData(dr); throw new DbCslaException("Error on ContentAuditInfo.Get", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex); #region Data Access Portal
throw new DbCslaException("ContentAuditInfo.Constructor", ex); internal ContentAuditInfo(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ ReadData(dr);
private long _AuditID; }
public long AuditID catch (Exception ex)
{ get { return _AuditID; } } {
public PKCriteria(long auditID) if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex);
{ throw new DbCslaException("ContentAuditInfo.Constructor", ex);
_AuditID = auditID; }
} }
} [Serializable()]
private void ReadData(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode()); private long _AuditID;
try public long AuditID
{ { get { return _AuditID; } }
_AuditID = dr.GetInt64("AuditID"); public PKCriteria(long auditID)
_ContentID = dr.GetInt32("ContentID"); {
_Number = dr.GetString("Number"); _AuditID = auditID;
_Text = dr.GetString("Text"); }
_Type = (int?)dr.GetValue("Type"); }
_FormatID = (int?)dr.GetValue("FormatID"); private void ReadData(SafeDataReader dr)
_Config = dr.GetString("Config"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode());
_UserID = dr.GetString("UserID"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _ContentID = dr.GetInt32("ContentID");
{ _Number = dr.GetString("Number");
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex); _Text = dr.GetString("Text");
_ErrorMessage = ex.Message; _Type = (int?)dr.GetValue("Type");
throw new DbCslaException("ContentAuditInfo.ReadData", ex); _FormatID = (int?)dr.GetValue("FormatID");
} _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
private void DataPortal_Fetch(PKCriteria criteria) _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode()); }
try catch (Exception ex)
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
ApplicationContext.LocalContext["cn"] = cn; throw new DbCslaException("ContentAuditInfo.ReadData", ex);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandText = "getContentAudit"; {
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode());
cm.CommandTimeout = Database.DefaultTimeout; try
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ using (SqlConnection cn = Database.VEPROMS_SqlConnection)
if (!dr.Read()) {
{ ApplicationContext.LocalContext["cn"] = cn;
_ErrorMessage = "No Record Found"; using (SqlCommand cm = cn.CreateCommand())
return; {
} cm.CommandType = CommandType.StoredProcedure;
ReadData(dr); cm.CommandText = "getContentAudit";
} cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
} cm.CommandTimeout = Database.DefaultTimeout;
// removing of item only needed for local data portal using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); if (!dr.Read())
} {
} _ErrorMessage = "No Record Found";
catch (Exception ex) return;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex); ReadData(dr);
_ErrorMessage = ex.Message; }
throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex); }
} // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
#endregion ApplicationContext.LocalContext.Remove("cn");
// Standard Refresh }
#region extension }
ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension(); catch (Exception ex)
[Serializable()] {
partial class ContentAuditInfoExtension : extensionBase { } if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
class extensionBase throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex);
{ }
// Default Refresh }
public virtual void Refresh(ContentAuditInfo tmp) { } #endregion
} // Standard Refresh
#endregion #region extension
} // Class ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension();
#region Converter [Serializable()]
internal class ContentAuditInfoConverter : ExpandableObjectConverter partial class ContentAuditInfoExtension : extensionBase { }
{ [Serializable()]
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) class extensionBase
{ {
if (destType == typeof(string) && value is ContentAuditInfo) // Default Refresh
{ public virtual void Refresh(ContentAuditInfo tmp) { }
// Return the ToString value }
return ((ContentAuditInfo)value).ToString(); #endregion
} } // Class
return base.ConvertTo(context, culture, value, destType); #region Converter
} internal class ContentAuditInfoConverter : ExpandableObjectConverter
} {
#endregion public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is ContentAuditInfo)
{
// Return the ToString value
return ((ContentAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -20,444 +20,456 @@ using System.Collections.Generic;
using Csla.Validation; using Csla.Validation;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
/// <summary> /// <summary>
/// ContentDetail Generated by MyGeneration using the CSLA Object Mapping template /// ContentDetail Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ContentDetailConverter))] [TypeConverter(typeof(ContentDetailConverter))]
public partial class ContentDetail : BusinessBase<ContentDetail>, IVEHasBrokenRules, IDisposable public partial class ContentDetail : BusinessBase<ContentDetail>, IVEHasBrokenRules, IDisposable
{ {
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
private int _DetailID; private int _DetailID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DetailID public int DetailID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
if (_MyDetail != null) _DetailID = _MyDetail.DetailID; CanReadProperty("DetailID", true);
return _DetailID; if (_MyDetail != null) _DetailID = _MyDetail.DetailID;
} return _DetailID;
} }
private Detail _MyDetail; }
[System.ComponentModel.DataObjectField(true, true)] private Detail _MyDetail;
public Detail MyDetail [System.ComponentModel.DataObjectField(true, true)]
{ public Detail MyDetail
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyDetail == null && _DetailID != 0) _MyDetail = Detail.Get(_DetailID); {
return _MyDetail; CanReadProperty("MyDetail", true);
} if (_MyDetail == null && _DetailID != 0) _MyDetail = Detail.Get(_DetailID);
} return _MyDetail;
private int _ItemType; }
public int ItemType }
{ private int _ItemType;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int ItemType
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _ItemType; get
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("ItemType", true);
set return _ItemType;
{ }
if (_ItemType != value) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
_ItemType = value; {
PropertyHasChanged(); CanWriteProperty("ItemType", true);
} if (_ItemType != value)
} {
} _ItemType = value;
private string _Text = string.Empty; PropertyHasChanged();
public string Text }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Text = string.Empty;
{ public string Text
return _Text; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
set {
{ CanReadProperty("Text", true);
if (value == null) value = string.Empty; return _Text;
if (_Text != value) }
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_Text = value; set
PropertyHasChanged(); {
} CanWriteProperty("Text", true);
} if (value == null) value = string.Empty;
} if (_Text != value)
private string _Config = string.Empty; {
public string Config _Text = value;
{ PropertyHasChanged();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ }
return _Config; private string _Config = string.Empty;
} public string Config
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
set [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (value == null) value = string.Empty; {
if (_Config != value) CanReadProperty("Config", true);
{ return _Config;
_Config = value; }
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
} {
} CanWriteProperty("Config", true);
private DateTime _DTS = new DateTime(); if (value == null) value = string.Empty;
public DateTime DTS if (_Config != value)
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] _Config = value;
get PropertyHasChanged();
{ }
return _DTS; }
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private DateTime _DTS = new DateTime();
set public DateTime DTS
{ {
if (_DTS != value) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
_DTS = value; {
PropertyHasChanged(); CanReadProperty("DTS", true);
} return _DTS;
} }
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _UserID = string.Empty; set
public string UserID {
{ CanWriteProperty("DTS", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_DTS != value)
get {
{ _DTS = value;
return _UserID; PropertyHasChanged();
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
set }
{ private string _UserID = string.Empty;
if (value == null) value = string.Empty; public string UserID
if (_UserID != value) {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_UserID = value; get
PropertyHasChanged(); {
} CanReadProperty("UserID", true);
} return _UserID;
} }
private byte[] _LastChanged = new byte[8];//timestamp [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
// CSLATODO: Check ContentDetail.GetIdValue to assure that the ID returned is unique set
/// <summary> {
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality CanWriteProperty("UserID", true);
/// </summary> if (value == null) value = string.Empty;
/// <returns>A Unique ID for the current ContentDetail</returns> if (_UserID != value)
protected override object GetIdValue() {
{ _UserID = value;
return MyContentDetailUnique; // Absolutely Unique ID PropertyHasChanged();
} }
// CSLATODO: Replace base ContentDetail.ToString function as necessary }
/// <summary> }
/// Overrides Base ToString private byte[] _LastChanged = new byte[8];//timestamp
/// </summary> // CSLATODO: Check ContentDetail.GetIdValue to assure that the ID returned is unique
/// <returns>A string representation of current ContentDetail</returns> /// <summary>
//public override string ToString() /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
//{ /// </summary>
// return base.ToString(); /// <returns>A Unique ID for the current ContentDetail</returns>
//} protected override object GetIdValue()
public override bool IsDirty {
{ return MyContentDetailUnique; // Absolutely Unique ID
get { return base.IsDirty; } }
} // CSLATODO: Replace base ContentDetail.ToString function as necessary
public bool IsDirtyList(List<object> list) /// <summary>
{ /// Overrides Base ToString
return base.IsDirty; /// </summary>
} /// <returns>A string representation of current ContentDetail</returns>
public override bool IsValid //public override string ToString()
{ //{
get { return (IsNew && !IsDirty) ? true : base.IsValid; } // return base.ToString();
} //}
public bool IsValidList(List<object> list) public override bool IsDirty
{ {
return (IsNew && !IsDirty) ? true : base.IsValid; get { return base.IsDirty; }
} }
#endregion public bool IsDirtyList(List<object> list)
#region ValidationRules {
[NonSerialized] return base.IsDirty;
private bool _CheckingBrokenRules = false; }
public IVEHasBrokenRules HasBrokenRules public override bool IsValid
{ {
get get { return (IsNew && !IsDirty) ? true : base.IsValid; }
{ }
if (_CheckingBrokenRules) return null; public bool IsValidList(List<object> list)
if (BrokenRulesCollection.Count > 0) return this; {
try return (IsNew && !IsDirty) ? true : base.IsValid;
{ }
_CheckingBrokenRules = true; #endregion
IVEHasBrokenRules hasBrokenRules = null; #region ValidationRules
return hasBrokenRules; [NonSerialized]
} private bool _CheckingBrokenRules = false;
finally public IVEHasBrokenRules HasBrokenRules
{ {
_CheckingBrokenRules = false; get
} {
} if (_CheckingBrokenRules) return null;
} if (BrokenRulesCollection.Count > 0) return this;
public BrokenRulesCollection BrokenRules try
{ {
get _CheckingBrokenRules = true;
{ IVEHasBrokenRules hasBrokenRules = null;
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; return hasBrokenRules;
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; }
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); finally
} {
} _CheckingBrokenRules = false;
protected override void AddBusinessRules() }
{ }
ValidationRules.AddRule( }
Csla.Validation.CommonRules.StringRequired, "Text"); public BrokenRulesCollection BrokenRules
ValidationRules.AddRule( {
Csla.Validation.CommonRules.StringMaxLength, get
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); {
ValidationRules.AddRule( IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
Csla.Validation.CommonRules.StringMaxLength, if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
ValidationRules.AddRule( }
Csla.Validation.CommonRules.StringRequired, "UserID"); }
ValidationRules.AddRule( protected override void AddBusinessRules()
Csla.Validation.CommonRules.StringMaxLength, {
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); ValidationRules.AddRule(
// CSLATODO: Add other validation rules Csla.Validation.CommonRules.StringRequired, "Text");
} ValidationRules.AddRule(
// Sample data comparison validation rule Csla.Validation.CommonRules.StringMaxLength,
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823));
//{ ValidationRules.AddRule(
// if (_started > _ended) Csla.Validation.CommonRules.StringMaxLength,
// { new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823));
// e.Description = "Start date can't be after end date"; ValidationRules.AddRule(
// return false; Csla.Validation.CommonRules.StringRequired, "UserID");
// } ValidationRules.AddRule(
// else Csla.Validation.CommonRules.StringMaxLength,
// return true; new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
//} // CSLATODO: Add other validation rules
#endregion }
#region Authorization Rules // Sample data comparison validation rule
protected override void AddAuthorizationRules() //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
{ //{
//CSLATODO: Who can read/write which fields // if (_started > _ended)
//AuthorizationRules.AllowRead(DetailID, "<Role(s)>"); // {
//AuthorizationRules.AllowRead(ItemType, "<Role(s)>"); // e.Description = "Start date can't be after end date";
//AuthorizationRules.AllowWrite(ItemType, "<Role(s)>"); // return false;
//AuthorizationRules.AllowRead(Text, "<Role(s)>"); // }
//AuthorizationRules.AllowWrite(Text, "<Role(s)>"); // else
//AuthorizationRules.AllowRead(Config, "<Role(s)>"); // return true;
//AuthorizationRules.AllowWrite(Config, "<Role(s)>"); //}
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); #endregion
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); #region Authorization Rules
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); protected override void AddAuthorizationRules()
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); {
} //CSLATODO: Who can read/write which fields
public static bool CanAddObject() //AuthorizationRules.AllowRead(DetailID, "<Role(s)>");
{ //AuthorizationRules.AllowRead(ItemType, "<Role(s)>");
// CSLATODO: Can Add Authorization //AuthorizationRules.AllowWrite(ItemType, "<Role(s)>");
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //AuthorizationRules.AllowRead(Text, "<Role(s)>");
return true; //AuthorizationRules.AllowWrite(Text, "<Role(s)>");
} //AuthorizationRules.AllowRead(Config, "<Role(s)>");
public static bool CanGetObject() //AuthorizationRules.AllowWrite(Config, "<Role(s)>");
{ //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
// CSLATODO: CanGet Authorization //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
return true; //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
} //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
public static bool CanDeleteObject() }
{ public static bool CanAddObject()
// CSLATODO: CanDelete Authorization {
//bool result = false; // CSLATODO: Can Add Authorization
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; return true;
//return result; }
return true; public static bool CanGetObject()
} {
public static bool CanEditObject() // CSLATODO: CanGet Authorization
{ return true;
// CSLATODO: CanEdit Authorization }
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); public static bool CanDeleteObject()
return true; {
} // CSLATODO: CanDelete Authorization
#endregion //bool result = false;
#region Factory Methods //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
public int CurrentEditLevel //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
{ get { return EditLevel; } } //return result;
private static int _ContentDetailUnique = 0; return true;
private static int ContentDetailUnique }
{ get { return ++_ContentDetailUnique; } } public static bool CanEditObject()
private int _MyContentDetailUnique = ContentDetailUnique; {
public int MyContentDetailUnique // Absolutely Unique ID - Editable FK // CSLATODO: CanEdit Authorization
{ get { return _MyContentDetailUnique; } } //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
internal static ContentDetail New(int itemType, string text) return true;
{ }
return new ContentDetail(itemType, text); #endregion
} #region Factory Methods
internal static ContentDetail Get(SafeDataReader dr) public int CurrentEditLevel
{ { get { return EditLevel; } }
return new ContentDetail(dr); private static int _ContentDetailUnique = 0;
} private static int ContentDetailUnique
public ContentDetail() { get { return ++_ContentDetailUnique; } }
{ private int _MyContentDetailUnique = ContentDetailUnique;
MarkAsChild(); public int MyContentDetailUnique // Absolutely Unique ID - Editable FK
_DetailID = Detail.NextDetailID; { get { return _MyContentDetailUnique; } }
_DTS = _ContentDetailExtension.DefaultDTS; internal static ContentDetail New(int itemType, string text)
_UserID = _ContentDetailExtension.DefaultUserID; {
ValidationRules.CheckRules(); return new ContentDetail(itemType, text);
} }
private ContentDetail(int itemType, string text) internal static ContentDetail Get(SafeDataReader dr)
{ {
MarkAsChild(); return new ContentDetail(dr);
// CSLATODO: Add any initialization & defaults }
_DetailID = Detail.NextDetailID; public ContentDetail()
_DTS = _ContentDetailExtension.DefaultDTS; {
_UserID = _ContentDetailExtension.DefaultUserID; MarkAsChild();
_ItemType = itemType; _DetailID = Detail.NextDetailID;
_Text = text; _DTS = _ContentDetailExtension.DefaultDTS;
ValidationRules.CheckRules(); _UserID = _ContentDetailExtension.DefaultUserID;
} ValidationRules.CheckRules();
internal ContentDetail(SafeDataReader dr) }
{ private ContentDetail(int itemType, string text)
MarkAsChild(); {
Fetch(dr); MarkAsChild();
} // CSLATODO: Add any initialization & defaults
private bool _Disposed = false; _DetailID = Detail.NextDetailID;
private static int _CountCreated = 0; _DTS = _ContentDetailExtension.DefaultDTS;
private static int _CountDisposed = 0; _UserID = _ContentDetailExtension.DefaultUserID;
private static int _CountFinalized = 0; _ItemType = itemType;
private static int IncrementCountCreated _Text = text;
{ get { return ++_CountCreated; } } ValidationRules.CheckRules();
private int _CountWhenCreated = IncrementCountCreated; }
public static int CountCreated internal ContentDetail(SafeDataReader dr)
{ get { return _CountCreated; } } {
public static int CountNotDisposed MarkAsChild();
{ get { return _CountCreated - _CountDisposed; } } Fetch(dr);
public static int CountNotFinalized }
{ get { return _CountCreated - _CountFinalized; } } private bool _Disposed = false;
~ContentDetail() private static int _CountCreated = 0;
{ private static int _CountDisposed = 0;
_CountFinalized++; private static int _CountFinalized = 0;
} private static int IncrementCountCreated
public void Dispose() { get { return ++_CountCreated; } }
{ private int _CountWhenCreated = IncrementCountCreated;
if (_Disposed) return; public static int CountCreated
_CountDisposed++; { get { return _CountCreated; } }
_Disposed = true; public static int CountNotDisposed
} { get { return _CountCreated - _CountDisposed; } }
#endregion public static int CountNotFinalized
#region Data Access Portal { get { return _CountCreated - _CountFinalized; } }
private void Fetch(SafeDataReader dr) ~ContentDetail()
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentDetail.FetchDR", GetHashCode()); _CountFinalized++;
try }
{ public void Dispose()
_DetailID = dr.GetInt32("DetailID"); {
_ItemType = dr.GetInt32("ItemType"); if (_Disposed) return;
_Text = dr.GetString("Text"); _CountDisposed++;
_Config = dr.GetString("Config"); _Disposed = true;
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); #endregion
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); #region Data Access Portal
} private void Fetch(SafeDataReader dr)
catch (Exception ex) // FKItem Fetch {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentDetail.FetchDR", GetHashCode());
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetail.FetchDR", ex); try
throw new DbCslaException("ContentDetail.Fetch", ex); {
} _DetailID = dr.GetInt32("DetailID");
MarkOld(); _ItemType = dr.GetInt32("ItemType");
} _Text = dr.GetString("Text");
internal void Insert(Content myContent) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
// if we're not dirty then don't update the database _UserID = dr.GetString("UserID");
if (!this.IsDirty) return; dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; }
_LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID); catch (Exception ex) // FKItem Fetch
MarkOld(); {
} if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetail.FetchDR", ex);
internal void Update(Content myContent) throw new DbCslaException("ContentDetail.Fetch", ex);
{ }
// if we're not dirty then don't update the database MarkOld();
if (!this.IsDirty) return; }
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; internal void Insert(Content myContent)
_LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged); {
MarkOld(); // if we're not dirty then don't update the database
} if (!this.IsDirty) return;
internal void DeleteSelf(Content myContent) SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
{ _LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID);
// if we're not dirty then don't update the database MarkOld();
if (!this.IsDirty) return; }
// if we're new then don't update the database internal void Update(Content myContent)
if (this.IsNew) return; {
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; // if we're not dirty then don't update the database
Detail.Remove(cn, _DetailID); if (!this.IsDirty) return;
MarkNew(); SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
} _LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged);
#endregion MarkOld();
// Standard Default Code }
#region extension internal void DeleteSelf(Content myContent)
ContentDetailExtension _ContentDetailExtension = new ContentDetailExtension(); {
[Serializable()] // if we're not dirty then don't update the database
partial class ContentDetailExtension : extensionBase if (!this.IsDirty) return;
{ // if we're new then don't update the database
} if (this.IsNew) return;
[Serializable()] SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
class extensionBase Detail.Remove(cn, _DetailID);
{ MarkNew();
// Default Values }
public virtual DateTime DefaultDTS #endregion
{ // Standard Default Code
get { return DateTime.Now; } #region extension
} ContentDetailExtension _ContentDetailExtension = new ContentDetailExtension();
public virtual string DefaultUserID [Serializable()]
{ partial class ContentDetailExtension : extensionBase
get { return Volian.Base.Library.VlnSettings.UserID; } {
} }
// Authorization Rules [Serializable()]
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) class extensionBase
{ {
// Needs to be overriden to add new authorization rules // Default Values
} public virtual DateTime DefaultDTS
// Instance Authorization Rules {
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) get { return DateTime.Now; }
{ }
// Needs to be overriden to add new authorization rules public virtual string DefaultUserID
} {
// Validation Rules get { return Volian.Base.Library.VlnSettings.UserID; }
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) }
{ // Authorization Rules
// Needs to be overriden to add new validation rules public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
} {
// InstanceValidation Rules // Needs to be overriden to add new authorization rules
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) }
{ // Instance Authorization Rules
// Needs to be overriden to add new validation rules public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
} {
} // Needs to be overriden to add new authorization rules
#endregion }
} // Class // Validation Rules
#region Converter public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
internal class ContentDetailConverter : ExpandableObjectConverter {
{ // Needs to be overriden to add new validation rules
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) }
{ // InstanceValidation Rules
if (destType == typeof(string) && value is ContentDetail) public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Return the ToString value // Needs to be overriden to add new validation rules
return ((ContentDetail)value).ToString(); }
} }
return base.ConvertTo(context, culture, value, destType); #endregion
} } // Class
} #region Converter
#endregion internal class ContentDetailConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is ContentDetail)
{
// Return the ToString value
return ((ContentDetail)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -20,394 +20,403 @@ using System.Collections.Generic;
using Csla.Validation; using Csla.Validation;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
/// <summary> /// <summary>
/// ContentItem Generated by MyGeneration using the CSLA Object Mapping template /// ContentItem Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ContentItemConverter))] [TypeConverter(typeof(ContentItemConverter))]
public partial class ContentItem : BusinessBase<ContentItem>, IVEHasBrokenRules, IDisposable public partial class ContentItem : BusinessBase<ContentItem>, IVEHasBrokenRules, IDisposable
{ {
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
private int _ItemID; private int _ItemID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int ItemID public int ItemID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
if (_MyItem != null) _ItemID = _MyItem.ItemID; CanReadProperty("ItemID", true);
return _ItemID; if (_MyItem != null) _ItemID = _MyItem.ItemID;
} return _ItemID;
} }
private Item _MyItem; }
[System.ComponentModel.DataObjectField(true, true)] private Item _MyItem;
public Item MyItem [System.ComponentModel.DataObjectField(true, true)]
{ public Item MyItem
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); {
return _MyItem; CanReadProperty("MyItem", true);
} if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID);
} return _MyItem;
private int? _PreviousID; }
public int? PreviousID }
{ private int? _PreviousID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int? PreviousID
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; get
return _PreviousID; {
} CanReadProperty("PreviousID", true);
} if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID;
private Item _MyPrevious; return _PreviousID;
public Item MyPrevious }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private Item _MyPrevious;
get public Item MyPrevious
{ {
if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _MyPrevious; get
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("MyPrevious", true);
set if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID);
{ return _MyPrevious;
if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID)) }
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_MyPrevious = value; set
_PreviousID = (value == null ? null : (int?)value.ItemID); {
PropertyHasChanged(); CanWriteProperty("MyPrevious", true);
} if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID))
} {
} _MyPrevious = value;
private DateTime _DTS = new DateTime(); _PreviousID = (value == null ? null : (int?)value.ItemID);
public DateTime DTS PropertyHasChanged();
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private DateTime _DTS = new DateTime();
return _DTS; public DateTime DTS
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set get
{ {
if (_DTS != value) CanReadProperty("DTS", true);
{ return _DTS;
_DTS = value; }
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
} {
} CanWriteProperty("DTS", true);
private string _UserID = string.Empty; if (_DTS != value)
public string UserID {
{ _DTS = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
get }
{ }
return _UserID; }
} private string _UserID = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string UserID
set {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (value == null) value = string.Empty; get
if (_UserID != value) {
{ CanReadProperty("UserID", true);
_UserID = value; return _UserID;
PropertyHasChanged(); }
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
} {
private byte[] _LastChanged = new byte[8];//timestamp CanWriteProperty("UserID", true);
// CSLATODO: Check ContentItem.GetIdValue to assure that the ID returned is unique if (value == null) value = string.Empty;
/// <summary> if (_UserID != value)
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality {
/// </summary> _UserID = value;
/// <returns>A Unique ID for the current ContentItem</returns> PropertyHasChanged();
protected override object GetIdValue() }
{ }
return MyContentItemUnique; // Absolutely Unique ID }
} private byte[] _LastChanged = new byte[8];//timestamp
// CSLATODO: Replace base ContentItem.ToString function as necessary // CSLATODO: Check ContentItem.GetIdValue to assure that the ID returned is unique
/// <summary> /// <summary>
/// Overrides Base ToString /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// </summary> /// </summary>
/// <returns>A string representation of current ContentItem</returns> /// <returns>A Unique ID for the current ContentItem</returns>
//public override string ToString() protected override object GetIdValue()
//{ {
// return base.ToString(); return MyContentItemUnique; // Absolutely Unique ID
//} }
public override bool IsDirty // CSLATODO: Replace base ContentItem.ToString function as necessary
{ /// <summary>
get { return base.IsDirty; } /// Overrides Base ToString
} /// </summary>
public bool IsDirtyList(List<object> list) /// <returns>A string representation of current ContentItem</returns>
{ //public override string ToString()
return base.IsDirty; //{
} // return base.ToString();
public override bool IsValid //}
{ public override bool IsDirty
get { return (IsNew && !IsDirty) ? true : base.IsValid; } {
} get { return base.IsDirty; }
public bool IsValidList(List<object> list) }
{ public bool IsDirtyList(List<object> list)
return (IsNew && !IsDirty) ? true : base.IsValid; {
} return base.IsDirty;
#endregion }
#region ValidationRules public override bool IsValid
[NonSerialized] {
private bool _CheckingBrokenRules = false; get { return (IsNew && !IsDirty) ? true : base.IsValid; }
public IVEHasBrokenRules HasBrokenRules }
{ public bool IsValidList(List<object> list)
get {
{ return (IsNew && !IsDirty) ? true : base.IsValid;
if (_CheckingBrokenRules) return null; }
if (BrokenRulesCollection.Count > 0) return this; #endregion
try #region ValidationRules
{ [NonSerialized]
_CheckingBrokenRules = true; private bool _CheckingBrokenRules = false;
IVEHasBrokenRules hasBrokenRules = null; public IVEHasBrokenRules HasBrokenRules
if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; {
return hasBrokenRules; get
} {
finally if (_CheckingBrokenRules) return null;
{ if (BrokenRulesCollection.Count > 0) return this;
_CheckingBrokenRules = false; try
} {
} _CheckingBrokenRules = true;
} IVEHasBrokenRules hasBrokenRules = null;
public BrokenRulesCollection BrokenRules if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules;
{ return hasBrokenRules;
get }
{ finally
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; {
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; _CheckingBrokenRules = false;
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); }
} }
} }
protected override void AddBusinessRules() public BrokenRulesCollection BrokenRules
{ {
ValidationRules.AddRule( get
Csla.Validation.CommonRules.StringRequired, "UserID"); {
ValidationRules.AddRule( IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
Csla.Validation.CommonRules.StringMaxLength, if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
// CSLATODO: Add other validation rules }
} }
// Sample data comparison validation rule protected override void AddBusinessRules()
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) {
//{ ValidationRules.AddRule(
// if (_started > _ended) Csla.Validation.CommonRules.StringRequired, "UserID");
// { ValidationRules.AddRule(
// e.Description = "Start date can't be after end date"; Csla.Validation.CommonRules.StringMaxLength,
// return false; new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
// } // CSLATODO: Add other validation rules
// else }
// return true; // Sample data comparison validation rule
//} //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
#endregion //{
#region Authorization Rules // if (_started > _ended)
protected override void AddAuthorizationRules() // {
{ // e.Description = "Start date can't be after end date";
//CSLATODO: Who can read/write which fields // return false;
//AuthorizationRules.AllowRead(ItemID, "<Role(s)>"); // }
//AuthorizationRules.AllowRead(PreviousID, "<Role(s)>"); // else
//AuthorizationRules.AllowWrite(PreviousID, "<Role(s)>"); // return true;
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); //}
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); #endregion
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); #region Authorization Rules
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); protected override void AddAuthorizationRules()
} {
public static bool CanAddObject() //CSLATODO: Who can read/write which fields
{ //AuthorizationRules.AllowRead(ItemID, "<Role(s)>");
// CSLATODO: Can Add Authorization //AuthorizationRules.AllowRead(PreviousID, "<Role(s)>");
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //AuthorizationRules.AllowWrite(PreviousID, "<Role(s)>");
return true; //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
} //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
public static bool CanGetObject() //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
{ //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
// CSLATODO: CanGet Authorization }
return true; public static bool CanAddObject()
} {
public static bool CanDeleteObject() // CSLATODO: Can Add Authorization
{ //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
// CSLATODO: CanDelete Authorization return true;
//bool result = false; }
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; public static bool CanGetObject()
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; {
//return result; // CSLATODO: CanGet Authorization
return true; return true;
} }
public static bool CanEditObject() public static bool CanDeleteObject()
{ {
// CSLATODO: CanEdit Authorization // CSLATODO: CanDelete Authorization
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //bool result = false;
return true; //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
} //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
#endregion //return result;
#region Factory Methods return true;
public int CurrentEditLevel }
{ get { return EditLevel; } } public static bool CanEditObject()
private static int _ContentItemUnique = 0; {
private static int ContentItemUnique // CSLATODO: CanEdit Authorization
{ get { return ++_ContentItemUnique; } } //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
private int _MyContentItemUnique = ContentItemUnique; return true;
public int MyContentItemUnique // Absolutely Unique ID - Editable FK }
{ get { return _MyContentItemUnique; } } #endregion
internal static ContentItem New() #region Factory Methods
{ public int CurrentEditLevel
return new ContentItem(); { get { return EditLevel; } }
} private static int _ContentItemUnique = 0;
internal static ContentItem Get(SafeDataReader dr) private static int ContentItemUnique
{ { get { return ++_ContentItemUnique; } }
return new ContentItem(dr); private int _MyContentItemUnique = ContentItemUnique;
} public int MyContentItemUnique // Absolutely Unique ID - Editable FK
public ContentItem() { get { return _MyContentItemUnique; } }
{ internal static ContentItem New()
MarkAsChild(); {
_ItemID = Item.NextItemID; return new ContentItem();
_DTS = _ContentItemExtension.DefaultDTS; }
_UserID = _ContentItemExtension.DefaultUserID; internal static ContentItem Get(SafeDataReader dr)
ValidationRules.CheckRules(); {
} return new ContentItem(dr);
internal ContentItem(SafeDataReader dr) }
{ public ContentItem()
MarkAsChild(); {
Fetch(dr); MarkAsChild();
} _ItemID = Item.NextItemID;
private bool _Disposed = false; _DTS = _ContentItemExtension.DefaultDTS;
private static int _CountCreated = 0; _UserID = _ContentItemExtension.DefaultUserID;
private static int _CountDisposed = 0; ValidationRules.CheckRules();
private static int _CountFinalized = 0; }
private static int IncrementCountCreated internal ContentItem(SafeDataReader dr)
{ get { return ++_CountCreated; } } {
private int _CountWhenCreated = IncrementCountCreated; MarkAsChild();
public static int CountCreated Fetch(dr);
{ get { return _CountCreated; } } }
public static int CountNotDisposed private bool _Disposed = false;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountCreated = 0;
public static int CountNotFinalized private static int _CountDisposed = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int _CountFinalized = 0;
~ContentItem() private static int IncrementCountCreated
{ { get { return ++_CountCreated; } }
_CountFinalized++; private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
public void Dispose() { get { return _CountCreated; } }
{ public static int CountNotDisposed
if (_Disposed) return; { get { return _CountCreated - _CountDisposed; } }
_CountDisposed++; public static int CountNotFinalized
_Disposed = true; { get { return _CountCreated - _CountFinalized; } }
} ~ContentItem()
#endregion {
#region Data Access Portal _CountFinalized++;
private void Fetch(SafeDataReader dr) }
{ public void Dispose()
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItem.FetchDR", GetHashCode()); {
try if (_Disposed) return;
{ _CountDisposed++;
_ItemID = dr.GetInt32("ItemID"); _Disposed = true;
_PreviousID = (int?)dr.GetValue("PreviousID"); }
_DTS = dr.GetDateTime("DTS"); #endregion
_UserID = dr.GetString("UserID"); #region Data Access Portal
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); private void Fetch(SafeDataReader dr)
} {
catch (Exception ex) // FKItem Fetch if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItem.FetchDR", GetHashCode());
{ try
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItem.FetchDR", ex); {
throw new DbCslaException("ContentItem.Fetch", ex); _ItemID = dr.GetInt32("ItemID");
} _PreviousID = (int?)dr.GetValue("PreviousID");
MarkOld(); _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
internal void Insert(Content myContent) dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
{ }
// if we're not dirty then don't update the database catch (Exception ex) // FKItem Fetch
if (!this.IsDirty) return; {
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItem.FetchDR", ex);
_LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID); throw new DbCslaException("ContentItem.Fetch", ex);
MarkOld(); }
} MarkOld();
internal void Update(Content myContent) }
{ internal void Insert(Content myContent)
// if we're not dirty then don't update the database {
if (!this.IsDirty) return; // if we're not dirty then don't update the database
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; if (!this.IsDirty) return;
_LastChanged = Item.Update(cn, ref _ItemID, _PreviousID, myContent.ContentID, _DTS, _UserID, ref _LastChanged); SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
MarkOld(); _LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID);
} MarkOld();
internal void DeleteSelf(Content myContent) }
{ internal void Update(Content myContent)
// if we're not dirty then don't update the database {
if (!this.IsDirty) return; // if we're not dirty then don't update the database
// if we're new then don't update the database if (!this.IsDirty) return;
if (this.IsNew) return; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; _LastChanged = Item.Update(cn, ref _ItemID, _PreviousID, myContent.ContentID, _DTS, _UserID, ref _LastChanged);
Item.Remove(cn, _ItemID); MarkOld();
MarkNew(); }
} internal void DeleteSelf(Content myContent)
#endregion {
// Standard Default Code // if we're not dirty then don't update the database
#region extension if (!this.IsDirty) return;
ContentItemExtension _ContentItemExtension = new ContentItemExtension(); // if we're new then don't update the database
[Serializable()] if (this.IsNew) return;
partial class ContentItemExtension : extensionBase SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
{ Item.Remove(cn, _ItemID);
} MarkNew();
[Serializable()] }
class extensionBase #endregion
{ // Standard Default Code
// Default Values #region extension
public virtual DateTime DefaultDTS ContentItemExtension _ContentItemExtension = new ContentItemExtension();
{ [Serializable()]
get { return DateTime.Now; } partial class ContentItemExtension : extensionBase
} {
public virtual string DefaultUserID }
{ [Serializable()]
get { return Volian.Base.Library.VlnSettings.UserID; } class extensionBase
} {
// Authorization Rules // Default Values
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual DateTime DefaultDTS
{ {
// Needs to be overriden to add new authorization rules get { return DateTime.Now; }
} }
// Instance Authorization Rules public virtual string DefaultUserID
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) {
{ get { return Volian.Base.Library.VlnSettings.UserID; }
// Needs to be overriden to add new authorization rules }
} // Authorization Rules
// Validation Rules public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) {
{ // Needs to be overriden to add new authorization rules
// Needs to be overriden to add new validation rules }
} // Instance Authorization Rules
// InstanceValidation Rules public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) {
{ // Needs to be overriden to add new authorization rules
// Needs to be overriden to add new validation rules }
} // Validation Rules
} public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
#endregion {
} // Class // Needs to be overriden to add new validation rules
#region Converter }
internal class ContentItemConverter : ExpandableObjectConverter // InstanceValidation Rules
{ public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) {
{ // Needs to be overriden to add new validation rules
if (destType == typeof(string) && value is ContentItem) }
{ }
// Return the ToString value #endregion
return ((ContentItem)value).ToString(); } // Class
} #region Converter
return base.ConvertTo(context, culture, value, destType); internal class ContentItemConverter : ExpandableObjectConverter
} {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
#endregion {
if (destType == typeof(string) && value is ContentItem)
{
// Return the ToString value
return ((ContentItem)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -20,458 +20,470 @@ using System.Collections.Generic;
using Csla.Validation; using Csla.Validation;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
/// <summary> /// <summary>
/// ContentPart Generated by MyGeneration using the CSLA Object Mapping template /// ContentPart Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ContentPartConverter))] [TypeConverter(typeof(ContentPartConverter))]
public partial class ContentPart : BusinessBase<ContentPart>, IVEHasBrokenRules, IDisposable public partial class ContentPart : BusinessBase<ContentPart>, IVEHasBrokenRules, IDisposable
{ {
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
private int _FromType; private int _FromType;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int FromType public int FromType
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _FromType; CanReadProperty("FromType", true);
} return _FromType;
} }
private int _ItemID; }
public int ItemID private int _ItemID;
{ public int ItemID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyItem != null) _ItemID = _MyItem.ItemID; {
return _ItemID; CanReadProperty("ItemID", true);
} if (_MyItem != null) _ItemID = _MyItem.ItemID;
} return _ItemID;
private Item _MyItem; }
public Item MyItem }
{ private Item _MyItem;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public Item MyItem
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); get
return _MyItem; {
} CanReadProperty("MyItem", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID);
set return _MyItem;
{ }
if (_MyItem != value) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
_MyItem = value; {
_ItemID = value.ItemID;// Update underlying data field CanWriteProperty("MyItem", true);
PropertyHasChanged(); if (_MyItem != value)
} {
} _MyItem = value;
} _ItemID = value.ItemID;// Update underlying data field
private DateTime _DTS = new DateTime(); PropertyHasChanged();
public DateTime DTS }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private DateTime _DTS = new DateTime();
{ public DateTime DTS
return _DTS; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
set {
{ CanReadProperty("DTS", true);
if (_DTS != value) return _DTS;
{ }
_DTS = value; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
PropertyHasChanged(); set
} {
} CanWriteProperty("DTS", true);
} if (_DTS != value)
private string _UserID = string.Empty; {
public string UserID _DTS = value;
{ PropertyHasChanged();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ }
return _UserID; private string _UserID = string.Empty;
} public string UserID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
set [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (value == null) value = string.Empty; {
if (_UserID != value) CanReadProperty("UserID", true);
{ return _UserID;
_UserID = value; }
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
} {
} CanWriteProperty("UserID", true);
private byte[] _LastChanged = new byte[8];//timestamp if (value == null) value = string.Empty;
private int? _Item_PreviousID; if (_UserID != value)
public int? Item_PreviousID {
{ _UserID = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
get }
{ }
return _Item_PreviousID; }
} private byte[] _LastChanged = new byte[8];//timestamp
} private int? _Item_PreviousID;
private int _Item_ContentID; public int? Item_PreviousID
public int Item_ContentID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("Item_PreviousID", true);
return _Item_ContentID; return _Item_PreviousID;
} }
} }
private DateTime _Item_DTS = new DateTime(); private int _Item_ContentID;
public DateTime Item_DTS public int Item_ContentID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _Item_DTS; CanReadProperty("Item_ContentID", true);
} return _Item_ContentID;
} }
private string _Item_UserID = string.Empty; }
public string Item_UserID private DateTime _Item_DTS = new DateTime();
{ public DateTime Item_DTS
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _Item_UserID; {
} CanReadProperty("Item_DTS", true);
} return _Item_DTS;
// CSLATODO: Check ContentPart.GetIdValue to assure that the ID returned is unique }
/// <summary> }
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private string _Item_UserID = string.Empty;
/// </summary> public string Item_UserID
/// <returns>A Unique ID for the current ContentPart</returns> {
protected override object GetIdValue() [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return MyContentPartUnique; // Absolutely Unique ID {
} CanReadProperty("Item_UserID", true);
// CSLATODO: Replace base ContentPart.ToString function as necessary return _Item_UserID;
/// <summary> }
/// Overrides Base ToString }
/// </summary> // CSLATODO: Check ContentPart.GetIdValue to assure that the ID returned is unique
/// <returns>A string representation of current ContentPart</returns> /// <summary>
//public override string ToString() /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
//{ /// </summary>
// return base.ToString(); /// <returns>A Unique ID for the current ContentPart</returns>
//} protected override object GetIdValue()
public override bool IsDirty {
{ return MyContentPartUnique; // Absolutely Unique ID
get }
{ // CSLATODO: Replace base ContentPart.ToString function as necessary
if (base.IsDirty) /// <summary>
return true; /// Overrides Base ToString
return IsDirtyList(new List<object>()); /// </summary>
} /// <returns>A string representation of current ContentPart</returns>
} //public override string ToString()
public bool IsDirtyList(List<object> list) //{
{ // return base.ToString();
if (base.IsDirty || list.Contains(this)) //}
return base.IsDirty; public override bool IsDirty
list.Add(this); {
return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); get
} {
public override bool IsValid if ( base.IsDirty )
{ return true;
get { return IsValidList(new List<object>()); } return IsDirtyList(new List<object>());
} }
public bool IsValidList(List<object> list) }
{ public bool IsDirtyList(List<object> list)
if (list.Contains(this)) {
return (IsNew && !IsDirty) ? true : base.IsValid; if (base.IsDirty || list.Contains(this))
list.Add(this); return base.IsDirty;
return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValidList(list)); list.Add(this);
} return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list));
#endregion }
#region ValidationRules public override bool IsValid
[NonSerialized] {
private bool _CheckingBrokenRules = false; get { return IsValidList(new List<object>()); }
public IVEHasBrokenRules HasBrokenRules }
{ public bool IsValidList(List<object> list)
get {
{ if(list.Contains(this))
if (_CheckingBrokenRules) return null; return (IsNew && !IsDirty) ? true : base.IsValid;
if (BrokenRulesCollection.Count > 0) return this; list.Add(this);
try return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValidList(list));
{ }
_CheckingBrokenRules = true; #endregion
IVEHasBrokenRules hasBrokenRules = null; #region ValidationRules
if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; [NonSerialized]
return hasBrokenRules; private bool _CheckingBrokenRules = false;
} public IVEHasBrokenRules HasBrokenRules
finally {
{ get
_CheckingBrokenRules = false; {
} if (_CheckingBrokenRules) return null;
} if (BrokenRulesCollection.Count > 0) return this;
} try
public BrokenRulesCollection BrokenRules {
{ _CheckingBrokenRules = true;
get IVEHasBrokenRules hasBrokenRules = null;
{ if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules;
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; return hasBrokenRules;
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; }
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); finally
} {
} _CheckingBrokenRules = false;
protected override void AddBusinessRules() }
{ }
ValidationRules.AddRule<ContentPart>(MyItemRequired, "MyItem"); }
ValidationRules.AddRule( public BrokenRulesCollection BrokenRules
Csla.Validation.CommonRules.StringRequired, "UserID"); {
ValidationRules.AddRule( get
Csla.Validation.CommonRules.StringMaxLength, {
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
// CSLATODO: Add other validation rules if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
} return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
private static bool MyItemRequired(ContentPart target, Csla.Validation.RuleArgs e) }
{ }
if (target._ItemID == 0 && target._MyItem == null) // Required field missing protected override void AddBusinessRules()
{ {
e.Description = "Required"; ValidationRules.AddRule<ContentPart>(MyItemRequired, "MyItem");
return false; ValidationRules.AddRule(
} Csla.Validation.CommonRules.StringRequired, "UserID");
return true; ValidationRules.AddRule(
} Csla.Validation.CommonRules.StringMaxLength,
// Sample data comparison validation rule new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) // CSLATODO: Add other validation rules
//{ }
// if (_started > _ended) private static bool MyItemRequired(ContentPart target, Csla.Validation.RuleArgs e)
// { {
// e.Description = "Start date can't be after end date"; if (target._ItemID == 0 && target._MyItem == null) // Required field missing
// return false; {
// } e.Description = "Required";
// else return false;
// return true; }
//} return true;
#endregion }
#region Authorization Rules // Sample data comparison validation rule
protected override void AddAuthorizationRules() //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
{ //{
//CSLATODO: Who can read/write which fields // if (_started > _ended)
//AuthorizationRules.AllowRead(FromType, "<Role(s)>"); // {
//AuthorizationRules.AllowRead(ItemID, "<Role(s)>"); // e.Description = "Start date can't be after end date";
//AuthorizationRules.AllowWrite(ItemID, "<Role(s)>"); // return false;
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); // }
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); // else
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); // return true;
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); //}
} #endregion
public static bool CanAddObject() #region Authorization Rules
{ protected override void AddAuthorizationRules()
// CSLATODO: Can Add Authorization {
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //CSLATODO: Who can read/write which fields
return true; //AuthorizationRules.AllowRead(FromType, "<Role(s)>");
} //AuthorizationRules.AllowRead(ItemID, "<Role(s)>");
public static bool CanGetObject() //AuthorizationRules.AllowWrite(ItemID, "<Role(s)>");
{ //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
// CSLATODO: CanGet Authorization //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
return true; //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
} //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
public static bool CanDeleteObject() }
{ public static bool CanAddObject()
// CSLATODO: CanDelete Authorization {
//bool result = false; // CSLATODO: Can Add Authorization
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; return true;
//return result; }
return true; public static bool CanGetObject()
} {
public static bool CanEditObject() // CSLATODO: CanGet Authorization
{ return true;
// CSLATODO: CanEdit Authorization }
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); public static bool CanDeleteObject()
return true; {
} // CSLATODO: CanDelete Authorization
#endregion //bool result = false;
#region Factory Methods //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
public int CurrentEditLevel //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
{ get { return EditLevel; } } //return result;
private static int _ContentPartUnique = 0; return true;
private static int ContentPartUnique }
{ get { return ++_ContentPartUnique; } } public static bool CanEditObject()
private int _MyContentPartUnique = ContentPartUnique; {
public int MyContentPartUnique // Absolutely Unique ID - Editable FK // CSLATODO: CanEdit Authorization
{ get { return _MyContentPartUnique; } } //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
internal static ContentPart New(int fromType, Item myItem) return true;
{ }
return new ContentPart(fromType, myItem); #endregion
} #region Factory Methods
internal static ContentPart Get(SafeDataReader dr) public int CurrentEditLevel
{ { get { return EditLevel; } }
return new ContentPart(dr); private static int _ContentPartUnique = 0;
} private static int ContentPartUnique
public ContentPart() { get { return ++_ContentPartUnique; } }
{ private int _MyContentPartUnique = ContentPartUnique;
MarkAsChild(); public int MyContentPartUnique // Absolutely Unique ID - Editable FK
{ get { return _MyContentPartUnique; } }
internal static ContentPart New(int fromType, Item myItem)
{
return new ContentPart(fromType, myItem);
}
internal static ContentPart Get(SafeDataReader dr)
{
return new ContentPart(dr);
}
public ContentPart()
{
MarkAsChild();
_DTS = _ContentPartExtension.DefaultDTS; _DTS = _ContentPartExtension.DefaultDTS;
_UserID = _ContentPartExtension.DefaultUserID; _UserID = _ContentPartExtension.DefaultUserID;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
private ContentPart(int fromType, Item myItem) private ContentPart(int fromType, Item myItem)
{ {
MarkAsChild(); MarkAsChild();
// CSLATODO: Add any initialization & defaults // CSLATODO: Add any initialization & defaults
_DTS = _ContentPartExtension.DefaultDTS; _DTS = _ContentPartExtension.DefaultDTS;
_UserID = _ContentPartExtension.DefaultUserID; _UserID = _ContentPartExtension.DefaultUserID;
_FromType = fromType; _FromType = fromType;
_MyItem = myItem; _MyItem = myItem;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
internal ContentPart(SafeDataReader dr) internal ContentPart(SafeDataReader dr)
{ {
MarkAsChild(); MarkAsChild();
Fetch(dr); Fetch(dr);
} }
private bool _Disposed = false; private bool _Disposed = false;
private static int _CountCreated = 0; private static int _CountCreated = 0;
private static int _CountDisposed = 0; private static int _CountDisposed = 0;
private static int _CountFinalized = 0; private static int _CountFinalized = 0;
private static int IncrementCountCreated private static int IncrementCountCreated
{ get { return ++_CountCreated; } } { get { return ++_CountCreated; } }
private int _CountWhenCreated = IncrementCountCreated; private int _CountWhenCreated = IncrementCountCreated;
public static int CountCreated public static int CountCreated
{ get { return _CountCreated; } } { get { return _CountCreated; } }
public static int CountNotDisposed public static int CountNotDisposed
{ get { return _CountCreated - _CountDisposed; } } { get { return _CountCreated - _CountDisposed; } }
public static int CountNotFinalized public static int CountNotFinalized
{ get { return _CountCreated - _CountFinalized; } } { get { return _CountCreated - _CountFinalized; } }
~ContentPart() ~ContentPart()
{ {
_CountFinalized++; _CountFinalized++;
} }
public void Dispose() public void Dispose()
{ {
if (_Disposed) return; if (_Disposed) return;
_CountDisposed++; _CountDisposed++;
_Disposed = true; _Disposed = true;
if (_MyItem != null) if (_MyItem != null)
{ {
_MyItem.Dispose(); _MyItem.Dispose();
_MyItem = null; _MyItem = null;
} }
} }
#endregion #endregion
#region Data Access Portal #region Data Access Portal
private void Fetch(SafeDataReader dr) private void Fetch(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentPart.FetchDR", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentPart.FetchDR", GetHashCode());
try try
{ {
_FromType = dr.GetInt32("FromType"); _FromType = dr.GetInt32("FromType");
_ItemID = dr.GetInt32("ItemID"); _ItemID = dr.GetInt32("ItemID");
_DTS = dr.GetDateTime("DTS"); _DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
_Item_PreviousID = (int?)dr.GetValue("Item_PreviousID"); _Item_PreviousID = (int?)dr.GetValue("Item_PreviousID");
_Item_ContentID = dr.GetInt32("Item_ContentID"); _Item_ContentID = dr.GetInt32("Item_ContentID");
_Item_DTS = dr.GetDateTime("Item_DTS"); _Item_DTS = dr.GetDateTime("Item_DTS");
_Item_UserID = dr.GetString("Item_UserID"); _Item_UserID = dr.GetString("Item_UserID");
} }
catch (Exception ex) // FKItem Fetch catch (Exception ex) // FKItem Fetch
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentPart.FetchDR", ex); if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentPart.FetchDR", ex);
throw new DbCslaException("ContentPart.Fetch", ex); throw new DbCslaException("ContentPart.Fetch", ex);
} }
MarkOld(); MarkOld();
} }
internal void Insert(Content myContent) internal void Insert(Content myContent)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Part.Add(cn, myContent, _FromType, _MyItem, _DTS, _UserID); _LastChanged = Part.Add(cn, myContent, _FromType, _MyItem, _DTS, _UserID);
MarkOld(); MarkOld();
} }
internal void Update(Content myContent) internal void Update(Content myContent)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Part.Update(cn, myContent.ContentID, _FromType, _ItemID, _DTS, _UserID, ref _LastChanged); _LastChanged = Part.Update(cn, myContent.ContentID, _FromType, _ItemID, _DTS, _UserID, ref _LastChanged);
MarkOld(); MarkOld();
} }
internal void DeleteSelf(Content myContent) internal void DeleteSelf(Content myContent)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
// if we're new then don't update the database // if we're new then don't update the database
if (this.IsNew) return; if (this.IsNew) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
Part.Remove(cn, myContent.ContentID, _FromType); Part.Remove(cn, myContent.ContentID, _FromType);
MarkNew(); MarkNew();
} }
#endregion #endregion
// Standard Default Code // Standard Default Code
#region extension #region extension
ContentPartExtension _ContentPartExtension = new ContentPartExtension(); ContentPartExtension _ContentPartExtension = new ContentPartExtension();
[Serializable()] [Serializable()]
partial class ContentPartExtension : extensionBase partial class ContentPartExtension : extensionBase
{ {
} }
[Serializable()] [Serializable()]
class extensionBase class extensionBase
{ {
// Default Values // Default Values
public virtual DateTime DefaultDTS public virtual DateTime DefaultDTS
{ {
get { return DateTime.Now; } get { return DateTime.Now; }
} }
public virtual string DefaultUserID public virtual string DefaultUserID
{ {
get { return Volian.Base.Library.VlnSettings.UserID; } get { return Volian.Base.Library.VlnSettings.UserID; }
} }
// Authorization Rules // Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Instance Authorization Rules // Instance Authorization Rules
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Validation Rules // Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
// InstanceValidation Rules // InstanceValidation Rules
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
} }
#endregion #endregion
} // Class } // Class
#region Converter #region Converter
internal class ContentPartConverter : ExpandableObjectConverter internal class ContentPartConverter : ExpandableObjectConverter
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{ {
if (destType == typeof(string) && value is ContentPart) if (destType == typeof(string) && value is ContentPart)
{ {
// Return the ToString value // Return the ToString value
return ((ContentPart)value).ToString(); return ((ContentPart)value).ToString();
} }
return base.ConvertTo(context, culture, value, destType); return base.ConvertTo(context, culture, value, destType);
} }
} }
#endregion #endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,366 +19,376 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void AnnotationAuditInfoEvent(object sender); public delegate void AnnotationAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// AnnotationAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// AnnotationAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(AnnotationAuditInfoConverter))] [TypeConverter(typeof(AnnotationAuditInfoConverter))]
public partial class AnnotationAuditInfo : ReadOnlyBase<AnnotationAuditInfo>, IDisposable public partial class AnnotationAuditInfo : ReadOnlyBase<AnnotationAuditInfo>, IDisposable
{ {
public event AnnotationAuditInfoEvent Changed; public event AnnotationAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<AnnotationAuditInfo> _CacheList = new List<AnnotationAuditInfo>(); private static List<AnnotationAuditInfo> _CacheList = new List<AnnotationAuditInfo>();
protected static void AddToCache(AnnotationAuditInfo annotationAuditInfo) protected static void AddToCache(AnnotationAuditInfo annotationAuditInfo)
{ {
if (!_CacheList.Contains(annotationAuditInfo)) _CacheList.Add(annotationAuditInfo); // In AddToCache if (!_CacheList.Contains(annotationAuditInfo)) _CacheList.Add(annotationAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(AnnotationAuditInfo annotationAuditInfo) protected static void RemoveFromCache(AnnotationAuditInfo annotationAuditInfo)
{ {
while (_CacheList.Contains(annotationAuditInfo)) _CacheList.Remove(annotationAuditInfo); // In RemoveFromCache while (_CacheList.Contains(annotationAuditInfo)) _CacheList.Remove(annotationAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<AnnotationAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AnnotationAuditInfo>>(); private static Dictionary<string, List<AnnotationAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AnnotationAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move AnnotationAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move AnnotationAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
AnnotationAuditInfo tmp = _CacheList[0]; // Get the first AnnotationAuditInfo AnnotationAuditInfo tmp = _CacheList[0]; // Get the first AnnotationAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<AnnotationAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<AnnotationAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first AnnotationAuditInfo _CacheList.RemoveAt(0); // Remove the first AnnotationAuditInfo
} }
} }
internal static void AddList(AnnotationAuditInfoList lst) internal static void AddList(AnnotationAuditInfoList lst)
{ {
foreach (AnnotationAuditInfo item in lst) AddToCache(item); foreach (AnnotationAuditInfo item in lst) AddToCache(item);
} }
protected static AnnotationAuditInfo GetCachedByPrimaryKey(long auditID) protected static AnnotationAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected AnnotationAudit _Editable; protected AnnotationAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _AnnotationID; }
public int AnnotationID private int _AnnotationID;
{ public int AnnotationID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _AnnotationID; {
} CanReadProperty("AnnotationID", true);
} return _AnnotationID;
private int _ItemID; }
public int ItemID }
{ private int _ItemID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int ItemID
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _ItemID; get
} {
} CanReadProperty("ItemID", true);
private int _TypeID; return _ItemID;
public int TypeID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _TypeID;
get public int TypeID
{ {
return _TypeID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _RtfText = string.Empty; CanReadProperty("TypeID", true);
public string RtfText return _TypeID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _RtfText = string.Empty;
{ public string RtfText
return _RtfText; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _SearchText = string.Empty; {
public string SearchText CanReadProperty("RtfText", true);
{ return _RtfText;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _SearchText = string.Empty;
return _SearchText; public string SearchText
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _Config = string.Empty; get
public string Config {
{ CanReadProperty("SearchText", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _SearchText;
get }
{ }
return _Config; private string _Config = string.Empty;
} public string Config
} {
private DateTime _DTS = new DateTime(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public DateTime DTS get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("Config", true);
get return _Config;
{ }
return _DTS; }
} private DateTime _DTS = new DateTime();
} public DateTime DTS
private string _UserID = string.Empty; {
public string UserID [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("DTS", true);
{ return _DTS;
return _UserID; }
} }
} private string _UserID = string.Empty;
private int _DeleteStatus; public string UserID
public int DeleteStatus {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("UserID", true);
return _DeleteStatus; return _UserID;
} }
} }
// CSLATODO: Replace base AnnotationAuditInfo.ToString function as necessary private int _DeleteStatus;
/// <summary> public int DeleteStatus
/// Overrides Base ToString {
/// </summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <returns>A string representation of current AnnotationAuditInfo</returns> get
//public override string ToString() {
//{ CanReadProperty("DeleteStatus", true);
// return base.ToString(); return _DeleteStatus;
//} }
// CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> // CSLATODO: Replace base AnnotationAuditInfo.ToString function as necessary
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// <summary>
/// </summary> /// Overrides Base ToString
/// <returns>A Unique ID for the current AnnotationAuditInfo</returns> /// </summary>
protected override object GetIdValue() /// <returns>A string representation of current AnnotationAuditInfo</returns>
{ //public override string ToString()
return MyAnnotationAuditInfoUnique; // Absolutely Unique ID //{
} // return base.ToString();
#endregion //}
#region Factory Methods // CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique
private static int _AnnotationAuditInfoUnique = 0; /// <summary>
private static int AnnotationAuditInfoUnique /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
{ get { return ++_AnnotationAuditInfoUnique; } } /// </summary>
private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique; /// <returns>A Unique ID for the current AnnotationAuditInfo</returns>
public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info protected override object GetIdValue()
{ get { return _MyAnnotationAuditInfoUnique; } } {
protected AnnotationAuditInfo() return MyAnnotationAuditInfoUnique; // Absolutely Unique ID
{/* require use of factory methods */ }
AddToCache(this); #endregion
} #region Factory Methods
public void Dispose() private static int _AnnotationAuditInfoUnique = 0;
{ private static int AnnotationAuditInfoUnique
RemoveFromCache(this); { get { return ++_AnnotationAuditInfoUnique; } }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique;
List<AnnotationAuditInfo> listAnnotationAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info
while (listAnnotationAuditInfo.Contains(this)) listAnnotationAuditInfo.Remove(this); // Remove the item from the list { get { return _MyAnnotationAuditInfoUnique; } }
if (listAnnotationAuditInfo.Count == 0) // If there are no items left in the list protected AnnotationAuditInfo()
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list {/* require use of factory methods */
} AddToCache(this);
public virtual AnnotationAudit Get() }
{ public void Dispose()
return _Editable = AnnotationAudit.Get(_AuditID); {
} RemoveFromCache(this);
public static void Refresh(AnnotationAudit tmp) if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<AnnotationAuditInfo> listAnnotationAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
string key = tmp.AuditID.ToString(); while (listAnnotationAuditInfo.Contains(this)) listAnnotationAuditInfo.Remove(this); // Remove the item from the list
ConvertListToDictionary(); if (listAnnotationAuditInfo.Count == 0) // If there are no items left in the list
if (_CacheByPrimaryKey.ContainsKey(key)) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
foreach (AnnotationAuditInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public virtual AnnotationAudit Get()
} {
protected virtual void RefreshFields(AnnotationAudit tmp) return _Editable = AnnotationAudit.Get(_AuditID);
{ }
_AnnotationID = tmp.AnnotationID; public static void Refresh(AnnotationAudit tmp)
_ItemID = tmp.ItemID; {
_TypeID = tmp.TypeID; string key = tmp.AuditID.ToString();
_RtfText = tmp.RtfText; ConvertListToDictionary();
_SearchText = tmp.SearchText; if (_CacheByPrimaryKey.ContainsKey(key))
_Config = tmp.Config; foreach (AnnotationAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_DTS = tmp.DTS; tmpInfo.RefreshFields(tmp);
_UserID = tmp.UserID; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(AnnotationAudit tmp)
_AnnotationAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _AnnotationID = tmp.AnnotationID;
} _ItemID = tmp.ItemID;
public static AnnotationAuditInfo Get(long auditID) _TypeID = tmp.TypeID;
{ _RtfText = tmp.RtfText;
//if (!CanGetObject()) _SearchText = tmp.SearchText;
// throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit"); _Config = tmp.Config;
try _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID); _DeleteStatus = tmp.DeleteStatus;
if (tmp == null) _AnnotationAuditInfoExtension.Refresh(this);
{ OnChange();// raise an event
tmp = DataPortal.Fetch<AnnotationAuditInfo>(new PKCriteria(auditID)); }
AddToCache(tmp); public static AnnotationAuditInfo Get(long auditID)
} {
if (tmp.ErrorMessage == "No Record Found") //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit");
tmp.Dispose(); // Clean-up AnnotationAuditInfo try
tmp = null; {
} AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID);
return tmp; if (tmp == null)
} {
catch (Exception ex) tmp = DataPortal.Fetch<AnnotationAuditInfo>(new PKCriteria(auditID));
{ AddToCache(tmp);
throw new DbCslaException("Error on AnnotationAuditInfo.Get", ex); }
} if (tmp.ErrorMessage == "No Record Found")
} {
#endregion tmp.Dispose(); // Clean-up AnnotationAuditInfo
#region Data Access Portal tmp = null;
internal AnnotationAuditInfo(SafeDataReader dr) }
{ return tmp;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.Constructor", GetHashCode()); }
try catch (Exception ex)
{ {
ReadData(dr); throw new DbCslaException("Error on AnnotationAuditInfo.Get", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.Constructor", ex); #region Data Access Portal
throw new DbCslaException("AnnotationAuditInfo.Constructor", ex); internal AnnotationAuditInfo(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.Constructor", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ ReadData(dr);
private long _AuditID; }
public long AuditID catch (Exception ex)
{ get { return _AuditID; } } {
public PKCriteria(long auditID) if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.Constructor", ex);
{ throw new DbCslaException("AnnotationAuditInfo.Constructor", ex);
_AuditID = auditID; }
} }
} [Serializable()]
private void ReadData(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode()); private long _AuditID;
try public long AuditID
{ { get { return _AuditID; } }
_AuditID = dr.GetInt64("AuditID"); public PKCriteria(long auditID)
_AnnotationID = dr.GetInt32("AnnotationID"); {
_ItemID = dr.GetInt32("ItemID"); _AuditID = auditID;
_TypeID = dr.GetInt32("TypeID"); }
_RtfText = dr.GetString("RtfText"); }
_SearchText = dr.GetString("SearchText"); private void ReadData(SafeDataReader dr)
_Config = dr.GetString("Config"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode());
_UserID = dr.GetString("UserID"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _AnnotationID = dr.GetInt32("AnnotationID");
{ _ItemID = dr.GetInt32("ItemID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.ReadData", ex); _TypeID = dr.GetInt32("TypeID");
_ErrorMessage = ex.Message; _RtfText = dr.GetString("RtfText");
throw new DbCslaException("AnnotationAuditInfo.ReadData", ex); _SearchText = dr.GetString("SearchText");
} _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
private void DataPortal_Fetch(PKCriteria criteria) _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.DataPortal_Fetch", GetHashCode()); }
try catch (Exception ex)
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
ApplicationContext.LocalContext["cn"] = cn; throw new DbCslaException("AnnotationAuditInfo.ReadData", ex);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandText = "getAnnotationAudit"; {
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.DataPortal_Fetch", GetHashCode());
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) try
{ {
if (!dr.Read()) using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{ {
_ErrorMessage = "No Record Found"; ApplicationContext.LocalContext["cn"] = cn;
return; using (SqlCommand cm = cn.CreateCommand())
} {
ReadData(dr); cm.CommandType = CommandType.StoredProcedure;
} cm.CommandText = "getAnnotationAudit";
} cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
// removing of item only needed for local data portal using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); if (!dr.Read())
} {
} _ErrorMessage = "No Record Found";
catch (Exception ex) return;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.DataPortal_Fetch", ex); ReadData(dr);
_ErrorMessage = ex.Message; }
throw new DbCslaException("AnnotationAuditInfo.DataPortal_Fetch", ex); }
} // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
#endregion ApplicationContext.LocalContext.Remove("cn");
// Standard Refresh }
#region extension }
AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension(); catch (Exception ex)
[Serializable()] {
partial class AnnotationAuditInfoExtension : extensionBase { } if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
class extensionBase throw new DbCslaException("AnnotationAuditInfo.DataPortal_Fetch", ex);
{ }
// Default Refresh }
public virtual void Refresh(AnnotationAuditInfo tmp) { } #endregion
} // Standard Refresh
#endregion #region extension
} // Class AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension();
#region Converter [Serializable()]
internal class AnnotationAuditInfoConverter : ExpandableObjectConverter partial class AnnotationAuditInfoExtension : extensionBase { }
{ [Serializable()]
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) class extensionBase
{ {
if (destType == typeof(string) && value is AnnotationAuditInfo) // Default Refresh
{ public virtual void Refresh(AnnotationAuditInfo tmp) { }
// Return the ToString value }
return ((AnnotationAuditInfo)value).ToString(); #endregion
} } // Class
return base.ConvertTo(context, culture, value, destType); #region Converter
} internal class AnnotationAuditInfoConverter : ExpandableObjectConverter
} {
#endregion public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is AnnotationAuditInfo)
{
// Return the ToString value
return ((AnnotationAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -19,366 +19,376 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void ContentAuditInfoEvent(object sender); public delegate void ContentAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// ContentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// ContentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(ContentAuditInfoConverter))] [TypeConverter(typeof(ContentAuditInfoConverter))]
public partial class ContentAuditInfo : ReadOnlyBase<ContentAuditInfo>, IDisposable public partial class ContentAuditInfo : ReadOnlyBase<ContentAuditInfo>, IDisposable
{ {
public event ContentAuditInfoEvent Changed; public event ContentAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<ContentAuditInfo> _CacheList = new List<ContentAuditInfo>(); private static List<ContentAuditInfo> _CacheList = new List<ContentAuditInfo>();
protected static void AddToCache(ContentAuditInfo contentAuditInfo) protected static void AddToCache(ContentAuditInfo contentAuditInfo)
{ {
if (!_CacheList.Contains(contentAuditInfo)) _CacheList.Add(contentAuditInfo); // In AddToCache if (!_CacheList.Contains(contentAuditInfo)) _CacheList.Add(contentAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(ContentAuditInfo contentAuditInfo) protected static void RemoveFromCache(ContentAuditInfo contentAuditInfo)
{ {
while (_CacheList.Contains(contentAuditInfo)) _CacheList.Remove(contentAuditInfo); // In RemoveFromCache while (_CacheList.Contains(contentAuditInfo)) _CacheList.Remove(contentAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<ContentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ContentAuditInfo>>(); private static Dictionary<string, List<ContentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ContentAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move ContentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move ContentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
ContentAuditInfo tmp = _CacheList[0]; // Get the first ContentAuditInfo ContentAuditInfo tmp = _CacheList[0]; // Get the first ContentAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<ContentAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<ContentAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first ContentAuditInfo _CacheList.RemoveAt(0); // Remove the first ContentAuditInfo
} }
} }
internal static void AddList(ContentAuditInfoList lst) internal static void AddList(ContentAuditInfoList lst)
{ {
foreach (ContentAuditInfo item in lst) AddToCache(item); foreach (ContentAuditInfo item in lst) AddToCache(item);
} }
protected static ContentAuditInfo GetCachedByPrimaryKey(long auditID) protected static ContentAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected ContentAudit _Editable; protected ContentAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _ContentID; }
public int ContentID private int _ContentID;
{ public int ContentID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _ContentID; {
} CanReadProperty("ContentID", true);
} return _ContentID;
private string _Number = string.Empty; }
public string Number }
{ private string _Number = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string Number
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _Number; get
} {
} CanReadProperty("Number", true);
private string _Text = string.Empty; return _Number;
public string Text }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _Text = string.Empty;
get public string Text
{ {
return _Text; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private int? _Type; CanReadProperty("Text", true);
public int? Type return _Text;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private int? _Type;
{ public int? Type
return _Type; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int? _FormatID; {
public int? FormatID CanReadProperty("Type", true);
{ return _Type;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int? _FormatID;
return _FormatID; public int? FormatID
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _Config = string.Empty; get
public string Config {
{ CanReadProperty("FormatID", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _FormatID;
get }
{ }
return _Config; private string _Config = string.Empty;
} public string Config
} {
private DateTime _DTS = new DateTime(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public DateTime DTS get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("Config", true);
get return _Config;
{ }
return _DTS; }
} private DateTime _DTS = new DateTime();
} public DateTime DTS
private string _UserID = string.Empty; {
public string UserID [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("DTS", true);
{ return _DTS;
return _UserID; }
} }
} private string _UserID = string.Empty;
private int _DeleteStatus; public string UserID
public int DeleteStatus {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("UserID", true);
return _DeleteStatus; return _UserID;
} }
} }
// CSLATODO: Replace base ContentAuditInfo.ToString function as necessary private int _DeleteStatus;
/// <summary> public int DeleteStatus
/// Overrides Base ToString {
/// </summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <returns>A string representation of current ContentAuditInfo</returns> get
//public override string ToString() {
//{ CanReadProperty("DeleteStatus", true);
// return base.ToString(); return _DeleteStatus;
//} }
// CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> // CSLATODO: Replace base ContentAuditInfo.ToString function as necessary
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// <summary>
/// </summary> /// Overrides Base ToString
/// <returns>A Unique ID for the current ContentAuditInfo</returns> /// </summary>
protected override object GetIdValue() /// <returns>A string representation of current ContentAuditInfo</returns>
{ //public override string ToString()
return MyContentAuditInfoUnique; // Absolutely Unique ID //{
} // return base.ToString();
#endregion //}
#region Factory Methods // CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique
private static int _ContentAuditInfoUnique = 0; /// <summary>
private static int ContentAuditInfoUnique /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
{ get { return ++_ContentAuditInfoUnique; } } /// </summary>
private int _MyContentAuditInfoUnique = ContentAuditInfoUnique; /// <returns>A Unique ID for the current ContentAuditInfo</returns>
public int MyContentAuditInfoUnique // Absolutely Unique ID - Info protected override object GetIdValue()
{ get { return _MyContentAuditInfoUnique; } } {
protected ContentAuditInfo() return MyContentAuditInfoUnique; // Absolutely Unique ID
{/* require use of factory methods */ }
AddToCache(this); #endregion
} #region Factory Methods
public void Dispose() private static int _ContentAuditInfoUnique = 0;
{ private static int ContentAuditInfoUnique
RemoveFromCache(this); { get { return ++_ContentAuditInfoUnique; } }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; private int _MyContentAuditInfoUnique = ContentAuditInfoUnique;
List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items public int MyContentAuditInfoUnique // Absolutely Unique ID - Info
while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list { get { return _MyContentAuditInfoUnique; } }
if (listContentAuditInfo.Count == 0) // If there are no items left in the list protected ContentAuditInfo()
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list {/* require use of factory methods */
} AddToCache(this);
public virtual ContentAudit Get() }
{ public void Dispose()
return _Editable = ContentAudit.Get(_AuditID); {
} RemoveFromCache(this);
public static void Refresh(ContentAudit tmp) if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
string key = tmp.AuditID.ToString(); while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list
ConvertListToDictionary(); if (listContentAuditInfo.Count == 0) // If there are no items left in the list
if (_CacheByPrimaryKey.ContainsKey(key)) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public virtual ContentAudit Get()
} {
protected virtual void RefreshFields(ContentAudit tmp) return _Editable = ContentAudit.Get(_AuditID);
{ }
_ContentID = tmp.ContentID; public static void Refresh(ContentAudit tmp)
_Number = tmp.Number; {
_Text = tmp.Text; string key = tmp.AuditID.ToString();
_Type = tmp.Type; ConvertListToDictionary();
_FormatID = tmp.FormatID; if (_CacheByPrimaryKey.ContainsKey(key))
_Config = tmp.Config; foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_DTS = tmp.DTS; tmpInfo.RefreshFields(tmp);
_UserID = tmp.UserID; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(ContentAudit tmp)
_ContentAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _ContentID = tmp.ContentID;
} _Number = tmp.Number;
public static ContentAuditInfo Get(long auditID) _Text = tmp.Text;
{ _Type = tmp.Type;
//if (!CanGetObject()) _FormatID = tmp.FormatID;
// throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); _Config = tmp.Config;
try _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID); _DeleteStatus = tmp.DeleteStatus;
if (tmp == null) _ContentAuditInfoExtension.Refresh(this);
{ OnChange();// raise an event
tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID)); }
AddToCache(tmp); public static ContentAuditInfo Get(long auditID)
} {
if (tmp.ErrorMessage == "No Record Found") //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a ContentAudit");
tmp.Dispose(); // Clean-up ContentAuditInfo try
tmp = null; {
} ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
return tmp; if (tmp == null)
} {
catch (Exception ex) tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID));
{ AddToCache(tmp);
throw new DbCslaException("Error on ContentAuditInfo.Get", ex); }
} if (tmp.ErrorMessage == "No Record Found")
} {
#endregion tmp.Dispose(); // Clean-up ContentAuditInfo
#region Data Access Portal tmp = null;
internal ContentAuditInfo(SafeDataReader dr) }
{ return tmp;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode()); }
try catch (Exception ex)
{ {
ReadData(dr); throw new DbCslaException("Error on ContentAuditInfo.Get", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex); #region Data Access Portal
throw new DbCslaException("ContentAuditInfo.Constructor", ex); internal ContentAuditInfo(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ ReadData(dr);
private long _AuditID; }
public long AuditID catch (Exception ex)
{ get { return _AuditID; } } {
public PKCriteria(long auditID) if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex);
{ throw new DbCslaException("ContentAuditInfo.Constructor", ex);
_AuditID = auditID; }
} }
} [Serializable()]
private void ReadData(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode()); private long _AuditID;
try public long AuditID
{ { get { return _AuditID; } }
_AuditID = dr.GetInt64("AuditID"); public PKCriteria(long auditID)
_ContentID = dr.GetInt32("ContentID"); {
_Number = dr.GetString("Number"); _AuditID = auditID;
_Text = dr.GetString("Text"); }
_Type = (int?)dr.GetValue("Type"); }
_FormatID = (int?)dr.GetValue("FormatID"); private void ReadData(SafeDataReader dr)
_Config = dr.GetString("Config"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode());
_UserID = dr.GetString("UserID"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _ContentID = dr.GetInt32("ContentID");
{ _Number = dr.GetString("Number");
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex); _Text = dr.GetString("Text");
_ErrorMessage = ex.Message; _Type = (int?)dr.GetValue("Type");
throw new DbCslaException("ContentAuditInfo.ReadData", ex); _FormatID = (int?)dr.GetValue("FormatID");
} _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
private void DataPortal_Fetch(PKCriteria criteria) _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode()); }
try catch (Exception ex)
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
ApplicationContext.LocalContext["cn"] = cn; throw new DbCslaException("ContentAuditInfo.ReadData", ex);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandText = "getContentAudit"; {
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode());
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) try
{ {
if (!dr.Read()) using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{ {
_ErrorMessage = "No Record Found"; ApplicationContext.LocalContext["cn"] = cn;
return; using (SqlCommand cm = cn.CreateCommand())
} {
ReadData(dr); cm.CommandType = CommandType.StoredProcedure;
} cm.CommandText = "getContentAudit";
} cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
// removing of item only needed for local data portal using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); if (!dr.Read())
} {
} _ErrorMessage = "No Record Found";
catch (Exception ex) return;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex); ReadData(dr);
_ErrorMessage = ex.Message; }
throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex); }
} // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
#endregion ApplicationContext.LocalContext.Remove("cn");
// Standard Refresh }
#region extension }
ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension(); catch (Exception ex)
[Serializable()] {
partial class ContentAuditInfoExtension : extensionBase { } if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
class extensionBase throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex);
{ }
// Default Refresh }
public virtual void Refresh(ContentAuditInfo tmp) { } #endregion
} // Standard Refresh
#endregion #region extension
} // Class ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension();
#region Converter [Serializable()]
internal class ContentAuditInfoConverter : ExpandableObjectConverter partial class ContentAuditInfoExtension : extensionBase { }
{ [Serializable()]
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) class extensionBase
{ {
if (destType == typeof(string) && value is ContentAuditInfo) // Default Refresh
{ public virtual void Refresh(ContentAuditInfo tmp) { }
// Return the ToString value }
return ((ContentAuditInfo)value).ToString(); #endregion
} } // Class
return base.ConvertTo(context, culture, value, destType); #region Converter
} internal class ContentAuditInfoConverter : ExpandableObjectConverter
} {
#endregion public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is ContentAuditInfo)
{
// Return the ToString value
return ((ContentAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -19,377 +19,388 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void DocumentAuditInfoEvent(object sender); public delegate void DocumentAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// DocumentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// DocumentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DocumentAuditInfoConverter))] [TypeConverter(typeof(DocumentAuditInfoConverter))]
public partial class DocumentAuditInfo : ReadOnlyBase<DocumentAuditInfo>, IDisposable public partial class DocumentAuditInfo : ReadOnlyBase<DocumentAuditInfo>, IDisposable
{ {
public event DocumentAuditInfoEvent Changed; public event DocumentAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<DocumentAuditInfo> _CacheList = new List<DocumentAuditInfo>(); private static List<DocumentAuditInfo> _CacheList = new List<DocumentAuditInfo>();
protected static void AddToCache(DocumentAuditInfo documentAuditInfo) protected static void AddToCache(DocumentAuditInfo documentAuditInfo)
{ {
if (!_CacheList.Contains(documentAuditInfo)) _CacheList.Add(documentAuditInfo); // In AddToCache if (!_CacheList.Contains(documentAuditInfo)) _CacheList.Add(documentAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(DocumentAuditInfo documentAuditInfo) protected static void RemoveFromCache(DocumentAuditInfo documentAuditInfo)
{ {
while (_CacheList.Contains(documentAuditInfo)) _CacheList.Remove(documentAuditInfo); // In RemoveFromCache while (_CacheList.Contains(documentAuditInfo)) _CacheList.Remove(documentAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<DocumentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentAuditInfo>>(); private static Dictionary<string, List<DocumentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move DocumentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move DocumentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
DocumentAuditInfo tmp = _CacheList[0]; // Get the first DocumentAuditInfo DocumentAuditInfo tmp = _CacheList[0]; // Get the first DocumentAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<DocumentAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<DocumentAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first DocumentAuditInfo _CacheList.RemoveAt(0); // Remove the first DocumentAuditInfo
} }
} }
internal static void AddList(DocumentAuditInfoList lst) internal static void AddList(DocumentAuditInfoList lst)
{ {
foreach (DocumentAuditInfo item in lst) AddToCache(item); foreach (DocumentAuditInfo item in lst) AddToCache(item);
} }
protected static DocumentAuditInfo GetCachedByPrimaryKey(long auditID) protected static DocumentAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected DocumentAudit _Editable; protected DocumentAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _DocID; }
public int DocID private int _DocID;
{ public int DocID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _DocID; {
} CanReadProperty("DocID", true);
} return _DocID;
private string _LibTitle = string.Empty; }
public string LibTitle }
{ private string _LibTitle = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string LibTitle
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _LibTitle; get
} {
} CanReadProperty("LibTitle", true);
private byte[] _DocContent; return _LibTitle;
public byte[] DocContent }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private byte[] _DocContent;
get public byte[] DocContent
{ {
return _DocContent; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _DocAscii = string.Empty; CanReadProperty("DocContent", true);
public string DocAscii return _DocContent;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _DocAscii = string.Empty;
{ public string DocAscii
return _DocAscii; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _Config = string.Empty; {
public string Config CanReadProperty("DocAscii", true);
{ return _DocAscii;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
private string _FileExtension = string.Empty; {
public string FileExtension [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("UserID", true);
{ return _UserID;
return _FileExtension; }
} }
} private string _FileExtension = string.Empty;
private byte[] _DocPdf; public string FileExtension
public byte[] DocPdf {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("FileExtension", true);
return _DocPdf; return _FileExtension;
} }
} }
private int _DeleteStatus; private byte[] _DocPdf;
public int DeleteStatus public byte[] DocPdf
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DeleteStatus; CanReadProperty("DocPdf", true);
} return _DocPdf;
} }
// CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary }
/// <summary> private int _DeleteStatus;
/// Overrides Base ToString public int DeleteStatus
/// </summary> {
/// <returns>A string representation of current DocumentAuditInfo</returns> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
//public override string ToString() get
//{ {
// return base.ToString(); CanReadProperty("DeleteStatus", true);
//} return _DeleteStatus;
// CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> }
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality // CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary
/// </summary> /// <summary>
/// <returns>A Unique ID for the current DocumentAuditInfo</returns> /// Overrides Base ToString
protected override object GetIdValue() /// </summary>
{ /// <returns>A string representation of current DocumentAuditInfo</returns>
return MyDocumentAuditInfoUnique; // Absolutely Unique ID //public override string ToString()
} //{
#endregion // return base.ToString();
#region Factory Methods //}
private static int _DocumentAuditInfoUnique = 0; // CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique
private static int DocumentAuditInfoUnique /// <summary>
{ get { return ++_DocumentAuditInfoUnique; } } /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique; /// </summary>
public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info /// <returns>A Unique ID for the current DocumentAuditInfo</returns>
{ get { return _MyDocumentAuditInfoUnique; } } protected override object GetIdValue()
protected DocumentAuditInfo() {
{/* require use of factory methods */ return MyDocumentAuditInfoUnique; // Absolutely Unique ID
AddToCache(this); }
} #endregion
public void Dispose() #region Factory Methods
{ private static int _DocumentAuditInfoUnique = 0;
RemoveFromCache(this); private static int DocumentAuditInfoUnique
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; { get { return ++_DocumentAuditInfoUnique; } }
List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique;
while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info
if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list { get { return _MyDocumentAuditInfoUnique; } }
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list protected DocumentAuditInfo()
} {/* require use of factory methods */
public virtual DocumentAudit Get() AddToCache(this);
{ }
return _Editable = DocumentAudit.Get(_AuditID); public void Dispose()
} {
public static void Refresh(DocumentAudit tmp) RemoveFromCache(this);
{ if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
string key = tmp.AuditID.ToString(); List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
ConvertListToDictionary(); while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list
if (_CacheByPrimaryKey.ContainsKey(key)) if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list
foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
tmpInfo.RefreshFields(tmp); }
} public virtual DocumentAudit Get()
protected virtual void RefreshFields(DocumentAudit tmp) {
{ return _Editable = DocumentAudit.Get(_AuditID);
_DocID = tmp.DocID; }
_LibTitle = tmp.LibTitle; public static void Refresh(DocumentAudit tmp)
_DocContent = tmp.DocContent; {
_DocAscii = tmp.DocAscii; string key = tmp.AuditID.ToString();
_Config = tmp.Config; ConvertListToDictionary();
_DTS = tmp.DTS; if (_CacheByPrimaryKey.ContainsKey(key))
_UserID = tmp.UserID; foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_FileExtension = tmp.FileExtension; tmpInfo.RefreshFields(tmp);
_DocPdf = tmp.DocPdf; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(DocumentAudit tmp)
_DocumentAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _DocID = tmp.DocID;
} _LibTitle = tmp.LibTitle;
public static DocumentAuditInfo Get(long auditID) _DocContent = tmp.DocContent;
{ _DocAscii = tmp.DocAscii;
//if (!CanGetObject()) _Config = tmp.Config;
// throw new System.Security.SecurityException("User not authorized to view a DocumentAudit"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _FileExtension = tmp.FileExtension;
DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID); _DocPdf = tmp.DocPdf;
if (tmp == null) _DeleteStatus = tmp.DeleteStatus;
{ _DocumentAuditInfoExtension.Refresh(this);
tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID)); OnChange();// raise an event
AddToCache(tmp); }
} public static DocumentAuditInfo Get(long auditID)
if (tmp.ErrorMessage == "No Record Found") {
{ //if (!CanGetObject())
tmp.Dispose(); // Clean-up DocumentAuditInfo // throw new System.Security.SecurityException("User not authorized to view a DocumentAudit");
tmp = null; try
} {
return tmp; DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
} if (tmp == null)
catch (Exception ex) {
{ tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID));
throw new DbCslaException("Error on DocumentAuditInfo.Get", ex); AddToCache(tmp);
} }
} if (tmp.ErrorMessage == "No Record Found")
#endregion {
#region Data Access Portal tmp.Dispose(); // Clean-up DocumentAuditInfo
internal DocumentAuditInfo(SafeDataReader dr) tmp = null;
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode()); return tmp;
try }
{ catch (Exception ex)
ReadData(dr); {
} throw new DbCslaException("Error on DocumentAuditInfo.Get", ex);
catch (Exception ex) }
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex); #endregion
throw new DbCslaException("DocumentAuditInfo.Constructor", ex); #region Data Access Portal
} internal DocumentAuditInfo(SafeDataReader dr)
} {
[Serializable()] if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode());
protected class PKCriteria try
{ {
private long _AuditID; ReadData(dr);
public long AuditID }
{ get { return _AuditID; } } catch (Exception ex)
public PKCriteria(long auditID) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex);
_AuditID = auditID; throw new DbCslaException("DocumentAuditInfo.Constructor", ex);
} }
} }
private void ReadData(SafeDataReader dr) [Serializable()]
{ protected class PKCriteria
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode()); {
try private long _AuditID;
{ public long AuditID
_AuditID = dr.GetInt64("AuditID"); { get { return _AuditID; } }
_DocID = dr.GetInt32("DocID"); public PKCriteria(long auditID)
_LibTitle = dr.GetString("LibTitle"); {
_DocContent = (byte[])dr.GetValue("DocContent"); _AuditID = auditID;
_DocAscii = dr.GetString("DocAscii"); }
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); private void ReadData(SafeDataReader dr)
_UserID = dr.GetString("UserID"); {
_FileExtension = dr.GetString("FileExtension"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode());
_DocPdf = (byte[])dr.GetValue("DocPdf"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _DocID = dr.GetInt32("DocID");
{ _LibTitle = dr.GetString("LibTitle");
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex); _DocContent = (byte[])dr.GetValue("DocContent");
_ErrorMessage = ex.Message; _DocAscii = dr.GetString("DocAscii");
throw new DbCslaException("DocumentAuditInfo.ReadData", ex); _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) _FileExtension = dr.GetString("FileExtension");
{ _DocPdf = (byte[])dr.GetValue("DocPdf");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode()); _DeleteStatus = dr.GetInt32("DeleteStatus");
try }
{ catch (Exception ex)
using (SqlConnection cn = Database.VEPROMS_SqlConnection) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex);
ApplicationContext.LocalContext["cn"] = cn; _ErrorMessage = ex.Message;
using (SqlCommand cm = cn.CreateCommand()) throw new DbCslaException("DocumentAuditInfo.ReadData", ex);
{ }
cm.CommandType = CommandType.StoredProcedure; }
cm.CommandText = "getDocumentAudit"; private void DataPortal_Fetch(PKCriteria criteria)
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); {
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode());
{ try
if (!dr.Read()) {
{ using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = "No Record Found"; {
return; ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
ReadData(dr); {
} cm.CommandType = CommandType.StoredProcedure;
} cm.CommandText = "getDocumentAudit";
// removing of item only needed for local data portal cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ApplicationContext.LocalContext.Remove("cn"); {
} if (!dr.Read())
} {
catch (Exception ex) _ErrorMessage = "No Record Found";
{ return;
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; ReadData(dr);
throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex); }
} }
} // removing of item only needed for local data portal
#endregion if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
// Standard Refresh ApplicationContext.LocalContext.Remove("cn");
#region extension }
DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension(); }
[Serializable()] catch (Exception ex)
partial class DocumentAuditInfoExtension : extensionBase { } {
[Serializable()] if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex);
class extensionBase _ErrorMessage = ex.Message;
{ throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex);
// Default Refresh }
public virtual void Refresh(DocumentAuditInfo tmp) { } }
} #endregion
#endregion // Standard Refresh
} // Class #region extension
#region Converter DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension();
internal class DocumentAuditInfoConverter : ExpandableObjectConverter [Serializable()]
{ partial class DocumentAuditInfoExtension : extensionBase { }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) [Serializable()]
{ class extensionBase
if (destType == typeof(string) && value is DocumentAuditInfo) {
{ // Default Refresh
// Return the ToString value public virtual void Refresh(DocumentAuditInfo tmp) { }
return ((DocumentAuditInfo)value).ToString(); }
} #endregion
return base.ConvertTo(context, culture, value, destType); } // Class
} #region Converter
} internal class DocumentAuditInfoConverter : ExpandableObjectConverter
#endregion {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is DocumentAuditInfo)
{
// Return the ToString value
return ((DocumentAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,436 +19,445 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void DROUsageInfoEvent(object sender); public delegate void DROUsageInfoEvent(object sender);
/// <summary> /// <summary>
/// DROUsageInfo Generated by MyGeneration using the CSLA Object Mapping template /// DROUsageInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DROUsageInfoConverter))] [TypeConverter(typeof(DROUsageInfoConverter))]
public partial class DROUsageInfo : ReadOnlyBase<DROUsageInfo>, IDisposable public partial class DROUsageInfo : ReadOnlyBase<DROUsageInfo>, IDisposable
{ {
public event DROUsageInfoEvent Changed; public event DROUsageInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<DROUsageInfo> _CacheList = new List<DROUsageInfo>(); private static List<DROUsageInfo> _CacheList = new List<DROUsageInfo>();
protected static void AddToCache(DROUsageInfo dROUsageInfo) protected static void AddToCache(DROUsageInfo dROUsageInfo)
{ {
if (!_CacheList.Contains(dROUsageInfo)) _CacheList.Add(dROUsageInfo); // In AddToCache if (!_CacheList.Contains(dROUsageInfo)) _CacheList.Add(dROUsageInfo); // In AddToCache
} }
protected static void RemoveFromCache(DROUsageInfo dROUsageInfo) protected static void RemoveFromCache(DROUsageInfo dROUsageInfo)
{ {
while (_CacheList.Contains(dROUsageInfo)) _CacheList.Remove(dROUsageInfo); // In RemoveFromCache while (_CacheList.Contains(dROUsageInfo)) _CacheList.Remove(dROUsageInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<DROUsageInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DROUsageInfo>>(); private static Dictionary<string, List<DROUsageInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DROUsageInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move DROUsageInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move DROUsageInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
DROUsageInfo tmp = _CacheList[0]; // Get the first DROUsageInfo DROUsageInfo tmp = _CacheList[0]; // Get the first DROUsageInfo
string pKey = tmp.DROUsageID.ToString(); string pKey = tmp.DROUsageID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<DROUsageInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<DROUsageInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first DROUsageInfo _CacheList.RemoveAt(0); // Remove the first DROUsageInfo
} }
} }
internal static void AddList(DROUsageInfoList lst) internal static void AddList(DROUsageInfoList lst)
{ {
foreach (DROUsageInfo item in lst) AddToCache(item); foreach (DROUsageInfo item in lst) AddToCache(item);
} }
protected static DROUsageInfo GetCachedByPrimaryKey(int dROUsageID) protected static DROUsageInfo GetCachedByPrimaryKey(int dROUsageID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = dROUsageID.ToString(); string key = dROUsageID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected DROUsage _Editable; protected DROUsage _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _DROUsageID; private int _DROUsageID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DROUsageID public int DROUsageID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DROUsageID; CanReadProperty("DROUsageID", true);
} return _DROUsageID;
} }
private int _DocID; }
public int DocID private int _DocID;
{ public int DocID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyDocument != null) _DocID = _MyDocument.DocID; {
return _DocID; CanReadProperty("DocID", true);
} if (_MyDocument != null) _DocID = _MyDocument.DocID;
} return _DocID;
private DocumentInfo _MyDocument; }
public DocumentInfo MyDocument }
{ private DocumentInfo _MyDocument;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public DocumentInfo MyDocument
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID); get
return _MyDocument; {
} CanReadProperty("MyDocument", true);
} if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID);
private string _ROID = string.Empty; return _MyDocument;
public string ROID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _ROID = string.Empty;
get public string ROID
{ {
return _ROID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _Config = string.Empty; CanReadProperty("ROID", true);
public string Config return _ROID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Config = string.Empty;
{ public string Config
return _Config; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private DateTime _DTS = new DateTime(); {
public DateTime DTS CanReadProperty("Config", true);
{ return _Config;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private DateTime _DTS = new DateTime();
return _DTS; public DateTime DTS
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _UserID = string.Empty; get
public string UserID {
{ CanReadProperty("DTS", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _DTS;
get }
{ }
return _UserID; private string _UserID = string.Empty;
} public string UserID
} {
private int _RODbID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int RODbID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("UserID", true);
get return _UserID;
{ }
if (_MyRODb != null) _RODbID = _MyRODb.RODbID; }
return _RODbID; private int _RODbID;
} public int RODbID
} {
private RODbInfo _MyRODb; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public RODbInfo MyRODb get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("RODbID", true);
get if (_MyRODb != null) _RODbID = _MyRODb.RODbID;
{ return _RODbID;
if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID); }
return _MyRODb; }
} private RODbInfo _MyRODb;
} public RODbInfo MyRODb
// CSLATODO: Replace base DROUsageInfo.ToString function as necessary {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Overrides Base ToString get
/// </summary> {
/// <returns>A string representation of current DROUsageInfo</returns> CanReadProperty("MyRODb", true);
//public override string ToString() if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID);
//{ return _MyRODb;
// return base.ToString(); }
//} }
// CSLATODO: Check DROUsageInfo.GetIdValue to assure that the ID returned is unique // CSLATODO: Replace base DROUsageInfo.ToString function as necessary
/// <summary> /// <summary>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// Overrides Base ToString
/// </summary> /// </summary>
/// <returns>A Unique ID for the current DROUsageInfo</returns> /// <returns>A string representation of current DROUsageInfo</returns>
protected override object GetIdValue() //public override string ToString()
{ //{
return MyDROUsageInfoUnique; // Absolutely Unique ID // return base.ToString();
} //}
#endregion // CSLATODO: Check DROUsageInfo.GetIdValue to assure that the ID returned is unique
#region Factory Methods /// <summary>
private static int _DROUsageInfoUnique = 0; /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private static int DROUsageInfoUnique /// </summary>
{ get { return ++_DROUsageInfoUnique; } } /// <returns>A Unique ID for the current DROUsageInfo</returns>
private int _MyDROUsageInfoUnique = DROUsageInfoUnique; protected override object GetIdValue()
public int MyDROUsageInfoUnique // Absolutely Unique ID - Info {
{ get { return _MyDROUsageInfoUnique; } } return MyDROUsageInfoUnique; // Absolutely Unique ID
protected DROUsageInfo() }
{/* require use of factory methods */ #endregion
AddToCache(this); #region Factory Methods
} private static int _DROUsageInfoUnique = 0;
private bool _Disposed = false; private static int DROUsageInfoUnique
private static int _CountCreated = 0; { get { return ++_DROUsageInfoUnique; } }
private static int _CountDisposed = 0; private int _MyDROUsageInfoUnique = DROUsageInfoUnique;
private static int _CountFinalized = 0; public int MyDROUsageInfoUnique // Absolutely Unique ID - Info
private static int IncrementCountCreated { get { return _MyDROUsageInfoUnique; } }
{ get { return ++_CountCreated; } } protected DROUsageInfo()
private int _CountWhenCreated = IncrementCountCreated; {/* require use of factory methods */
public static int CountCreated AddToCache(this);
{ get { return _CountCreated; } } }
public static int CountNotDisposed private bool _Disposed = false;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountCreated = 0;
public static int CountNotFinalized private static int _CountDisposed = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int _CountFinalized = 0;
~DROUsageInfo() private static int IncrementCountCreated
{ { get { return ++_CountCreated; } }
_CountFinalized++; private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
public void Dispose() { get { return _CountCreated; } }
{ public static int CountNotDisposed
if (_Disposed) return; { get { return _CountCreated - _CountDisposed; } }
_CountDisposed++; public static int CountNotFinalized
_Disposed = true; { get { return _CountCreated - _CountFinalized; } }
RemoveFromCache(this); ~DROUsageInfo()
if (!_CacheByPrimaryKey.ContainsKey(DROUsageID.ToString())) return; {
List<DROUsageInfo> listDROUsageInfo = _CacheByPrimaryKey[DROUsageID.ToString()]; // Get the list of items _CountFinalized++;
while (listDROUsageInfo.Contains(this)) listDROUsageInfo.Remove(this); // Remove the item from the list }
if (listDROUsageInfo.Count == 0) // If there are no items left in the list public void Dispose()
_CacheByPrimaryKey.Remove(DROUsageID.ToString()); // remove the list {
} if (_Disposed) return;
public virtual DROUsage Get() _CountDisposed++;
{ _Disposed = true;
return _Editable = DROUsage.Get(_DROUsageID); RemoveFromCache(this);
} if (!_CacheByPrimaryKey.ContainsKey(DROUsageID.ToString())) return;
public static void Refresh(DROUsage tmp) List<DROUsageInfo> listDROUsageInfo = _CacheByPrimaryKey[DROUsageID.ToString()]; // Get the list of items
{ while (listDROUsageInfo.Contains(this)) listDROUsageInfo.Remove(this); // Remove the item from the list
string key = tmp.DROUsageID.ToString(); if (listDROUsageInfo.Count == 0) // If there are no items left in the list
ConvertListToDictionary(); _CacheByPrimaryKey.Remove(DROUsageID.ToString()); // remove the list
if (_CacheByPrimaryKey.ContainsKey(key)) }
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) public virtual DROUsage Get()
tmpInfo.RefreshFields(tmp); {
} return _Editable = DROUsage.Get(_DROUsageID);
protected virtual void RefreshFields(DROUsage tmp) }
{ public static void Refresh(DROUsage tmp)
if (_DocID != tmp.DocID) {
{ string key = tmp.DROUsageID.ToString();
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value ConvertListToDictionary();
_DocID = tmp.DocID; // Update the value if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
_MyDocument = null; // Reset list so that the next line gets a new list tmpInfo.RefreshFields(tmp);
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value }
_ROID = tmp.ROID; protected virtual void RefreshFields(DROUsage tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_DocID != tmp.DocID)
_UserID = tmp.UserID; {
if (_RODbID != tmp.RODbID) if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value
{ _DocID = tmp.DocID; // Update the value
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value }
_RODbID = tmp.RODbID; // Update the value _MyDocument = null; // Reset list so that the next line gets a new list
} if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value
_MyRODb = null; // Reset list so that the next line gets a new list _ROID = tmp.ROID;
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value _Config = tmp.Config;
_DROUsageInfoExtension.Refresh(this); _DTS = tmp.DTS;
OnChange();// raise an event _UserID = tmp.UserID;
} if (_RODbID != tmp.RODbID)
public static void Refresh(DocumentDROUsage tmp) {
{ if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value
string key = tmp.DROUsageID.ToString(); _RODbID = tmp.RODbID; // Update the value
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) _MyRODb = null; // Reset list so that the next line gets a new list
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value
tmpInfo.RefreshFields(tmp); _DROUsageInfoExtension.Refresh(this);
} OnChange();// raise an event
protected virtual void RefreshFields(DocumentDROUsage tmp) }
{ public static void Refresh(DocumentDROUsage tmp)
_ROID = tmp.ROID; {
_Config = tmp.Config; string key = tmp.DROUsageID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
if (_RODbID != tmp.RODbID) foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
{ tmpInfo.RefreshFields(tmp);
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value }
_RODbID = tmp.RODbID; // Update the value protected virtual void RefreshFields(DocumentDROUsage tmp)
} {
_MyRODb = null; // Reset list so that the next line gets a new list _ROID = tmp.ROID;
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value _Config = tmp.Config;
_DROUsageInfoExtension.Refresh(this); _DTS = tmp.DTS;
OnChange();// raise an event _UserID = tmp.UserID;
} if (_RODbID != tmp.RODbID)
public static void Refresh(RODbDROUsage tmp) {
{ if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value
string key = tmp.DROUsageID.ToString(); _RODbID = tmp.RODbID; // Update the value
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) _MyRODb = null; // Reset list so that the next line gets a new list
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value
tmpInfo.RefreshFields(tmp); _DROUsageInfoExtension.Refresh(this);
} OnChange();// raise an event
protected virtual void RefreshFields(RODbDROUsage tmp) }
{ public static void Refresh(RODbDROUsage tmp)
if (_DocID != tmp.DocID) {
{ string key = tmp.DROUsageID.ToString();
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value ConvertListToDictionary();
_DocID = tmp.DocID; // Update the value if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
_MyDocument = null; // Reset list so that the next line gets a new list tmpInfo.RefreshFields(tmp);
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value }
_ROID = tmp.ROID; protected virtual void RefreshFields(RODbDROUsage tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_DocID != tmp.DocID)
_UserID = tmp.UserID; {
_DROUsageInfoExtension.Refresh(this); if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value
OnChange();// raise an event _DocID = tmp.DocID; // Update the value
} }
public static DROUsageInfo Get(int dROUsageID) _MyDocument = null; // Reset list so that the next line gets a new list
{ if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value
//if (!CanGetObject()) _ROID = tmp.ROID;
// throw new System.Security.SecurityException("User not authorized to view a DROUsage"); _Config = tmp.Config;
try _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
DROUsageInfo tmp = GetCachedByPrimaryKey(dROUsageID); _DROUsageInfoExtension.Refresh(this);
if (tmp == null) OnChange();// raise an event
{ }
tmp = DataPortal.Fetch<DROUsageInfo>(new PKCriteria(dROUsageID)); public static DROUsageInfo Get(int dROUsageID)
AddToCache(tmp); {
} //if (!CanGetObject())
if (tmp.ErrorMessage == "No Record Found") // throw new System.Security.SecurityException("User not authorized to view a DROUsage");
{ try
tmp.Dispose(); // Clean-up DROUsageInfo {
tmp = null; DROUsageInfo tmp = GetCachedByPrimaryKey(dROUsageID);
} if (tmp == null)
return tmp; {
} tmp = DataPortal.Fetch<DROUsageInfo>(new PKCriteria(dROUsageID));
catch (Exception ex) AddToCache(tmp);
{ }
throw new DbCslaException("Error on DROUsageInfo.Get", ex); if (tmp.ErrorMessage == "No Record Found")
} {
} tmp.Dispose(); // Clean-up DROUsageInfo
#endregion tmp = null;
#region Data Access Portal }
internal DROUsageInfo(SafeDataReader dr) return tmp;
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.Constructor", GetHashCode()); catch (Exception ex)
try {
{ throw new DbCslaException("Error on DROUsageInfo.Get", ex);
ReadData(dr); }
} }
catch (Exception ex) #endregion
{ #region Data Access Portal
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.Constructor", ex); internal DROUsageInfo(SafeDataReader dr)
throw new DbCslaException("DROUsageInfo.Constructor", ex); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.Constructor", GetHashCode());
} try
[Serializable()] {
protected class PKCriteria ReadData(dr);
{ }
private int _DROUsageID; catch (Exception ex)
public int DROUsageID {
{ get { return _DROUsageID; } } if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.Constructor", ex);
public PKCriteria(int dROUsageID) throw new DbCslaException("DROUsageInfo.Constructor", ex);
{ }
_DROUsageID = dROUsageID; }
} [Serializable()]
} protected class PKCriteria
private void ReadData(SafeDataReader dr) {
{ private int _DROUsageID;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.ReadData", GetHashCode()); public int DROUsageID
try { get { return _DROUsageID; } }
{ public PKCriteria(int dROUsageID)
_DROUsageID = dr.GetInt32("DROUsageID"); {
_DocID = dr.GetInt32("DocID"); _DROUsageID = dROUsageID;
_ROID = dr.GetString("ROID"); }
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); private void ReadData(SafeDataReader dr)
_UserID = dr.GetString("UserID"); {
_RODbID = dr.GetInt32("RODbID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.ReadData", GetHashCode());
} try
catch (Exception ex) {
{ _DROUsageID = dr.GetInt32("DROUsageID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.ReadData", ex); _DocID = dr.GetInt32("DocID");
_ErrorMessage = ex.Message; _ROID = dr.GetString("ROID");
throw new DbCslaException("DROUsageInfo.ReadData", ex); _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) _RODbID = dr.GetInt32("RODbID");
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.DataPortal_Fetch", GetHashCode()); catch (Exception ex)
try {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.ReadData", ex);
using (SqlConnection cn = Database.VEPROMS_SqlConnection) _ErrorMessage = ex.Message;
{ throw new DbCslaException("DROUsageInfo.ReadData", ex);
ApplicationContext.LocalContext["cn"] = cn; }
using (SqlCommand cm = cn.CreateCommand()) }
{ private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandType = CommandType.StoredProcedure; {
cm.CommandText = "getDROUsage"; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.DataPortal_Fetch", GetHashCode());
cm.Parameters.AddWithValue("@DROUsageID", criteria.DROUsageID); try
cm.CommandTimeout = Database.DefaultTimeout; {
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{ {
if (!dr.Read()) ApplicationContext.LocalContext["cn"] = cn;
{ using (SqlCommand cm = cn.CreateCommand())
_ErrorMessage = "No Record Found"; {
return; cm.CommandType = CommandType.StoredProcedure;
} cm.CommandText = "getDROUsage";
ReadData(dr); cm.Parameters.AddWithValue("@DROUsageID", criteria.DROUsageID);
} cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
// removing of item only needed for local data portal {
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) if (!dr.Read())
ApplicationContext.LocalContext.Remove("cn"); {
} _ErrorMessage = "No Record Found";
} return;
catch (Exception ex) }
{ ReadData(dr);
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; }
throw new DbCslaException("DROUsageInfo.DataPortal_Fetch", ex); // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
#endregion }
// Standard Refresh }
#region extension catch (Exception ex)
DROUsageInfoExtension _DROUsageInfoExtension = new DROUsageInfoExtension(); {
[Serializable()] if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.DataPortal_Fetch", ex);
partial class DROUsageInfoExtension : extensionBase { } _ErrorMessage = ex.Message;
[Serializable()] throw new DbCslaException("DROUsageInfo.DataPortal_Fetch", ex);
class extensionBase }
{ }
// Default Refresh #endregion
public virtual void Refresh(DROUsageInfo tmp) { } // Standard Refresh
} #region extension
#endregion DROUsageInfoExtension _DROUsageInfoExtension = new DROUsageInfoExtension();
} // Class [Serializable()]
#region Converter partial class DROUsageInfoExtension : extensionBase { }
internal class DROUsageInfoConverter : ExpandableObjectConverter [Serializable()]
{ class extensionBase
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) {
{ // Default Refresh
if (destType == typeof(string) && value is DROUsageInfo) public virtual void Refresh(DROUsageInfo tmp) { }
{ }
// Return the ToString value #endregion
return ((DROUsageInfo)value).ToString(); } // Class
} #region Converter
return base.ConvertTo(context, culture, value, destType); internal class DROUsageInfoConverter : ExpandableObjectConverter
} {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
#endregion {
if (destType == typeof(string) && value is DROUsageInfo)
{
// Return the ToString value
return ((DROUsageInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -19,389 +19,397 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void DetailInfoEvent(object sender); public delegate void DetailInfoEvent(object sender);
/// <summary> /// <summary>
/// DetailInfo Generated by MyGeneration using the CSLA Object Mapping template /// DetailInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DetailInfoConverter))] [TypeConverter(typeof(DetailInfoConverter))]
public partial class DetailInfo : ReadOnlyBase<DetailInfo>, IDisposable public partial class DetailInfo : ReadOnlyBase<DetailInfo>, IDisposable
{ {
public event DetailInfoEvent Changed; public event DetailInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<DetailInfo> _CacheList = new List<DetailInfo>(); private static List<DetailInfo> _CacheList = new List<DetailInfo>();
protected static void AddToCache(DetailInfo detailInfo) protected static void AddToCache(DetailInfo detailInfo)
{ {
if (!_CacheList.Contains(detailInfo)) _CacheList.Add(detailInfo); // In AddToCache if (!_CacheList.Contains(detailInfo)) _CacheList.Add(detailInfo); // In AddToCache
} }
protected static void RemoveFromCache(DetailInfo detailInfo) protected static void RemoveFromCache(DetailInfo detailInfo)
{ {
while (_CacheList.Contains(detailInfo)) _CacheList.Remove(detailInfo); // In RemoveFromCache while (_CacheList.Contains(detailInfo)) _CacheList.Remove(detailInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<DetailInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DetailInfo>>(); private static Dictionary<string, List<DetailInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DetailInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move DetailInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move DetailInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
DetailInfo tmp = _CacheList[0]; // Get the first DetailInfo DetailInfo tmp = _CacheList[0]; // Get the first DetailInfo
string pKey = tmp.DetailID.ToString(); string pKey = tmp.DetailID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<DetailInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<DetailInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first DetailInfo _CacheList.RemoveAt(0); // Remove the first DetailInfo
} }
} }
internal static void AddList(DetailInfoList lst) internal static void AddList(DetailInfoList lst)
{ {
foreach (DetailInfo item in lst) AddToCache(item); foreach (DetailInfo item in lst) AddToCache(item);
} }
protected static DetailInfo GetCachedByPrimaryKey(int detailID) protected static DetailInfo GetCachedByPrimaryKey(int detailID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = detailID.ToString(); string key = detailID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Detail _Editable; protected Detail _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _DetailID; private int _DetailID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DetailID public int DetailID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DetailID; CanReadProperty("DetailID", true);
} return _DetailID;
} }
private int _ContentID; }
public int ContentID private int _ContentID;
{ public int ContentID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyContent != null) _ContentID = _MyContent.ContentID; {
return _ContentID; CanReadProperty("ContentID", true);
} if (_MyContent != null) _ContentID = _MyContent.ContentID;
} return _ContentID;
private ContentInfo _MyContent; }
public ContentInfo MyContent }
{ private ContentInfo _MyContent;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public ContentInfo MyContent
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); get
return _MyContent; {
} CanReadProperty("MyContent", true);
} if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID);
private int _ItemType; return _MyContent;
public int ItemType }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _ItemType;
get public int ItemType
{ {
return _ItemType; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _Text = string.Empty; CanReadProperty("ItemType", true);
public string Text return _ItemType;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Text = string.Empty;
{ public string Text
return _Text; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _Config = string.Empty; {
public string Config CanReadProperty("Text", true);
{ return _Text;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
// CSLATODO: Replace base DetailInfo.ToString function as necessary {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Overrides Base ToString get
/// </summary> {
/// <returns>A string representation of current DetailInfo</returns> CanReadProperty("UserID", true);
//public override string ToString() return _UserID;
//{ }
// return base.ToString(); }
//} // CSLATODO: Replace base DetailInfo.ToString function as necessary
// CSLATODO: Check DetailInfo.GetIdValue to assure that the ID returned is unique /// <summary>
/// <summary> /// Overrides Base ToString
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// </summary>
/// </summary> /// <returns>A string representation of current DetailInfo</returns>
/// <returns>A Unique ID for the current DetailInfo</returns> //public override string ToString()
protected override object GetIdValue() //{
{ // return base.ToString();
return MyDetailInfoUnique; // Absolutely Unique ID //}
} // CSLATODO: Check DetailInfo.GetIdValue to assure that the ID returned is unique
#endregion /// <summary>
#region Factory Methods /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private static int _DetailInfoUnique = 0; /// </summary>
private static int DetailInfoUnique /// <returns>A Unique ID for the current DetailInfo</returns>
{ get { return ++_DetailInfoUnique; } } protected override object GetIdValue()
private int _MyDetailInfoUnique = DetailInfoUnique; {
public int MyDetailInfoUnique // Absolutely Unique ID - Info return MyDetailInfoUnique; // Absolutely Unique ID
{ get { return _MyDetailInfoUnique; } } }
protected DetailInfo() #endregion
{/* require use of factory methods */ #region Factory Methods
AddToCache(this); private static int _DetailInfoUnique = 0;
} private static int DetailInfoUnique
private bool _Disposed = false; { get { return ++_DetailInfoUnique; } }
private static int _CountCreated = 0; private int _MyDetailInfoUnique = DetailInfoUnique;
private static int _CountDisposed = 0; public int MyDetailInfoUnique // Absolutely Unique ID - Info
private static int _CountFinalized = 0; { get { return _MyDetailInfoUnique; } }
private static int IncrementCountCreated protected DetailInfo()
{ get { return ++_CountCreated; } } {/* require use of factory methods */
private int _CountWhenCreated = IncrementCountCreated; AddToCache(this);
public static int CountCreated }
{ get { return _CountCreated; } } private bool _Disposed = false;
public static int CountNotDisposed private static int _CountCreated = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountDisposed = 0;
public static int CountNotFinalized private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int IncrementCountCreated
~DetailInfo() { get { return ++_CountCreated; } }
{ private int _CountWhenCreated = IncrementCountCreated;
_CountFinalized++; public static int CountCreated
} { get { return _CountCreated; } }
public void Dispose() public static int CountNotDisposed
{ { get { return _CountCreated - _CountDisposed; } }
if (_Disposed) return; public static int CountNotFinalized
_CountDisposed++; { get { return _CountCreated - _CountFinalized; } }
_Disposed = true; ~DetailInfo()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) return; _CountFinalized++;
List<DetailInfo> listDetailInfo = _CacheByPrimaryKey[DetailID.ToString()]; // Get the list of items }
while (listDetailInfo.Contains(this)) listDetailInfo.Remove(this); // Remove the item from the list public void Dispose()
if (listDetailInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list if (_Disposed) return;
} _CountDisposed++;
public virtual Detail Get() _Disposed = true;
{ RemoveFromCache(this);
return _Editable = Detail.Get(_DetailID); if (!_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) return;
} List<DetailInfo> listDetailInfo = _CacheByPrimaryKey[DetailID.ToString()]; // Get the list of items
public static void Refresh(Detail tmp) while (listDetailInfo.Contains(this)) listDetailInfo.Remove(this); // Remove the item from the list
{ if (listDetailInfo.Count == 0) // If there are no items left in the list
string key = tmp.DetailID.ToString(); _CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) public virtual Detail Get()
foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) {
tmpInfo.RefreshFields(tmp); return _Editable = Detail.Get(_DetailID);
} }
protected virtual void RefreshFields(Detail tmp) public static void Refresh(Detail tmp)
{ {
if (_ContentID != tmp.ContentID) string key = tmp.DetailID.ToString();
{ ConvertListToDictionary();
if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_ContentID = tmp.ContentID; // Update the value foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyContent = null; // Reset list so that the next line gets a new list }
if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for new value protected virtual void RefreshFields(Detail tmp)
_ItemType = tmp.ItemType; {
_Text = tmp.Text; if (_ContentID != tmp.ContentID)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for old value
_UserID = tmp.UserID; _ContentID = tmp.ContentID; // Update the value
_DetailInfoExtension.Refresh(this); }
OnChange();// raise an event _MyContent = null; // Reset list so that the next line gets a new list
} if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for new value
public static void Refresh(ContentDetail tmp) _ItemType = tmp.ItemType;
{ _Text = tmp.Text;
string key = tmp.DetailID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) _DetailInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(ContentDetail tmp) public static void Refresh(ContentDetail tmp)
{ {
_ItemType = tmp.ItemType; string key = tmp.DetailID.ToString();
_Text = tmp.Text; ConvertListToDictionary();
_Config = tmp.Config; if (_CacheByPrimaryKey.ContainsKey(key))
_DTS = tmp.DTS; foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key])
_UserID = tmp.UserID; tmpInfo.RefreshFields(tmp);
_DetailInfoExtension.Refresh(this); }
OnChange();// raise an event protected virtual void RefreshFields(ContentDetail tmp)
} {
public static DetailInfo Get(int detailID) _ItemType = tmp.ItemType;
{ _Text = tmp.Text;
//if (!CanGetObject()) _Config = tmp.Config;
// throw new System.Security.SecurityException("User not authorized to view a Detail"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _DetailInfoExtension.Refresh(this);
DetailInfo tmp = GetCachedByPrimaryKey(detailID); OnChange();// raise an event
if (tmp == null) }
{ public static DetailInfo Get(int detailID)
tmp = DataPortal.Fetch<DetailInfo>(new PKCriteria(detailID)); {
AddToCache(tmp); //if (!CanGetObject())
} // throw new System.Security.SecurityException("User not authorized to view a Detail");
if (tmp.ErrorMessage == "No Record Found") try
{ {
tmp.Dispose(); // Clean-up DetailInfo DetailInfo tmp = GetCachedByPrimaryKey(detailID);
tmp = null; if (tmp == null)
} {
return tmp; tmp = DataPortal.Fetch<DetailInfo>(new PKCriteria(detailID));
} AddToCache(tmp);
catch (Exception ex) }
{ if (tmp.ErrorMessage == "No Record Found")
throw new DbCslaException("Error on DetailInfo.Get", ex); {
} tmp.Dispose(); // Clean-up DetailInfo
} tmp = null;
#endregion }
#region Data Access Portal return tmp;
internal DetailInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.Constructor", GetHashCode()); {
try throw new DbCslaException("Error on DetailInfo.Get", ex);
{ }
ReadData(dr); }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal DetailInfo(SafeDataReader dr)
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.Constructor", ex); {
throw new DbCslaException("DetailInfo.Constructor", ex); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.Constructor", GetHashCode());
} try
} {
[Serializable()] ReadData(dr);
protected class PKCriteria }
{ catch (Exception ex)
private int _DetailID; {
public int DetailID if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.Constructor", ex);
{ get { return _DetailID; } } throw new DbCslaException("DetailInfo.Constructor", ex);
public PKCriteria(int detailID) }
{ }
_DetailID = detailID; [Serializable()]
} protected class PKCriteria
} {
private void ReadData(SafeDataReader dr) private int _DetailID;
{ public int DetailID
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.ReadData", GetHashCode()); { get { return _DetailID; } }
try public PKCriteria(int detailID)
{ {
_DetailID = dr.GetInt32("DetailID"); _DetailID = detailID;
_ContentID = dr.GetInt32("ContentID"); }
_ItemType = dr.GetInt32("ItemType"); }
_Text = dr.GetString("Text"); private void ReadData(SafeDataReader dr)
_Config = dr.GetString("Config"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.ReadData", GetHashCode());
_UserID = dr.GetString("UserID"); try
} {
catch (Exception ex) _DetailID = dr.GetInt32("DetailID");
{ _ContentID = dr.GetInt32("ContentID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.ReadData", ex); _ItemType = dr.GetInt32("ItemType");
_ErrorMessage = ex.Message; _Text = dr.GetString("Text");
throw new DbCslaException("DetailInfo.ReadData", ex); _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.DataPortal_Fetch", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
using (SqlConnection cn = Database.VEPROMS_SqlConnection) throw new DbCslaException("DetailInfo.ReadData", ex);
{ }
ApplicationContext.LocalContext["cn"] = cn; }
using (SqlCommand cm = cn.CreateCommand()) private void DataPortal_Fetch(PKCriteria criteria)
{ {
cm.CommandType = CommandType.StoredProcedure; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.DataPortal_Fetch", GetHashCode());
cm.CommandText = "getDetail"; try
cm.Parameters.AddWithValue("@DetailID", criteria.DetailID); {
cm.CommandTimeout = Database.DefaultTimeout; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ ApplicationContext.LocalContext["cn"] = cn;
if (!dr.Read()) using (SqlCommand cm = cn.CreateCommand())
{ {
_ErrorMessage = "No Record Found"; cm.CommandType = CommandType.StoredProcedure;
return; cm.CommandText = "getDetail";
} cm.Parameters.AddWithValue("@DetailID", criteria.DetailID);
ReadData(dr); cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
} {
// removing of item only needed for local data portal if (!dr.Read())
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); _ErrorMessage = "No Record Found";
} return;
} }
catch (Exception ex) ReadData(dr);
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; // removing of item only needed for local data portal
throw new DbCslaException("DetailInfo.DataPortal_Fetch", ex); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
} }
#endregion }
// Standard Refresh catch (Exception ex)
#region extension {
DetailInfoExtension _DetailInfoExtension = new DetailInfoExtension(); if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
partial class DetailInfoExtension : extensionBase { } throw new DbCslaException("DetailInfo.DataPortal_Fetch", ex);
[Serializable()] }
class extensionBase }
{ #endregion
// Default Refresh // Standard Refresh
public virtual void Refresh(DetailInfo tmp) { } #region extension
} DetailInfoExtension _DetailInfoExtension = new DetailInfoExtension();
#endregion [Serializable()]
} // Class partial class DetailInfoExtension : extensionBase { }
#region Converter [Serializable()]
internal class DetailInfoConverter : ExpandableObjectConverter class extensionBase
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) // Default Refresh
{ public virtual void Refresh(DetailInfo tmp) { }
if (destType == typeof(string) && value is DetailInfo) }
{ #endregion
// Return the ToString value } // Class
return ((DetailInfo)value).ToString(); #region Converter
} internal class DetailInfoConverter : ExpandableObjectConverter
return base.ConvertTo(context, culture, value, destType); {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
} {
#endregion if (destType == typeof(string) && value is DetailInfo)
{
// Return the ToString value
return ((DetailInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,387 +19,397 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void DocumentAuditInfoEvent(object sender); public delegate void DocumentAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// DocumentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// DocumentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DocumentAuditInfoConverter))] [TypeConverter(typeof(DocumentAuditInfoConverter))]
public partial class DocumentAuditInfo : ReadOnlyBase<DocumentAuditInfo>, IDisposable public partial class DocumentAuditInfo : ReadOnlyBase<DocumentAuditInfo>, IDisposable
{ {
public event DocumentAuditInfoEvent Changed; public event DocumentAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<DocumentAuditInfo> _CacheList = new List<DocumentAuditInfo>(); private static List<DocumentAuditInfo> _CacheList = new List<DocumentAuditInfo>();
protected static void AddToCache(DocumentAuditInfo documentAuditInfo) protected static void AddToCache(DocumentAuditInfo documentAuditInfo)
{ {
if (!_CacheList.Contains(documentAuditInfo)) _CacheList.Add(documentAuditInfo); // In AddToCache if (!_CacheList.Contains(documentAuditInfo)) _CacheList.Add(documentAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(DocumentAuditInfo documentAuditInfo) protected static void RemoveFromCache(DocumentAuditInfo documentAuditInfo)
{ {
while (_CacheList.Contains(documentAuditInfo)) _CacheList.Remove(documentAuditInfo); // In RemoveFromCache while (_CacheList.Contains(documentAuditInfo)) _CacheList.Remove(documentAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<DocumentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentAuditInfo>>(); private static Dictionary<string, List<DocumentAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move DocumentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move DocumentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
DocumentAuditInfo tmp = _CacheList[0]; // Get the first DocumentAuditInfo DocumentAuditInfo tmp = _CacheList[0]; // Get the first DocumentAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<DocumentAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<DocumentAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first DocumentAuditInfo _CacheList.RemoveAt(0); // Remove the first DocumentAuditInfo
} }
} }
internal static void AddList(DocumentAuditInfoList lst) internal static void AddList(DocumentAuditInfoList lst)
{ {
foreach (DocumentAuditInfo item in lst) AddToCache(item); foreach (DocumentAuditInfo item in lst) AddToCache(item);
} }
protected static DocumentAuditInfo GetCachedByPrimaryKey(long auditID) protected static DocumentAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected DocumentAudit _Editable; protected DocumentAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _DocID; }
public int DocID private int _DocID;
{ public int DocID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _DocID; {
} CanReadProperty("DocID", true);
} return _DocID;
private string _LibTitle = string.Empty; }
public string LibTitle }
{ private string _LibTitle = string.Empty;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public string LibTitle
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _LibTitle; get
} {
} CanReadProperty("LibTitle", true);
private byte[] _DocContent; return _LibTitle;
public byte[] DocContent }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private byte[] _DocContent;
get public byte[] DocContent
{ {
return _DocContent; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _DocAscii = string.Empty; CanReadProperty("DocContent", true);
public string DocAscii return _DocContent;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _DocAscii = string.Empty;
{ public string DocAscii
return _DocAscii; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _Config = string.Empty; {
public string Config CanReadProperty("DocAscii", true);
{ return _DocAscii;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
private string _FileExtension = string.Empty; {
public string FileExtension [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("UserID", true);
{ return _UserID;
return _FileExtension; }
} }
} private string _FileExtension = string.Empty;
private int _DeleteStatus; public string FileExtension
public int DeleteStatus {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("FileExtension", true);
return _DeleteStatus; return _FileExtension;
} }
} }
// CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary private int _DeleteStatus;
/// <summary> public int DeleteStatus
/// Overrides Base ToString {
/// </summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <returns>A string representation of current DocumentAuditInfo</returns> get
//public override string ToString() {
//{ CanReadProperty("DeleteStatus", true);
// return base.ToString(); return _DeleteStatus;
//} }
// CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> // CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// <summary>
/// </summary> /// Overrides Base ToString
/// <returns>A Unique ID for the current DocumentAuditInfo</returns> /// </summary>
protected override object GetIdValue() /// <returns>A string representation of current DocumentAuditInfo</returns>
{ //public override string ToString()
return MyDocumentAuditInfoUnique; // Absolutely Unique ID //{
} // return base.ToString();
#endregion //}
#region Factory Methods // CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique
private static int _DocumentAuditInfoUnique = 0; /// <summary>
private static int DocumentAuditInfoUnique /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
{ get { return ++_DocumentAuditInfoUnique; } } /// </summary>
private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique; /// <returns>A Unique ID for the current DocumentAuditInfo</returns>
public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info protected override object GetIdValue()
{ get { return _MyDocumentAuditInfoUnique; } } {
protected DocumentAuditInfo() return MyDocumentAuditInfoUnique; // Absolutely Unique ID
{/* require use of factory methods */ }
AddToCache(this); #endregion
} #region Factory Methods
private bool _Disposed = false; private static int _DocumentAuditInfoUnique = 0;
private static int _CountCreated = 0; private static int DocumentAuditInfoUnique
private static int _CountDisposed = 0; { get { return ++_DocumentAuditInfoUnique; } }
private static int _CountFinalized = 0; private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique;
private static int IncrementCountCreated public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info
{ get { return ++_CountCreated; } } { get { return _MyDocumentAuditInfoUnique; } }
private int _CountWhenCreated = IncrementCountCreated; protected DocumentAuditInfo()
public static int CountCreated {/* require use of factory methods */
{ get { return _CountCreated; } } AddToCache(this);
public static int CountNotDisposed }
{ get { return _CountCreated - _CountDisposed; } } private bool _Disposed = false;
public static int CountNotFinalized private static int _CountCreated = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int _CountDisposed = 0;
~DocumentAuditInfo() private static int _CountFinalized = 0;
{ private static int IncrementCountCreated
_CountFinalized++; { get { return ++_CountCreated; } }
} private int _CountWhenCreated = IncrementCountCreated;
public void Dispose() public static int CountCreated
{ { get { return _CountCreated; } }
if (_Disposed) return; public static int CountNotDisposed
_CountDisposed++; { get { return _CountCreated - _CountDisposed; } }
_Disposed = true; public static int CountNotFinalized
RemoveFromCache(this); { get { return _CountCreated - _CountFinalized; } }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; ~DocumentAuditInfo()
List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list _CountFinalized++;
if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list public void Dispose()
} {
public virtual DocumentAudit Get() if (_Disposed) return;
{ _CountDisposed++;
return _Editable = DocumentAudit.Get(_AuditID); _Disposed = true;
} RemoveFromCache(this);
public static void Refresh(DocumentAudit tmp) if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
string key = tmp.AuditID.ToString(); while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list
ConvertListToDictionary(); if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list
if (_CacheByPrimaryKey.ContainsKey(key)) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public virtual DocumentAudit Get()
} {
protected virtual void RefreshFields(DocumentAudit tmp) return _Editable = DocumentAudit.Get(_AuditID);
{ }
_DocID = tmp.DocID; public static void Refresh(DocumentAudit tmp)
_LibTitle = tmp.LibTitle; {
_DocContent = tmp.DocContent; string key = tmp.AuditID.ToString();
_DocAscii = tmp.DocAscii; ConvertListToDictionary();
_Config = tmp.Config; if (_CacheByPrimaryKey.ContainsKey(key))
_DTS = tmp.DTS; foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_UserID = tmp.UserID; tmpInfo.RefreshFields(tmp);
_FileExtension = tmp.FileExtension; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(DocumentAudit tmp)
_DocumentAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _DocID = tmp.DocID;
} _LibTitle = tmp.LibTitle;
public static DocumentAuditInfo Get(long auditID) _DocContent = tmp.DocContent;
{ _DocAscii = tmp.DocAscii;
//if (!CanGetObject()) _Config = tmp.Config;
// throw new System.Security.SecurityException("User not authorized to view a DocumentAudit"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _FileExtension = tmp.FileExtension;
DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID); _DeleteStatus = tmp.DeleteStatus;
if (tmp == null) _DocumentAuditInfoExtension.Refresh(this);
{ OnChange();// raise an event
tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID)); }
AddToCache(tmp); public static DocumentAuditInfo Get(long auditID)
} {
if (tmp.ErrorMessage == "No Record Found") //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a DocumentAudit");
tmp.Dispose(); // Clean-up DocumentAuditInfo try
tmp = null; {
} DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
return tmp; if (tmp == null)
} {
catch (Exception ex) tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID));
{ AddToCache(tmp);
throw new DbCslaException("Error on DocumentAuditInfo.Get", ex); }
} if (tmp.ErrorMessage == "No Record Found")
} {
#endregion tmp.Dispose(); // Clean-up DocumentAuditInfo
#region Data Access Portal tmp = null;
internal DocumentAuditInfo(SafeDataReader dr) }
{ return tmp;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode()); }
try catch (Exception ex)
{ {
ReadData(dr); throw new DbCslaException("Error on DocumentAuditInfo.Get", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex); #region Data Access Portal
throw new DbCslaException("DocumentAuditInfo.Constructor", ex); internal DocumentAuditInfo(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ ReadData(dr);
private long _AuditID; }
public long AuditID catch (Exception ex)
{ get { return _AuditID; } } {
public PKCriteria(long auditID) if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex);
{ throw new DbCslaException("DocumentAuditInfo.Constructor", ex);
_AuditID = auditID; }
} }
} [Serializable()]
private void ReadData(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode()); private long _AuditID;
try public long AuditID
{ { get { return _AuditID; } }
_AuditID = dr.GetInt64("AuditID"); public PKCriteria(long auditID)
_DocID = dr.GetInt32("DocID"); {
_LibTitle = dr.GetString("LibTitle"); _AuditID = auditID;
_DocContent = (byte[])dr.GetValue("DocContent"); }
_DocAscii = dr.GetString("DocAscii"); }
_Config = dr.GetString("Config"); private void ReadData(SafeDataReader dr)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode());
_FileExtension = dr.GetString("FileExtension"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _DocID = dr.GetInt32("DocID");
{ _LibTitle = dr.GetString("LibTitle");
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex); _DocContent = (byte[])dr.GetValue("DocContent");
_ErrorMessage = ex.Message; _DocAscii = dr.GetString("DocAscii");
throw new DbCslaException("DocumentAuditInfo.ReadData", ex); _Config = dr.GetString("Config");
} _DTS = dr.GetDateTime("DTS");
} _UserID = dr.GetString("UserID");
private void DataPortal_Fetch(PKCriteria criteria) _FileExtension = dr.GetString("FileExtension");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode()); }
try catch (Exception ex)
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex);
{ _ErrorMessage = ex.Message;
ApplicationContext.LocalContext["cn"] = cn; throw new DbCslaException("DocumentAuditInfo.ReadData", ex);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandText = "getDocumentAudit"; {
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode());
cm.CommandTimeout = Database.DefaultTimeout; try
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) {
{ using (SqlConnection cn = Database.VEPROMS_SqlConnection)
if (!dr.Read()) {
{ ApplicationContext.LocalContext["cn"] = cn;
_ErrorMessage = "No Record Found"; using (SqlCommand cm = cn.CreateCommand())
return; {
} cm.CommandType = CommandType.StoredProcedure;
ReadData(dr); cm.CommandText = "getDocumentAudit";
} cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
} cm.CommandTimeout = Database.DefaultTimeout;
// removing of item only needed for local data portal using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) {
ApplicationContext.LocalContext.Remove("cn"); if (!dr.Read())
} {
} _ErrorMessage = "No Record Found";
catch (Exception ex) return;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex); ReadData(dr);
_ErrorMessage = ex.Message; }
throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex); }
} // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
#endregion ApplicationContext.LocalContext.Remove("cn");
// Standard Refresh }
#region extension }
DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension(); catch (Exception ex)
[Serializable()] {
partial class DocumentAuditInfoExtension : extensionBase { } if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex);
[Serializable()] _ErrorMessage = ex.Message;
class extensionBase throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex);
{ }
// Default Refresh }
public virtual void Refresh(DocumentAuditInfo tmp) { } #endregion
} // Standard Refresh
#endregion #region extension
} // Class DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension();
#region Converter [Serializable()]
internal class DocumentAuditInfoConverter : ExpandableObjectConverter partial class DocumentAuditInfoExtension : extensionBase { }
{ [Serializable()]
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) class extensionBase
{ {
if (destType == typeof(string) && value is DocumentAuditInfo) // Default Refresh
{ public virtual void Refresh(DocumentAuditInfo tmp) { }
// Return the ToString value }
return ((DocumentAuditInfo)value).ToString(); #endregion
} } // Class
return base.ConvertTo(context, culture, value, destType); #region Converter
} internal class DocumentAuditInfoConverter : ExpandableObjectConverter
} {
#endregion public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is DocumentAuditInfo)
{
// Return the ToString value
return ((DocumentAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -20,445 +20,458 @@ using System.Collections.Generic;
using Csla.Validation; using Csla.Validation;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
/// <summary> /// <summary>
/// DocumentEntry Generated by MyGeneration using the CSLA Object Mapping template /// DocumentEntry Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DocumentEntryConverter))] [TypeConverter(typeof(DocumentEntryConverter))]
public partial class DocumentEntry : BusinessBase<DocumentEntry>, IVEHasBrokenRules, IDisposable public partial class DocumentEntry : BusinessBase<DocumentEntry>, IVEHasBrokenRules, IDisposable
{ {
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
private int _ContentID; private int _ContentID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int ContentID public int ContentID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
if (_MyEntry != null) _ContentID = _MyEntry.ContentID; CanReadProperty("ContentID", true);
return _ContentID; if (_MyEntry != null) _ContentID = _MyEntry.ContentID;
} return _ContentID;
} }
private Entry _MyEntry; }
[System.ComponentModel.DataObjectField(true, true)] private Entry _MyEntry;
public Entry MyEntry [System.ComponentModel.DataObjectField(true, true)]
{ public Entry MyEntry
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyEntry == null && _ContentID != 0) _MyEntry = Entry.Get(_ContentID); {
return _MyEntry; CanReadProperty("MyEntry", true);
} if (_MyEntry == null && _ContentID != 0) _MyEntry = Entry.Get(_ContentID);
} return _MyEntry;
private DateTime _DTS = new DateTime(); }
public DateTime DTS }
{ private DateTime _DTS = new DateTime();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public DateTime DTS
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _DTS; get
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
set return _DTS;
{ }
if (_DTS != value) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
_DTS = value; {
PropertyHasChanged(); CanWriteProperty("DTS", true);
} if (_DTS != value)
} {
} _DTS = value;
private string _UserID = string.Empty; PropertyHasChanged();
public string UserID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _UserID = string.Empty;
{ public string UserID
return _UserID; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
set {
{ CanReadProperty("UserID", true);
if (value == null) value = string.Empty; return _UserID;
if (_UserID != value) }
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_UserID = value; set
PropertyHasChanged(); {
} CanWriteProperty("UserID", true);
} if (value == null) value = string.Empty;
} if (_UserID != value)
private byte[] _LastChanged = new byte[8];//timestamp {
private string _Content_Number = string.Empty; _UserID = value;
/// <summary> PropertyHasChanged();
/// Increased from 30 to 256 to support RTF symbols }
/// </summary> }
public string Content_Number }
{ private byte[] _LastChanged = new byte[8];//timestamp
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _Content_Number = string.Empty;
get /// <summary>
{ /// Increased from 30 to 256 to support RTF symbols
return _Content_Number; /// </summary>
} public string Content_Number
} {
private string _Content_Text = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string Content_Text get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("Content_Number", true);
get return _Content_Number;
{ }
return _Content_Text; }
} private string _Content_Text = string.Empty;
} public string Content_Text
private int? _Content_Type; {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// 0 - Procedure, 10000 - Section, 20000 Step get
/// </summary> {
public int? Content_Type CanReadProperty("Content_Text", true);
{ return _Content_Text;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int? _Content_Type;
return _Content_Type; /// <summary>
} /// 0 - Procedure, 10000 - Section, 20000 Step
} /// </summary>
private int? _Content_FormatID; public int? Content_Type
public int? Content_FormatID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ CanReadProperty("Content_Type", true);
return _Content_FormatID; return _Content_Type;
} }
} }
private string _Content_Config = string.Empty; private int? _Content_FormatID;
public string Content_Config public int? Content_FormatID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _Content_Config; CanReadProperty("Content_FormatID", true);
} return _Content_FormatID;
} }
private DateTime _Content_DTS = new DateTime(); }
public DateTime Content_DTS private string _Content_Config = string.Empty;
{ public string Content_Config
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _Content_DTS; {
} CanReadProperty("Content_Config", true);
} return _Content_Config;
private string _Content_UserID = string.Empty; }
public string Content_UserID }
{ private DateTime _Content_DTS = new DateTime();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public DateTime Content_DTS
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _Content_UserID; get
} {
} CanReadProperty("Content_DTS", true);
// CSLATODO: Check DocumentEntry.GetIdValue to assure that the ID returned is unique return _Content_DTS;
/// <summary> }
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality }
/// </summary> private string _Content_UserID = string.Empty;
/// <returns>A Unique ID for the current DocumentEntry</returns> public string Content_UserID
protected override object GetIdValue() {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return MyDocumentEntryUnique; // Absolutely Unique ID get
} {
// CSLATODO: Replace base DocumentEntry.ToString function as necessary CanReadProperty("Content_UserID", true);
/// <summary> return _Content_UserID;
/// Overrides Base ToString }
/// </summary> }
/// <returns>A string representation of current DocumentEntry</returns> // CSLATODO: Check DocumentEntry.GetIdValue to assure that the ID returned is unique
//public override string ToString() /// <summary>
//{ /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
// return base.ToString(); /// </summary>
//} /// <returns>A Unique ID for the current DocumentEntry</returns>
public override bool IsDirty protected override object GetIdValue()
{ {
get { return base.IsDirty; } return MyDocumentEntryUnique; // Absolutely Unique ID
} }
public bool IsDirtyList(List<object> list) // CSLATODO: Replace base DocumentEntry.ToString function as necessary
{ /// <summary>
return base.IsDirty; /// Overrides Base ToString
} /// </summary>
public override bool IsValid /// <returns>A string representation of current DocumentEntry</returns>
{ //public override string ToString()
get { return (IsNew && !IsDirty) ? true : base.IsValid; } //{
} // return base.ToString();
public bool IsValidList(List<object> list) //}
{ public override bool IsDirty
return (IsNew && !IsDirty) ? true : base.IsValid; {
} get { return base.IsDirty; }
#endregion }
#region ValidationRules public bool IsDirtyList(List<object> list)
[NonSerialized] {
private bool _CheckingBrokenRules = false; return base.IsDirty;
public IVEHasBrokenRules HasBrokenRules }
{ public override bool IsValid
get {
{ get { return (IsNew && !IsDirty) ? true : base.IsValid; }
if (_CheckingBrokenRules) return null; }
if (BrokenRulesCollection.Count > 0) return this; public bool IsValidList(List<object> list)
try {
{ return (IsNew && !IsDirty) ? true : base.IsValid;
_CheckingBrokenRules = true; }
IVEHasBrokenRules hasBrokenRules = null; #endregion
return hasBrokenRules; #region ValidationRules
} [NonSerialized]
finally private bool _CheckingBrokenRules = false;
{ public IVEHasBrokenRules HasBrokenRules
_CheckingBrokenRules = false; {
} get
} {
} if (_CheckingBrokenRules) return null;
public BrokenRulesCollection BrokenRules if (BrokenRulesCollection.Count > 0) return this;
{ try
get {
{ _CheckingBrokenRules = true;
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; IVEHasBrokenRules hasBrokenRules = null;
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; return hasBrokenRules;
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); }
} finally
} {
protected override void AddBusinessRules() _CheckingBrokenRules = false;
{ }
ValidationRules.AddRule( }
Csla.Validation.CommonRules.StringRequired, "UserID"); }
ValidationRules.AddRule( public BrokenRulesCollection BrokenRules
Csla.Validation.CommonRules.StringMaxLength, {
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); get
// CSLATODO: Add other validation rules {
} IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
// Sample data comparison validation rule if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
//{ }
// if (_started > _ended) }
// { protected override void AddBusinessRules()
// e.Description = "Start date can't be after end date"; {
// return false; ValidationRules.AddRule(
// } Csla.Validation.CommonRules.StringRequired, "UserID");
// else ValidationRules.AddRule(
// return true; Csla.Validation.CommonRules.StringMaxLength,
//} new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
#endregion // CSLATODO: Add other validation rules
#region Authorization Rules }
protected override void AddAuthorizationRules() // Sample data comparison validation rule
{ //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//CSLATODO: Who can read/write which fields //{
//AuthorizationRules.AllowRead(ContentID, "<Role(s)>"); // if (_started > _ended)
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); // {
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); // e.Description = "Start date can't be after end date";
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); // return false;
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); // }
} // else
public static bool CanAddObject() // return true;
{ //}
// CSLATODO: Can Add Authorization #endregion
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); #region Authorization Rules
return true; protected override void AddAuthorizationRules()
} {
public static bool CanGetObject() //CSLATODO: Who can read/write which fields
{ //AuthorizationRules.AllowRead(ContentID, "<Role(s)>");
// CSLATODO: CanGet Authorization //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
return true; //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
} //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
public static bool CanDeleteObject() //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
{ }
// CSLATODO: CanDelete Authorization public static bool CanAddObject()
//bool result = false; {
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; // CSLATODO: Can Add Authorization
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//return result; return true;
return true; }
} public static bool CanGetObject()
public static bool CanEditObject() {
{ // CSLATODO: CanGet Authorization
// CSLATODO: CanEdit Authorization return true;
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); }
return true; public static bool CanDeleteObject()
} {
#endregion // CSLATODO: CanDelete Authorization
#region Factory Methods //bool result = false;
public int CurrentEditLevel //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
{ get { return EditLevel; } } //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
private static int _DocumentEntryUnique = 0; //return result;
private static int DocumentEntryUnique return true;
{ get { return ++_DocumentEntryUnique; } } }
private int _MyDocumentEntryUnique = DocumentEntryUnique; public static bool CanEditObject()
public int MyDocumentEntryUnique // Absolutely Unique ID - Editable FK {
{ get { return _MyDocumentEntryUnique; } } // CSLATODO: CanEdit Authorization
internal static DocumentEntry New(Entry myEntry) //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
{ return true;
return new DocumentEntry(myEntry); }
} #endregion
internal static DocumentEntry Get(SafeDataReader dr) #region Factory Methods
{ public int CurrentEditLevel
return new DocumentEntry(dr); { get { return EditLevel; } }
} private static int _DocumentEntryUnique = 0;
public DocumentEntry() private static int DocumentEntryUnique
{ { get { return ++_DocumentEntryUnique; } }
MarkAsChild(); private int _MyDocumentEntryUnique = DocumentEntryUnique;
public int MyDocumentEntryUnique // Absolutely Unique ID - Editable FK
{ get { return _MyDocumentEntryUnique; } }
internal static DocumentEntry New(Entry myEntry)
{
return new DocumentEntry(myEntry);
}
internal static DocumentEntry Get(SafeDataReader dr)
{
return new DocumentEntry(dr);
}
public DocumentEntry()
{
MarkAsChild();
_DTS = _DocumentEntryExtension.DefaultDTS; _DTS = _DocumentEntryExtension.DefaultDTS;
_UserID = _DocumentEntryExtension.DefaultUserID; _UserID = _DocumentEntryExtension.DefaultUserID;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
private DocumentEntry(Entry myEntry) private DocumentEntry(Entry myEntry)
{ {
MarkAsChild(); MarkAsChild();
// CSLATODO: Add any initialization & defaults // CSLATODO: Add any initialization & defaults
_DTS = _DocumentEntryExtension.DefaultDTS; _DTS = _DocumentEntryExtension.DefaultDTS;
_UserID = _DocumentEntryExtension.DefaultUserID; _UserID = _DocumentEntryExtension.DefaultUserID;
_MyEntry = myEntry; _MyEntry = myEntry;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
internal DocumentEntry(SafeDataReader dr) internal DocumentEntry(SafeDataReader dr)
{ {
MarkAsChild(); MarkAsChild();
Fetch(dr); Fetch(dr);
} }
private bool _Disposed = false; private bool _Disposed = false;
private static int _CountCreated = 0; private static int _CountCreated = 0;
private static int _CountDisposed = 0; private static int _CountDisposed = 0;
private static int _CountFinalized = 0; private static int _CountFinalized = 0;
private static int IncrementCountCreated private static int IncrementCountCreated
{ get { return ++_CountCreated; } } { get { return ++_CountCreated; } }
private int _CountWhenCreated = IncrementCountCreated; private int _CountWhenCreated = IncrementCountCreated;
public static int CountCreated public static int CountCreated
{ get { return _CountCreated; } } { get { return _CountCreated; } }
public static int CountNotDisposed public static int CountNotDisposed
{ get { return _CountCreated - _CountDisposed; } } { get { return _CountCreated - _CountDisposed; } }
public static int CountNotFinalized public static int CountNotFinalized
{ get { return _CountCreated - _CountFinalized; } } { get { return _CountCreated - _CountFinalized; } }
~DocumentEntry() ~DocumentEntry()
{ {
_CountFinalized++; _CountFinalized++;
} }
public void Dispose() public void Dispose()
{ {
if (_Disposed) return; if (_Disposed) return;
_CountDisposed++; _CountDisposed++;
_Disposed = true; _Disposed = true;
} }
#endregion #endregion
#region Data Access Portal #region Data Access Portal
private void Fetch(SafeDataReader dr) private void Fetch(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentEntry.FetchDR", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentEntry.FetchDR", GetHashCode());
try try
{ {
_ContentID = dr.GetInt32("ContentID"); _ContentID = dr.GetInt32("ContentID");
_DTS = dr.GetDateTime("DTS"); _DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
_Content_Number = dr.GetString("Content_Number"); _Content_Number = dr.GetString("Content_Number");
_Content_Text = dr.GetString("Content_Text"); _Content_Text = dr.GetString("Content_Text");
_Content_Type = (int?)dr.GetValue("Content_Type"); _Content_Type = (int?)dr.GetValue("Content_Type");
_Content_FormatID = (int?)dr.GetValue("Content_FormatID"); _Content_FormatID = (int?)dr.GetValue("Content_FormatID");
_Content_Config = dr.GetString("Content_Config"); _Content_Config = dr.GetString("Content_Config");
_Content_DTS = dr.GetDateTime("Content_DTS"); _Content_DTS = dr.GetDateTime("Content_DTS");
_Content_UserID = dr.GetString("Content_UserID"); _Content_UserID = dr.GetString("Content_UserID");
} }
catch (Exception ex) // FKItem Fetch catch (Exception ex) // FKItem Fetch
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentEntry.FetchDR", ex); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentEntry.FetchDR", ex);
throw new DbCslaException("DocumentEntry.Fetch", ex); throw new DbCslaException("DocumentEntry.Fetch", ex);
} }
MarkOld(); MarkOld();
} }
internal void Insert(Document myDocument) internal void Insert(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Entry.Add(cn, _MyEntry.MyContent, myDocument, _DTS, _UserID); _LastChanged = Entry.Add(cn, _MyEntry.MyContent, myDocument, _DTS, _UserID);
MarkOld(); MarkOld();
} }
internal void Update(Document myDocument) internal void Update(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Entry.Update(cn, _ContentID, myDocument.DocID, _DTS, _UserID, ref _LastChanged); _LastChanged = Entry.Update(cn, _ContentID, myDocument.DocID, _DTS, _UserID, ref _LastChanged);
MarkOld(); MarkOld();
} }
internal void DeleteSelf(Document myDocument) internal void DeleteSelf(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
// if we're new then don't update the database // if we're new then don't update the database
if (this.IsNew) return; if (this.IsNew) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
Entry.Remove(cn, _ContentID); Entry.Remove(cn, _ContentID);
MarkNew(); MarkNew();
} }
#endregion #endregion
// Standard Default Code // Standard Default Code
#region extension #region extension
DocumentEntryExtension _DocumentEntryExtension = new DocumentEntryExtension(); DocumentEntryExtension _DocumentEntryExtension = new DocumentEntryExtension();
[Serializable()] [Serializable()]
partial class DocumentEntryExtension : extensionBase partial class DocumentEntryExtension : extensionBase
{ {
} }
[Serializable()] [Serializable()]
class extensionBase class extensionBase
{ {
// Default Values // Default Values
public virtual DateTime DefaultDTS public virtual DateTime DefaultDTS
{ {
get { return DateTime.Now; } get { return DateTime.Now; }
} }
public virtual string DefaultUserID public virtual string DefaultUserID
{ {
get { return Volian.Base.Library.VlnSettings.UserID; } get { return Volian.Base.Library.VlnSettings.UserID; }
} }
// Authorization Rules // Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Instance Authorization Rules // Instance Authorization Rules
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Validation Rules // Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
// InstanceValidation Rules // InstanceValidation Rules
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
} }
#endregion #endregion
} // Class } // Class
#region Converter #region Converter
internal class DocumentEntryConverter : ExpandableObjectConverter internal class DocumentEntryConverter : ExpandableObjectConverter
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{ {
if (destType == typeof(string) && value is DocumentEntry) if (destType == typeof(string) && value is DocumentEntry)
{ {
// Return the ToString value // Return the ToString value
return ((DocumentEntry)value).ToString(); return ((DocumentEntry)value).ToString();
} }
return base.ConvertTo(context, culture, value, destType); return base.ConvertTo(context, culture, value, destType);
} }
} }
#endregion #endregion
} // Namespace } // Namespace

View File

@@ -19,482 +19,496 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void DocumentInfoEvent(object sender); public delegate void DocumentInfoEvent(object sender);
/// <summary> /// <summary>
/// DocumentInfo Generated by MyGeneration using the CSLA Object Mapping template /// DocumentInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DocumentInfoConverter))] [TypeConverter(typeof(DocumentInfoConverter))]
public partial class DocumentInfo : ReadOnlyBase<DocumentInfo>, IDisposable public partial class DocumentInfo : ReadOnlyBase<DocumentInfo>, IDisposable
{ {
public event DocumentInfoEvent Changed; public event DocumentInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<DocumentInfo> _CacheList = new List<DocumentInfo>(); private static List<DocumentInfo> _CacheList = new List<DocumentInfo>();
protected static void AddToCache(DocumentInfo documentInfo) protected static void AddToCache(DocumentInfo documentInfo)
{ {
if (!_CacheList.Contains(documentInfo)) _CacheList.Add(documentInfo); // In AddToCache if (!_CacheList.Contains(documentInfo)) _CacheList.Add(documentInfo); // In AddToCache
} }
protected static void RemoveFromCache(DocumentInfo documentInfo) protected static void RemoveFromCache(DocumentInfo documentInfo)
{ {
while (_CacheList.Contains(documentInfo)) _CacheList.Remove(documentInfo); // In RemoveFromCache while (_CacheList.Contains(documentInfo)) _CacheList.Remove(documentInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<DocumentInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentInfo>>(); private static Dictionary<string, List<DocumentInfo>> _CacheByPrimaryKey = new Dictionary<string, List<DocumentInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move DocumentInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move DocumentInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
DocumentInfo tmp = _CacheList[0]; // Get the first DocumentInfo DocumentInfo tmp = _CacheList[0]; // Get the first DocumentInfo
string pKey = tmp.DocID.ToString(); string pKey = tmp.DocID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<DocumentInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<DocumentInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first DocumentInfo _CacheList.RemoveAt(0); // Remove the first DocumentInfo
} }
} }
internal static void AddList(DocumentInfoList lst) internal static void AddList(DocumentInfoList lst)
{ {
foreach (DocumentInfo item in lst) AddToCache(item); foreach (DocumentInfo item in lst) AddToCache(item);
} }
protected static DocumentInfo GetCachedByPrimaryKey(int docID) protected static DocumentInfo GetCachedByPrimaryKey(int docID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = docID.ToString(); string key = docID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Document _Editable; protected Document _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _DocID; private int _DocID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DocID public int DocID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DocID; CanReadProperty("DocID", true);
} return _DocID;
} }
private string _LibTitle = string.Empty; }
public string LibTitle private string _LibTitle = string.Empty;
{ public string LibTitle
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _LibTitle; {
} CanReadProperty("LibTitle", true);
} return _LibTitle;
private byte[] _DocContent; }
/// <summary> }
/// Actual content of a Word Document (RTF, DOC or XML Format) private byte[] _DocContent;
/// </summary> /// <summary>
public byte[] DocContent /// Actual content of a Word Document (RTF, DOC or XML Format)
{ /// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public byte[] DocContent
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _DocContent; get
} {
} CanReadProperty("DocContent", true);
private string _DocAscii = string.Empty; return _DocContent;
/// <summary> }
/// Used for searching }
/// </summary> private string _DocAscii = string.Empty;
public string DocAscii /// <summary>
{ /// Used for searching
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// </summary>
get public string DocAscii
{ {
return _DocAscii; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _Config = string.Empty; CanReadProperty("DocAscii", true);
public string Config return _DocAscii;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Config = string.Empty;
{ public string Config
return _Config; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private DateTime _DTS = new DateTime(); {
public DateTime DTS CanReadProperty("Config", true);
{ return _Config;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private DateTime _DTS = new DateTime();
return _DTS; public DateTime DTS
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _UserID = string.Empty; get
public string UserID {
{ CanReadProperty("DTS", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _DTS;
get }
{ }
return _UserID; private string _UserID = string.Empty;
} public string UserID
} {
private string _FileExtension = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string FileExtension get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("UserID", true);
get return _UserID;
{ }
return _FileExtension; }
} private string _FileExtension = string.Empty;
} public string FileExtension
private int _DocumentDROUsageCount = 0; {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Count of DocumentDROUsages for this Document get
/// </summary> {
public int DocumentDROUsageCount CanReadProperty("FileExtension", true);
{ return _FileExtension;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int _DocumentDROUsageCount = 0;
if (_DocumentDROUsageCount < 0) /// <summary>
_DocumentDROUsageCount = DocumentDROUsages.Count; /// Count of DocumentDROUsages for this Document
return _DocumentDROUsageCount; /// </summary>
} public int DocumentDROUsageCount
} {
private DROUsageInfoList _DocumentDROUsages = null; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[TypeConverter(typeof(DROUsageInfoListConverter))] get
public DROUsageInfoList DocumentDROUsages {
{ CanReadProperty("DocumentDROUsageCount", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_DocumentDROUsageCount < 0)
get _DocumentDROUsageCount = DocumentDROUsages.Count;
{ return _DocumentDROUsageCount;
if (_DocumentDROUsageCount < 0 || (_DocumentDROUsageCount > 0 && _DocumentDROUsages == null)) }
_DocumentDROUsages = DROUsageInfoList.GetByDocID(_DocID); }
if (_DocumentDROUsageCount < 0) private DROUsageInfoList _DocumentDROUsages = null;
_DocumentDROUsageCount = _DocumentDROUsages.Count; [TypeConverter(typeof(DROUsageInfoListConverter))]
return _DocumentDROUsages; public DROUsageInfoList DocumentDROUsages
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public void RefreshDocumentDROUsages() get
{ {
_DocumentDROUsageCount = -1; CanReadProperty("DocumentDROUsages", true);
ConvertListToDictionary(); if (_DocumentDROUsageCount < 0 || (_DocumentDROUsageCount > 0 && _DocumentDROUsages == null))
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) _DocumentDROUsages = DROUsageInfoList.GetByDocID(_DocID);
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) if (_DocumentDROUsageCount < 0)
tmp._DocumentDROUsageCount = -1; // This will cause the data to be requeried _DocumentDROUsageCount = _DocumentDROUsages.Count;
} return _DocumentDROUsages;
private int _DocumentEntryCount = 0; }
/// <summary> }
/// Count of DocumentEntries for this Document public void RefreshDocumentDROUsages()
/// </summary> {
public int DocumentEntryCount _DocumentDROUsageCount = -1;
{ ConvertListToDictionary();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
get foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
{ tmp._DocumentDROUsageCount = -1; // This will cause the data to be requeried
if (_DocumentEntryCount < 0) }
_DocumentEntryCount = DocumentEntries.Count; private int _DocumentEntryCount = 0;
return _DocumentEntryCount; /// <summary>
} /// Count of DocumentEntries for this Document
} /// </summary>
private EntryInfoList _DocumentEntries = null; public int DocumentEntryCount
[TypeConverter(typeof(EntryInfoListConverter))] {
public EntryInfoList DocumentEntries [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get CanReadProperty("DocumentEntryCount", true);
{ if (_DocumentEntryCount < 0)
if (_DocumentEntryCount < 0 || (_DocumentEntryCount > 0 && _DocumentEntries == null)) _DocumentEntryCount = DocumentEntries.Count;
_DocumentEntries = EntryInfoList.GetByDocID(_DocID); return _DocumentEntryCount;
if (_DocumentEntryCount < 0) }
_DocumentEntryCount = _DocumentEntries.Count; }
return _DocumentEntries; private EntryInfoList _DocumentEntries = null;
} [TypeConverter(typeof(EntryInfoListConverter))]
} public EntryInfoList DocumentEntries
public void RefreshDocumentEntries() {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_DocumentEntryCount = -1; get
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) CanReadProperty("DocumentEntries", true);
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) if (_DocumentEntryCount < 0 || (_DocumentEntryCount > 0 && _DocumentEntries == null))
tmp._DocumentEntryCount = -1; // This will cause the data to be requeried _DocumentEntries = EntryInfoList.GetByDocID(_DocID);
} if (_DocumentEntryCount < 0)
private int _DocumentPdfCount = 0; _DocumentEntryCount = _DocumentEntries.Count;
/// <summary> return _DocumentEntries;
/// Count of DocumentPdfs for this Document }
/// </summary> }
public int DocumentPdfCount public void RefreshDocumentEntries()
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] _DocumentEntryCount = -1;
get ConvertListToDictionary();
{ if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
if (_DocumentPdfCount < 0) foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
_DocumentPdfCount = DocumentPdfs.Count; tmp._DocumentEntryCount = -1; // This will cause the data to be requeried
return _DocumentPdfCount; }
} private int _DocumentPdfCount = 0;
} /// <summary>
private PdfInfoList _DocumentPdfs = null; /// Count of DocumentPdfs for this Document
[TypeConverter(typeof(PdfInfoListConverter))] /// </summary>
public PdfInfoList DocumentPdfs public int DocumentPdfCount
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
if (_DocumentPdfCount < 0 || (_DocumentPdfCount > 0 && _DocumentPdfs == null)) CanReadProperty("DocumentPdfCount", true);
_DocumentPdfs = PdfInfoList.GetByDocID(_DocID); if (_DocumentPdfCount < 0)
if (_DocumentPdfCount < 0) _DocumentPdfCount = DocumentPdfs.Count;
_DocumentPdfCount = _DocumentPdfs.Count; return _DocumentPdfCount;
return _DocumentPdfs; }
} }
} private PdfInfoList _DocumentPdfs = null;
public void RefreshDocumentPdfs() [TypeConverter(typeof(PdfInfoListConverter))]
{ public PdfInfoList DocumentPdfs
_DocumentPdfCount = -1; {
ConvertListToDictionary(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) get
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) {
tmp._DocumentPdfCount = -1; // This will cause the data to be requeried CanReadProperty("DocumentPdfs", true);
} if (_DocumentPdfCount < 0 || (_DocumentPdfCount > 0 && _DocumentPdfs == null))
// CSLATODO: Replace base DocumentInfo.ToString function as necessary _DocumentPdfs = PdfInfoList.GetByDocID(_DocID);
/// <summary> if (_DocumentPdfCount < 0)
/// Overrides Base ToString _DocumentPdfCount = _DocumentPdfs.Count;
/// </summary> return _DocumentPdfs;
/// <returns>A string representation of current DocumentInfo</returns> }
//public override string ToString() }
//{ public void RefreshDocumentPdfs()
// return base.ToString(); {
//} _DocumentPdfCount = -1;
// CSLATODO: Check DocumentInfo.GetIdValue to assure that the ID returned is unique ConvertListToDictionary();
/// <summary> if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
/// </summary> tmp._DocumentPdfCount = -1; // This will cause the data to be requeried
/// <returns>A Unique ID for the current DocumentInfo</returns> }
protected override object GetIdValue() // CSLATODO: Replace base DocumentInfo.ToString function as necessary
{ /// <summary>
return MyDocumentInfoUnique; // Absolutely Unique ID /// Overrides Base ToString
} /// </summary>
#endregion /// <returns>A string representation of current DocumentInfo</returns>
#region Factory Methods //public override string ToString()
private static int _DocumentInfoUnique = 0; //{
private static int DocumentInfoUnique // return base.ToString();
{ get { return ++_DocumentInfoUnique; } } //}
private int _MyDocumentInfoUnique = DocumentInfoUnique; // CSLATODO: Check DocumentInfo.GetIdValue to assure that the ID returned is unique
public int MyDocumentInfoUnique // Absolutely Unique ID - Info /// <summary>
{ get { return _MyDocumentInfoUnique; } } /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
protected DocumentInfo() /// </summary>
{/* require use of factory methods */ /// <returns>A Unique ID for the current DocumentInfo</returns>
AddToCache(this); protected override object GetIdValue()
} {
private bool _Disposed = false; return MyDocumentInfoUnique; // Absolutely Unique ID
private static int _CountCreated = 0; }
private static int _CountDisposed = 0; #endregion
private static int _CountFinalized = 0; #region Factory Methods
private static int IncrementCountCreated private static int _DocumentInfoUnique = 0;
{ get { return ++_CountCreated; } } private static int DocumentInfoUnique
private int _CountWhenCreated = IncrementCountCreated; { get { return ++_DocumentInfoUnique; } }
public static int CountCreated private int _MyDocumentInfoUnique = DocumentInfoUnique;
{ get { return _CountCreated; } } public int MyDocumentInfoUnique // Absolutely Unique ID - Info
public static int CountNotDisposed { get { return _MyDocumentInfoUnique; } }
{ get { return _CountCreated - _CountDisposed; } } protected DocumentInfo()
public static int CountNotFinalized {/* require use of factory methods */
{ get { return _CountCreated - _CountFinalized; } } AddToCache(this);
~DocumentInfo() }
{ private bool _Disposed = false;
_CountFinalized++; private static int _CountCreated = 0;
} private static int _CountDisposed = 0;
public void Dispose() private static int _CountFinalized = 0;
{ private static int IncrementCountCreated
if (_Disposed) return; { get { return ++_CountCreated; } }
_CountDisposed++; private int _CountWhenCreated = IncrementCountCreated;
_Disposed = true; public static int CountCreated
RemoveFromCache(this); { get { return _CountCreated; } }
if (!_CacheByPrimaryKey.ContainsKey(DocID.ToString())) return; public static int CountNotDisposed
List<DocumentInfo> listDocumentInfo = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items { get { return _CountCreated - _CountDisposed; } }
while (listDocumentInfo.Contains(this)) listDocumentInfo.Remove(this); // Remove the item from the list public static int CountNotFinalized
if (listDocumentInfo.Count == 0) // If there are no items left in the list { get { return _CountCreated - _CountFinalized; } }
_CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list ~DocumentInfo()
} {
public virtual Document Get() _CountFinalized++;
{ }
return _Editable = Document.Get(_DocID); public void Dispose()
} {
public static void Refresh(Document tmp) if (_Disposed) return;
{ _CountDisposed++;
string key = tmp.DocID.ToString(); _Disposed = true;
ConvertListToDictionary(); RemoveFromCache(this);
if (_CacheByPrimaryKey.ContainsKey(key)) if (!_CacheByPrimaryKey.ContainsKey(DocID.ToString())) return;
foreach (DocumentInfo tmpInfo in _CacheByPrimaryKey[key]) List<DocumentInfo> listDocumentInfo = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items
tmpInfo.RefreshFields(tmp); while (listDocumentInfo.Contains(this)) listDocumentInfo.Remove(this); // Remove the item from the list
} if (listDocumentInfo.Count == 0) // If there are no items left in the list
protected virtual void RefreshFields(Document tmp) _CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list
{ }
_LibTitle = tmp.LibTitle; public virtual Document Get()
_DocContent = tmp.DocContent; {
_DocAscii = tmp.DocAscii; return _Editable = Document.Get(_DocID);
_Config = tmp.Config; }
_DTS = tmp.DTS; public static void Refresh(Document tmp)
_UserID = tmp.UserID; {
_FileExtension = tmp.FileExtension; string key = tmp.DocID.ToString();
_DocumentInfoExtension.Refresh(this); ConvertListToDictionary();
OnChange();// raise an event if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (DocumentInfo tmpInfo in _CacheByPrimaryKey[key])
public static DocumentInfo Get(int docID) tmpInfo.RefreshFields(tmp);
{ }
//if (!CanGetObject()) protected virtual void RefreshFields(Document tmp)
// throw new System.Security.SecurityException("User not authorized to view a Document"); {
try _LibTitle = tmp.LibTitle;
{ _DocContent = tmp.DocContent;
DocumentInfo tmp = GetCachedByPrimaryKey(docID); _DocAscii = tmp.DocAscii;
if (tmp == null) _Config = tmp.Config;
{ _DTS = tmp.DTS;
tmp = DataPortal.Fetch<DocumentInfo>(new PKCriteria(docID)); _UserID = tmp.UserID;
AddToCache(tmp); _FileExtension = tmp.FileExtension;
} _DocumentInfoExtension.Refresh(this);
if (tmp.ErrorMessage == "No Record Found") OnChange();// raise an event
{ }
tmp.Dispose(); // Clean-up DocumentInfo public static DocumentInfo Get(int docID)
tmp = null; {
} //if (!CanGetObject())
return tmp; // throw new System.Security.SecurityException("User not authorized to view a Document");
} try
catch (Exception ex) {
{ DocumentInfo tmp = GetCachedByPrimaryKey(docID);
throw new DbCslaException("Error on DocumentInfo.Get", ex); if (tmp == null)
} {
} tmp = DataPortal.Fetch<DocumentInfo>(new PKCriteria(docID));
#endregion AddToCache(tmp);
#region Data Access Portal }
internal DocumentInfo(SafeDataReader dr) if (tmp.ErrorMessage == "No Record Found")
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.Constructor", GetHashCode()); tmp.Dispose(); // Clean-up DocumentInfo
try tmp = null;
{ }
ReadData(dr); return tmp;
} }
catch (Exception ex) catch (Exception ex)
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.Constructor", ex); throw new DbCslaException("Error on DocumentInfo.Get", ex);
throw new DbCslaException("DocumentInfo.Constructor", ex); }
} }
} #endregion
[Serializable()] #region Data Access Portal
protected class PKCriteria internal DocumentInfo(SafeDataReader dr)
{ {
private int _DocID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.Constructor", GetHashCode());
public int DocID try
{ get { return _DocID; } } {
public PKCriteria(int docID) ReadData(dr);
{ }
_DocID = docID; catch (Exception ex)
} {
} if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.Constructor", ex);
private void ReadData(SafeDataReader dr) throw new DbCslaException("DocumentInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.ReadData", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
_DocID = dr.GetInt32("DocID"); {
_LibTitle = dr.GetString("LibTitle"); private int _DocID;
_DocContent = (byte[])dr.GetValue("DocContent"); public int DocID
_DocAscii = dr.GetString("DocAscii"); { get { return _DocID; } }
_Config = dr.GetString("Config"); public PKCriteria(int docID)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); _DocID = docID;
_FileExtension = dr.GetString("FileExtension"); }
_DocumentDROUsageCount = dr.GetInt32("DROUsageCount"); }
_DocumentEntryCount = dr.GetInt32("EntryCount"); private void ReadData(SafeDataReader dr)
_DocumentPdfCount = dr.GetInt32("PdfCount"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.ReadData", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.ReadData", ex); _DocID = dr.GetInt32("DocID");
_ErrorMessage = ex.Message; _LibTitle = dr.GetString("LibTitle");
throw new DbCslaException("DocumentInfo.ReadData", ex); _DocContent = (byte[])dr.GetValue("DocContent");
} _DocAscii = dr.GetString("DocAscii");
} _Config = dr.GetString("Config");
private void DataPortal_Fetch(PKCriteria criteria) _DTS = dr.GetDateTime("DTS");
{ _UserID = dr.GetString("UserID");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode()); _FileExtension = dr.GetString("FileExtension");
try _DocumentDROUsageCount = dr.GetInt32("DROUsageCount");
{ _DocumentEntryCount = dr.GetInt32("EntryCount");
using (SqlConnection cn = Database.VEPROMS_SqlConnection) _DocumentPdfCount = dr.GetInt32("PdfCount");
{ }
ApplicationContext.LocalContext["cn"] = cn; catch (Exception ex)
using (SqlCommand cm = cn.CreateCommand()) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.ReadData", ex);
cm.CommandType = CommandType.StoredProcedure; _ErrorMessage = ex.Message;
cm.CommandText = "getDocument"; throw new DbCslaException("DocumentInfo.ReadData", ex);
cm.Parameters.AddWithValue("@DocID", criteria.DocID); }
cm.CommandTimeout = Database.DefaultTimeout; }
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) private void DataPortal_Fetch(PKCriteria criteria)
{ {
if (!dr.Read()) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode());
{ try
_ErrorMessage = "No Record Found"; {
return; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
} {
ReadData(dr); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
// removing of item only needed for local data portal cm.CommandType = CommandType.StoredProcedure;
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) cm.CommandText = "getDocument";
ApplicationContext.LocalContext.Remove("cn"); cm.Parameters.AddWithValue("@DocID", criteria.DocID);
} cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
catch (Exception ex) {
{ if (!dr.Read())
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.DataPortal_Fetch", ex); {
_ErrorMessage = ex.Message; _ErrorMessage = "No Record Found";
throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex); return;
} }
} ReadData(dr);
#endregion }
// Standard Refresh }
#region extension // removing of item only needed for local data portal
DocumentInfoExtension _DocumentInfoExtension = new DocumentInfoExtension(); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
[Serializable()] ApplicationContext.LocalContext.Remove("cn");
partial class DocumentInfoExtension : extensionBase { } }
[Serializable()] }
class extensionBase catch (Exception ex)
{ {
// Default Refresh if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.DataPortal_Fetch", ex);
public virtual void Refresh(DocumentInfo tmp) { } _ErrorMessage = ex.Message;
} throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex);
#endregion }
} // Class }
#region Converter #endregion
internal class DocumentInfoConverter : ExpandableObjectConverter // Standard Refresh
{ #region extension
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) DocumentInfoExtension _DocumentInfoExtension = new DocumentInfoExtension();
{ [Serializable()]
if (destType == typeof(string) && value is DocumentInfo) partial class DocumentInfoExtension : extensionBase { }
{ [Serializable()]
// Return the ToString value class extensionBase
return ((DocumentInfo)value).ToString(); {
} // Default Refresh
return base.ConvertTo(context, culture, value, destType); public virtual void Refresh(DocumentInfo tmp) { }
} }
} #endregion
#endregion } // Class
#region Converter
internal class DocumentInfoConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is DocumentInfo)
{
// Return the ToString value
return ((DocumentInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -20,458 +20,471 @@ using System.Collections.Generic;
using Csla.Validation; using Csla.Validation;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
/// <summary> /// <summary>
/// DocumentPdf Generated by MyGeneration using the CSLA Object Mapping template /// DocumentPdf Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(DocumentPdfConverter))] [TypeConverter(typeof(DocumentPdfConverter))]
public partial class DocumentPdf : BusinessBase<DocumentPdf>, IVEHasBrokenRules, IDisposable public partial class DocumentPdf : BusinessBase<DocumentPdf>, IVEHasBrokenRules, IDisposable
{ {
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
private int _DebugStatus; private int _DebugStatus;
/// <summary> /// <summary>
/// > 0 for Debug /// > 0 for Debug
/// </summary> /// </summary>
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int DebugStatus public int DebugStatus
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _DebugStatus; CanReadProperty("DebugStatus", true);
} return _DebugStatus;
} }
private int _TopRow; }
[System.ComponentModel.DataObjectField(true, true)] private int _TopRow;
public int TopRow [System.ComponentModel.DataObjectField(true, true)]
{ public int TopRow
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _TopRow; {
} CanReadProperty("TopRow", true);
} return _TopRow;
private int _PageLength; }
[System.ComponentModel.DataObjectField(true, true)] }
public int PageLength private int _PageLength;
{ [System.ComponentModel.DataObjectField(true, true)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int PageLength
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _PageLength; get
} {
} CanReadProperty("PageLength", true);
private int _LeftMargin; return _PageLength;
[System.ComponentModel.DataObjectField(true, true)] }
public int LeftMargin }
{ private int _LeftMargin;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.ComponentModel.DataObjectField(true, true)]
get public int LeftMargin
{ {
return _LeftMargin; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private int _PageWidth; CanReadProperty("LeftMargin", true);
[System.ComponentModel.DataObjectField(true, true)] return _LeftMargin;
public int PageWidth }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _PageWidth;
get [System.ComponentModel.DataObjectField(true, true)]
{ public int PageWidth
return _PageWidth; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private double _PageCount; {
/// <summary> CanReadProperty("PageWidth", true);
/// Count of whole and partial pages return _PageWidth;
/// </summary> }
public double PageCount }
{ private double _PageCount;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Count of whole and partial pages
{ /// </summary>
return _PageCount; public double PageCount
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set get
{ {
if (_PageCount != value) CanReadProperty("PageCount", true);
{ return _PageCount;
_PageCount = value; }
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
} {
} CanWriteProperty("PageCount", true);
private byte[] _DocPdf; if (_PageCount != value)
public byte[] DocPdf {
{ _PageCount = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
get }
{ }
return _DocPdf; }
} private byte[] _DocPdf;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public byte[] DocPdf
set {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_DocPdf != value) get
{ {
_DocPdf = value; CanReadProperty("DocPdf", true);
PropertyHasChanged(); return _DocPdf;
} }
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
private DateTime _DTS = new DateTime(); {
public DateTime DTS CanWriteProperty("DocPdf", true);
{ if (_DocPdf != value)
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get _DocPdf = value;
{ PropertyHasChanged();
return _DTS; }
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
set private DateTime _DTS = new DateTime();
{ public DateTime DTS
if (_DTS != value) {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_DTS = value; get
PropertyHasChanged(); {
} CanReadProperty("DTS", true);
} return _DTS;
} }
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID set
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanWriteProperty("DTS", true);
get if (_DTS != value)
{ {
return _UserID; _DTS = value;
} PropertyHasChanged();
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
set }
{ }
if (value == null) value = string.Empty; private string _UserID = string.Empty;
if (_UserID != value) public string UserID
{ {
_UserID = value; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
PropertyHasChanged(); get
} {
} CanReadProperty("UserID", true);
} return _UserID;
private byte[] _LastChanged = new byte[8];//timestamp }
// CSLATODO: Check DocumentPdf.GetIdValue to assure that the ID returned is unique [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <summary> set
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality {
/// </summary> CanWriteProperty("UserID", true);
/// <returns>A Unique ID for the current DocumentPdf</returns> if (value == null) value = string.Empty;
protected override object GetIdValue() if (_UserID != value)
{ {
return MyDocumentPdfUnique; // Absolutely Unique ID _UserID = value;
} PropertyHasChanged();
// CSLATODO: Replace base DocumentPdf.ToString function as necessary }
/// <summary> }
/// Overrides Base ToString }
/// </summary> private byte[] _LastChanged = new byte[8];//timestamp
/// <returns>A string representation of current DocumentPdf</returns> // CSLATODO: Check DocumentPdf.GetIdValue to assure that the ID returned is unique
//public override string ToString() /// <summary>
//{ /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
// return base.ToString(); /// </summary>
//} /// <returns>A Unique ID for the current DocumentPdf</returns>
public override bool IsDirty protected override object GetIdValue()
{ {
get { return base.IsDirty; } return MyDocumentPdfUnique; // Absolutely Unique ID
} }
public bool IsDirtyList(List<object> list) // CSLATODO: Replace base DocumentPdf.ToString function as necessary
{ /// <summary>
return base.IsDirty; /// Overrides Base ToString
} /// </summary>
public override bool IsValid /// <returns>A string representation of current DocumentPdf</returns>
{ //public override string ToString()
get { return (IsNew && !IsDirty) ? true : base.IsValid; } //{
} // return base.ToString();
public bool IsValidList(List<object> list) //}
{ public override bool IsDirty
return (IsNew && !IsDirty) ? true : base.IsValid; {
} get { return base.IsDirty; }
#endregion }
#region ValidationRules public bool IsDirtyList(List<object> list)
[NonSerialized] {
private bool _CheckingBrokenRules = false; return base.IsDirty;
public IVEHasBrokenRules HasBrokenRules }
{ public override bool IsValid
get {
{ get { return (IsNew && !IsDirty) ? true : base.IsValid; }
if (_CheckingBrokenRules) return null; }
if (BrokenRulesCollection.Count > 0) return this; public bool IsValidList(List<object> list)
try {
{ return (IsNew && !IsDirty) ? true : base.IsValid;
_CheckingBrokenRules = true; }
IVEHasBrokenRules hasBrokenRules = null; #endregion
return hasBrokenRules; #region ValidationRules
} [NonSerialized]
finally private bool _CheckingBrokenRules = false;
{ public IVEHasBrokenRules HasBrokenRules
_CheckingBrokenRules = false; {
} get
} {
} if (_CheckingBrokenRules) return null;
public BrokenRulesCollection BrokenRules if (BrokenRulesCollection.Count > 0) return this;
{ try
get {
{ _CheckingBrokenRules = true;
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; IVEHasBrokenRules hasBrokenRules = null;
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; return hasBrokenRules;
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); }
} finally
} {
protected override void AddBusinessRules() _CheckingBrokenRules = false;
{ }
ValidationRules.AddRule( }
Csla.Validation.CommonRules.StringRequired, "UserID"); }
ValidationRules.AddRule( public BrokenRulesCollection BrokenRules
Csla.Validation.CommonRules.StringMaxLength, {
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); get
// CSLATODO: Add other validation rules {
} IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
// Sample data comparison validation rule if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
//{ }
// if (_started > _ended) }
// { protected override void AddBusinessRules()
// e.Description = "Start date can't be after end date"; {
// return false; ValidationRules.AddRule(
// } Csla.Validation.CommonRules.StringRequired, "UserID");
// else ValidationRules.AddRule(
// return true; Csla.Validation.CommonRules.StringMaxLength,
//} new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
#endregion // CSLATODO: Add other validation rules
#region Authorization Rules }
protected override void AddAuthorizationRules() // Sample data comparison validation rule
{ //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
//CSLATODO: Who can read/write which fields //{
//AuthorizationRules.AllowRead(DebugStatus, "<Role(s)>"); // if (_started > _ended)
//AuthorizationRules.AllowRead(TopRow, "<Role(s)>"); // {
//AuthorizationRules.AllowRead(PageLength, "<Role(s)>"); // e.Description = "Start date can't be after end date";
//AuthorizationRules.AllowRead(LeftMargin, "<Role(s)>"); // return false;
//AuthorizationRules.AllowRead(PageWidth, "<Role(s)>"); // }
//AuthorizationRules.AllowRead(PageCount, "<Role(s)>"); // else
//AuthorizationRules.AllowWrite(PageCount, "<Role(s)>"); // return true;
//AuthorizationRules.AllowRead(DocPdf, "<Role(s)>"); //}
//AuthorizationRules.AllowWrite(DocPdf, "<Role(s)>"); #endregion
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); #region Authorization Rules
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); protected override void AddAuthorizationRules()
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); {
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); //CSLATODO: Who can read/write which fields
} //AuthorizationRules.AllowRead(DebugStatus, "<Role(s)>");
public static bool CanAddObject() //AuthorizationRules.AllowRead(TopRow, "<Role(s)>");
{ //AuthorizationRules.AllowRead(PageLength, "<Role(s)>");
// CSLATODO: Can Add Authorization //AuthorizationRules.AllowRead(LeftMargin, "<Role(s)>");
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //AuthorizationRules.AllowRead(PageWidth, "<Role(s)>");
return true; //AuthorizationRules.AllowRead(PageCount, "<Role(s)>");
} //AuthorizationRules.AllowWrite(PageCount, "<Role(s)>");
public static bool CanGetObject() //AuthorizationRules.AllowRead(DocPdf, "<Role(s)>");
{ //AuthorizationRules.AllowWrite(DocPdf, "<Role(s)>");
// CSLATODO: CanGet Authorization //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
return true; //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
} //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
public static bool CanDeleteObject() //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
{ }
// CSLATODO: CanDelete Authorization public static bool CanAddObject()
//bool result = false; {
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; // CSLATODO: Can Add Authorization
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//return result; return true;
return true; }
} public static bool CanGetObject()
public static bool CanEditObject() {
{ // CSLATODO: CanGet Authorization
// CSLATODO: CanEdit Authorization return true;
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); }
return true; public static bool CanDeleteObject()
} {
#endregion // CSLATODO: CanDelete Authorization
#region Factory Methods //bool result = false;
public int CurrentEditLevel //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
{ get { return EditLevel; } } //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
private static int _DocumentPdfUnique = 0; //return result;
private static int DocumentPdfUnique return true;
{ get { return ++_DocumentPdfUnique; } } }
private int _MyDocumentPdfUnique = DocumentPdfUnique; public static bool CanEditObject()
public int MyDocumentPdfUnique // Absolutely Unique ID - Editable FK {
{ get { return _MyDocumentPdfUnique; } } // CSLATODO: CanEdit Authorization
internal static DocumentPdf New(int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount) //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
{ return true;
return new DocumentPdf(debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount); }
} #endregion
internal static DocumentPdf Get(SafeDataReader dr) #region Factory Methods
{ public int CurrentEditLevel
return new DocumentPdf(dr); { get { return EditLevel; } }
} private static int _DocumentPdfUnique = 0;
public DocumentPdf() private static int DocumentPdfUnique
{ { get { return ++_DocumentPdfUnique; } }
MarkAsChild(); private int _MyDocumentPdfUnique = DocumentPdfUnique;
public int MyDocumentPdfUnique // Absolutely Unique ID - Editable FK
{ get { return _MyDocumentPdfUnique; } }
internal static DocumentPdf New(int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount)
{
return new DocumentPdf(debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount);
}
internal static DocumentPdf Get(SafeDataReader dr)
{
return new DocumentPdf(dr);
}
public DocumentPdf()
{
MarkAsChild();
_DTS = _DocumentPdfExtension.DefaultDTS; _DTS = _DocumentPdfExtension.DefaultDTS;
_UserID = _DocumentPdfExtension.DefaultUserID; _UserID = _DocumentPdfExtension.DefaultUserID;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
private DocumentPdf(int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount) private DocumentPdf(int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount)
{ {
MarkAsChild(); MarkAsChild();
// CSLATODO: Add any initialization & defaults // CSLATODO: Add any initialization & defaults
_DTS = _DocumentPdfExtension.DefaultDTS; _DTS = _DocumentPdfExtension.DefaultDTS;
_UserID = _DocumentPdfExtension.DefaultUserID; _UserID = _DocumentPdfExtension.DefaultUserID;
_DebugStatus = debugStatus; _DebugStatus = debugStatus;
_TopRow = topRow; _TopRow = topRow;
_PageLength = pageLength; _PageLength = pageLength;
_LeftMargin = leftMargin; _LeftMargin = leftMargin;
_PageWidth = pageWidth; _PageWidth = pageWidth;
_PageCount = pageCount; _PageCount = pageCount;
ValidationRules.CheckRules(); ValidationRules.CheckRules();
} }
internal DocumentPdf(SafeDataReader dr) internal DocumentPdf(SafeDataReader dr)
{ {
MarkAsChild(); MarkAsChild();
Fetch(dr); Fetch(dr);
} }
private bool _Disposed = false; private bool _Disposed = false;
private static int _CountCreated = 0; private static int _CountCreated = 0;
private static int _CountDisposed = 0; private static int _CountDisposed = 0;
private static int _CountFinalized = 0; private static int _CountFinalized = 0;
private static int IncrementCountCreated private static int IncrementCountCreated
{ get { return ++_CountCreated; } } { get { return ++_CountCreated; } }
private int _CountWhenCreated = IncrementCountCreated; private int _CountWhenCreated = IncrementCountCreated;
public static int CountCreated public static int CountCreated
{ get { return _CountCreated; } } { get { return _CountCreated; } }
public static int CountNotDisposed public static int CountNotDisposed
{ get { return _CountCreated - _CountDisposed; } } { get { return _CountCreated - _CountDisposed; } }
public static int CountNotFinalized public static int CountNotFinalized
{ get { return _CountCreated - _CountFinalized; } } { get { return _CountCreated - _CountFinalized; } }
~DocumentPdf() ~DocumentPdf()
{ {
_CountFinalized++; _CountFinalized++;
} }
public void Dispose() public void Dispose()
{ {
if (_Disposed) return; if (_Disposed) return;
_CountDisposed++; _CountDisposed++;
_Disposed = true; _Disposed = true;
} }
#endregion #endregion
#region Data Access Portal #region Data Access Portal
private void Fetch(SafeDataReader dr) private void Fetch(SafeDataReader dr)
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentPdf.FetchDR", GetHashCode()); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentPdf.FetchDR", GetHashCode());
try try
{ {
_DebugStatus = dr.GetInt32("DebugStatus"); _DebugStatus = dr.GetInt32("DebugStatus");
_TopRow = dr.GetInt32("TopRow"); _TopRow = dr.GetInt32("TopRow");
_PageLength = dr.GetInt32("PageLength"); _PageLength = dr.GetInt32("PageLength");
_LeftMargin = dr.GetInt32("LeftMargin"); _LeftMargin = dr.GetInt32("LeftMargin");
_PageWidth = dr.GetInt32("PageWidth"); _PageWidth = dr.GetInt32("PageWidth");
_PageCount = dr.GetDouble("PageCount"); _PageCount = dr.GetDouble("PageCount");
_DocPdf = (byte[])dr.GetValue("DocPdf"); _DocPdf = (byte[])dr.GetValue("DocPdf");
_DTS = dr.GetDateTime("DTS"); _DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID"); _UserID = dr.GetString("UserID");
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
} }
catch (Exception ex) // FKItem Fetch catch (Exception ex) // FKItem Fetch
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentPdf.FetchDR", ex); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentPdf.FetchDR", ex);
throw new DbCslaException("DocumentPdf.Fetch", ex); throw new DbCslaException("DocumentPdf.Fetch", ex);
} }
MarkOld(); MarkOld();
} }
internal void Insert(Document myDocument) internal void Insert(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Pdf.Add(cn, myDocument, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID); _LastChanged = Pdf.Add(cn, myDocument, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID);
MarkOld(); MarkOld();
} }
internal void Update(Document myDocument) internal void Update(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
_LastChanged = Pdf.Update(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID, ref _LastChanged); _LastChanged = Pdf.Update(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID, ref _LastChanged);
MarkOld(); MarkOld();
} }
internal void DeleteSelf(Document myDocument) internal void DeleteSelf(Document myDocument)
{ {
// if we're not dirty then don't update the database // if we're not dirty then don't update the database
if (!this.IsDirty) return; if (!this.IsDirty) return;
// if we're new then don't update the database // if we're new then don't update the database
if (this.IsNew) return; if (this.IsNew) return;
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
Pdf.Remove(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth); Pdf.Remove(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth);
MarkNew(); MarkNew();
} }
#endregion #endregion
// Standard Default Code // Standard Default Code
#region extension #region extension
DocumentPdfExtension _DocumentPdfExtension = new DocumentPdfExtension(); DocumentPdfExtension _DocumentPdfExtension = new DocumentPdfExtension();
[Serializable()] [Serializable()]
partial class DocumentPdfExtension : extensionBase partial class DocumentPdfExtension : extensionBase
{ {
} }
[Serializable()] [Serializable()]
class extensionBase class extensionBase
{ {
// Default Values // Default Values
public virtual DateTime DefaultDTS public virtual DateTime DefaultDTS
{ {
get { return DateTime.Now; } get { return DateTime.Now; }
} }
public virtual string DefaultUserID public virtual string DefaultUserID
{ {
get { return Volian.Base.Library.VlnSettings.UserID; } get { return Volian.Base.Library.VlnSettings.UserID; }
} }
// Authorization Rules // Authorization Rules
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Instance Authorization Rules // Instance Authorization Rules
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Needs to be overriden to add new authorization rules // Needs to be overriden to add new authorization rules
} }
// Validation Rules // Validation Rules
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
// InstanceValidation Rules // InstanceValidation Rules
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
{ {
// Needs to be overriden to add new validation rules // Needs to be overriden to add new validation rules
} }
} }
#endregion #endregion
} // Class } // Class
#region Converter #region Converter
internal class DocumentPdfConverter : ExpandableObjectConverter internal class DocumentPdfConverter : ExpandableObjectConverter
{ {
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{ {
if (destType == typeof(string) && value is DocumentPdf) if (destType == typeof(string) && value is DocumentPdf)
{ {
// Return the ToString value // Return the ToString value
return ((DocumentPdf)value).ToString(); return ((DocumentPdf)value).ToString();
} }
return base.ConvertTo(context, culture, value, destType); return base.ConvertTo(context, culture, value, destType);
} }
} }
#endregion #endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,343 +19,349 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void EntryAuditInfoEvent(object sender); public delegate void EntryAuditInfoEvent(object sender);
/// <summary> /// <summary>
/// EntryAuditInfo Generated by MyGeneration using the CSLA Object Mapping template /// EntryAuditInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(EntryAuditInfoConverter))] [TypeConverter(typeof(EntryAuditInfoConverter))]
public partial class EntryAuditInfo : ReadOnlyBase<EntryAuditInfo>, IDisposable public partial class EntryAuditInfo : ReadOnlyBase<EntryAuditInfo>, IDisposable
{ {
public event EntryAuditInfoEvent Changed; public event EntryAuditInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<EntryAuditInfo> _CacheList = new List<EntryAuditInfo>(); private static List<EntryAuditInfo> _CacheList = new List<EntryAuditInfo>();
protected static void AddToCache(EntryAuditInfo entryAuditInfo) protected static void AddToCache(EntryAuditInfo entryAuditInfo)
{ {
if (!_CacheList.Contains(entryAuditInfo)) _CacheList.Add(entryAuditInfo); // In AddToCache if (!_CacheList.Contains(entryAuditInfo)) _CacheList.Add(entryAuditInfo); // In AddToCache
} }
protected static void RemoveFromCache(EntryAuditInfo entryAuditInfo) protected static void RemoveFromCache(EntryAuditInfo entryAuditInfo)
{ {
while (_CacheList.Contains(entryAuditInfo)) _CacheList.Remove(entryAuditInfo); // In RemoveFromCache while (_CacheList.Contains(entryAuditInfo)) _CacheList.Remove(entryAuditInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<EntryAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<EntryAuditInfo>>(); private static Dictionary<string, List<EntryAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<EntryAuditInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move EntryAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move EntryAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
EntryAuditInfo tmp = _CacheList[0]; // Get the first EntryAuditInfo EntryAuditInfo tmp = _CacheList[0]; // Get the first EntryAuditInfo
string pKey = tmp.AuditID.ToString(); string pKey = tmp.AuditID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<EntryAuditInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<EntryAuditInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first EntryAuditInfo _CacheList.RemoveAt(0); // Remove the first EntryAuditInfo
} }
} }
internal static void AddList(EntryAuditInfoList lst) internal static void AddList(EntryAuditInfoList lst)
{ {
foreach (EntryAuditInfo item in lst) AddToCache(item); foreach (EntryAuditInfo item in lst) AddToCache(item);
} }
protected static EntryAuditInfo GetCachedByPrimaryKey(long auditID) protected static EntryAuditInfo GetCachedByPrimaryKey(long auditID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = auditID.ToString(); string key = auditID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected EntryAudit _Editable; protected EntryAudit _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private long _AuditID; private long _AuditID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public long AuditID public long AuditID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _AuditID; CanReadProperty("AuditID", true);
} return _AuditID;
} }
private int _ContentID; }
public int ContentID private int _ContentID;
{ public int ContentID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
return _ContentID; {
} CanReadProperty("ContentID", true);
} return _ContentID;
private int _DocID; }
public int DocID }
{ private int _DocID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int DocID
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _DocID; get
} {
} CanReadProperty("DocID", true);
private DateTime _DTS = new DateTime(); return _DocID;
public DateTime DTS }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private DateTime _DTS = new DateTime();
get public DateTime DTS
{ {
return _DTS; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _UserID = string.Empty; CanReadProperty("DTS", true);
public string UserID return _DTS;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _UserID = string.Empty;
{ public string UserID
return _UserID; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int _DeleteStatus; {
public int DeleteStatus CanReadProperty("UserID", true);
{ return _UserID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int _DeleteStatus;
return _DeleteStatus; public int DeleteStatus
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
// CSLATODO: Replace base EntryAuditInfo.ToString function as necessary get
/// <summary> {
/// Overrides Base ToString CanReadProperty("DeleteStatus", true);
/// </summary> return _DeleteStatus;
/// <returns>A string representation of current EntryAuditInfo</returns> }
//public override string ToString() }
//{ // CSLATODO: Replace base EntryAuditInfo.ToString function as necessary
// return base.ToString(); /// <summary>
//} /// Overrides Base ToString
// CSLATODO: Check EntryAuditInfo.GetIdValue to assure that the ID returned is unique /// </summary>
/// <summary> /// <returns>A string representation of current EntryAuditInfo</returns>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality //public override string ToString()
/// </summary> //{
/// <returns>A Unique ID for the current EntryAuditInfo</returns> // return base.ToString();
protected override object GetIdValue() //}
{ // CSLATODO: Check EntryAuditInfo.GetIdValue to assure that the ID returned is unique
return MyEntryAuditInfoUnique; // Absolutely Unique ID /// <summary>
} /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
#endregion /// </summary>
#region Factory Methods /// <returns>A Unique ID for the current EntryAuditInfo</returns>
private static int _EntryAuditInfoUnique = 0; protected override object GetIdValue()
private static int EntryAuditInfoUnique {
{ get { return ++_EntryAuditInfoUnique; } } return MyEntryAuditInfoUnique; // Absolutely Unique ID
private int _MyEntryAuditInfoUnique = EntryAuditInfoUnique; }
public int MyEntryAuditInfoUnique // Absolutely Unique ID - Info #endregion
{ get { return _MyEntryAuditInfoUnique; } } #region Factory Methods
protected EntryAuditInfo() private static int _EntryAuditInfoUnique = 0;
{/* require use of factory methods */ private static int EntryAuditInfoUnique
AddToCache(this); { get { return ++_EntryAuditInfoUnique; } }
} private int _MyEntryAuditInfoUnique = EntryAuditInfoUnique;
private bool _Disposed = false; public int MyEntryAuditInfoUnique // Absolutely Unique ID - Info
private static int _CountCreated = 0; { get { return _MyEntryAuditInfoUnique; } }
private static int _CountDisposed = 0; protected EntryAuditInfo()
private static int _CountFinalized = 0; {/* require use of factory methods */
private static int IncrementCountCreated AddToCache(this);
{ get { return ++_CountCreated; } } }
private int _CountWhenCreated = IncrementCountCreated; private bool _Disposed = false;
public static int CountCreated private static int _CountCreated = 0;
{ get { return _CountCreated; } } private static int _CountDisposed = 0;
public static int CountNotDisposed private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int IncrementCountCreated
public static int CountNotFinalized { get { return ++_CountCreated; } }
{ get { return _CountCreated - _CountFinalized; } } private int _CountWhenCreated = IncrementCountCreated;
~EntryAuditInfo() public static int CountCreated
{ { get { return _CountCreated; } }
_CountFinalized++; public static int CountNotDisposed
} { get { return _CountCreated - _CountDisposed; } }
public void Dispose() public static int CountNotFinalized
{ { get { return _CountCreated - _CountFinalized; } }
if (_Disposed) return; ~EntryAuditInfo()
_CountDisposed++; {
_Disposed = true; _CountFinalized++;
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public void Dispose()
List<EntryAuditInfo> listEntryAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listEntryAuditInfo.Contains(this)) listEntryAuditInfo.Remove(this); // Remove the item from the list if (_Disposed) return;
if (listEntryAuditInfo.Count == 0) // If there are no items left in the list _CountDisposed++;
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list _Disposed = true;
} RemoveFromCache(this);
public virtual EntryAudit Get() if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<EntryAuditInfo> listEntryAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
return _Editable = EntryAudit.Get(_AuditID); while (listEntryAuditInfo.Contains(this)) listEntryAuditInfo.Remove(this); // Remove the item from the list
} if (listEntryAuditInfo.Count == 0) // If there are no items left in the list
public static void Refresh(EntryAudit tmp) _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
{ }
string key = tmp.AuditID.ToString(); public virtual EntryAudit Get()
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) return _Editable = EntryAudit.Get(_AuditID);
foreach (EntryAuditInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public static void Refresh(EntryAudit tmp)
} {
protected virtual void RefreshFields(EntryAudit tmp) string key = tmp.AuditID.ToString();
{ ConvertListToDictionary();
_ContentID = tmp.ContentID; if (_CacheByPrimaryKey.ContainsKey(key))
_DocID = tmp.DocID; foreach (EntryAuditInfo tmpInfo in _CacheByPrimaryKey[key])
_DTS = tmp.DTS; tmpInfo.RefreshFields(tmp);
_UserID = tmp.UserID; }
_DeleteStatus = tmp.DeleteStatus; protected virtual void RefreshFields(EntryAudit tmp)
_EntryAuditInfoExtension.Refresh(this); {
OnChange();// raise an event _ContentID = tmp.ContentID;
} _DocID = tmp.DocID;
public static EntryAuditInfo Get(long auditID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
//if (!CanGetObject()) _DeleteStatus = tmp.DeleteStatus;
// throw new System.Security.SecurityException("User not authorized to view a EntryAudit"); _EntryAuditInfoExtension.Refresh(this);
try OnChange();// raise an event
{ }
EntryAuditInfo tmp = GetCachedByPrimaryKey(auditID); public static EntryAuditInfo Get(long auditID)
if (tmp == null) {
{ //if (!CanGetObject())
tmp = DataPortal.Fetch<EntryAuditInfo>(new PKCriteria(auditID)); // throw new System.Security.SecurityException("User not authorized to view a EntryAudit");
AddToCache(tmp); try
} {
if (tmp.ErrorMessage == "No Record Found") EntryAuditInfo tmp = GetCachedByPrimaryKey(auditID);
{ if (tmp == null)
tmp.Dispose(); // Clean-up EntryAuditInfo {
tmp = null; tmp = DataPortal.Fetch<EntryAuditInfo>(new PKCriteria(auditID));
} AddToCache(tmp);
return tmp; }
} if (tmp.ErrorMessage == "No Record Found")
catch (Exception ex) {
{ tmp.Dispose(); // Clean-up EntryAuditInfo
throw new DbCslaException("Error on EntryAuditInfo.Get", ex); tmp = null;
} }
} return tmp;
#endregion }
#region Data Access Portal catch (Exception ex)
internal EntryAuditInfo(SafeDataReader dr) {
{ throw new DbCslaException("Error on EntryAuditInfo.Get", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.Constructor", GetHashCode()); }
try }
{ #endregion
ReadData(dr); #region Data Access Portal
} internal EntryAuditInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.Constructor", GetHashCode());
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.Constructor", ex); try
throw new DbCslaException("EntryAuditInfo.Constructor", ex); {
} ReadData(dr);
} }
[Serializable()] catch (Exception ex)
protected class PKCriteria {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.Constructor", ex);
private long _AuditID; throw new DbCslaException("EntryAuditInfo.Constructor", ex);
public long AuditID }
{ get { return _AuditID; } } }
public PKCriteria(long auditID) [Serializable()]
{ protected class PKCriteria
_AuditID = auditID; {
} private long _AuditID;
} public long AuditID
private void ReadData(SafeDataReader dr) { get { return _AuditID; } }
{ public PKCriteria(long auditID)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.ReadData", GetHashCode()); {
try _AuditID = auditID;
{ }
_AuditID = dr.GetInt64("AuditID"); }
_ContentID = dr.GetInt32("ContentID"); private void ReadData(SafeDataReader dr)
_DocID = dr.GetInt32("DocID"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.ReadData", GetHashCode());
_UserID = dr.GetString("UserID"); try
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} _AuditID = dr.GetInt64("AuditID");
catch (Exception ex) _ContentID = dr.GetInt32("ContentID");
{ _DocID = dr.GetInt32("DocID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.ReadData", ex); _DTS = dr.GetDateTime("DTS");
_ErrorMessage = ex.Message; _UserID = dr.GetString("UserID");
throw new DbCslaException("EntryAuditInfo.ReadData", ex); _DeleteStatus = dr.GetInt32("DeleteStatus");
} }
} catch (Exception ex)
private void DataPortal_Fetch(PKCriteria criteria) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.ReadData", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.DataPortal_Fetch", GetHashCode()); _ErrorMessage = ex.Message;
try throw new DbCslaException("EntryAuditInfo.ReadData", ex);
{ }
using (SqlConnection cn = Database.VEPROMS_SqlConnection) }
{ private void DataPortal_Fetch(PKCriteria criteria)
ApplicationContext.LocalContext["cn"] = cn; {
using (SqlCommand cm = cn.CreateCommand()) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.DataPortal_Fetch", GetHashCode());
{ try
cm.CommandType = CommandType.StoredProcedure; {
cm.CommandText = "getEntryAudit"; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); {
cm.CommandTimeout = Database.DefaultTimeout; ApplicationContext.LocalContext["cn"] = cn;
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) using (SqlCommand cm = cn.CreateCommand())
{ {
if (!dr.Read()) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getEntryAudit";
_ErrorMessage = "No Record Found"; cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
return; cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ReadData(dr); {
} if (!dr.Read())
} {
// removing of item only needed for local data portal _ErrorMessage = "No Record Found";
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) return;
ApplicationContext.LocalContext.Remove("cn"); }
} ReadData(dr);
} }
catch (Exception ex) }
{ // removing of item only needed for local data portal
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.DataPortal_Fetch", ex); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
_ErrorMessage = ex.Message; ApplicationContext.LocalContext.Remove("cn");
throw new DbCslaException("EntryAuditInfo.DataPortal_Fetch", ex); }
} }
} catch (Exception ex)
#endregion {
// Standard Refresh if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.DataPortal_Fetch", ex);
#region extension _ErrorMessage = ex.Message;
EntryAuditInfoExtension _EntryAuditInfoExtension = new EntryAuditInfoExtension(); throw new DbCslaException("EntryAuditInfo.DataPortal_Fetch", ex);
[Serializable()] }
partial class EntryAuditInfoExtension : extensionBase { } }
[Serializable()] #endregion
class extensionBase // Standard Refresh
{ #region extension
// Default Refresh EntryAuditInfoExtension _EntryAuditInfoExtension = new EntryAuditInfoExtension();
public virtual void Refresh(EntryAuditInfo tmp) { } [Serializable()]
} partial class EntryAuditInfoExtension : extensionBase { }
#endregion [Serializable()]
} // Class class extensionBase
#region Converter {
internal class EntryAuditInfoConverter : ExpandableObjectConverter // Default Refresh
{ public virtual void Refresh(EntryAuditInfo tmp) { }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) }
{ #endregion
if (destType == typeof(string) && value is EntryAuditInfo) } // Class
{ #region Converter
// Return the ToString value internal class EntryAuditInfoConverter : ExpandableObjectConverter
return ((EntryAuditInfo)value).ToString(); {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
return base.ConvertTo(context, culture, value, destType); {
} if (destType == typeof(string) && value is EntryAuditInfo)
} {
#endregion // Return the ToString value
return ((EntryAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -19,365 +19,371 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void EntryInfoEvent(object sender); public delegate void EntryInfoEvent(object sender);
/// <summary> /// <summary>
/// EntryInfo Generated by MyGeneration using the CSLA Object Mapping template /// EntryInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(EntryInfoConverter))] [TypeConverter(typeof(EntryInfoConverter))]
public partial class EntryInfo : ReadOnlyBase<EntryInfo>, IDisposable public partial class EntryInfo : ReadOnlyBase<EntryInfo>, IDisposable
{ {
public event EntryInfoEvent Changed; public event EntryInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<EntryInfo> _CacheList = new List<EntryInfo>(); private static List<EntryInfo> _CacheList = new List<EntryInfo>();
protected static void AddToCache(EntryInfo entryInfo) protected static void AddToCache(EntryInfo entryInfo)
{ {
if (!_CacheList.Contains(entryInfo)) _CacheList.Add(entryInfo); // In AddToCache if (!_CacheList.Contains(entryInfo)) _CacheList.Add(entryInfo); // In AddToCache
} }
protected static void RemoveFromCache(EntryInfo entryInfo) protected static void RemoveFromCache(EntryInfo entryInfo)
{ {
while (_CacheList.Contains(entryInfo)) _CacheList.Remove(entryInfo); // In RemoveFromCache while (_CacheList.Contains(entryInfo)) _CacheList.Remove(entryInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<EntryInfo>> _CacheByPrimaryKey = new Dictionary<string, List<EntryInfo>>(); private static Dictionary<string, List<EntryInfo>> _CacheByPrimaryKey = new Dictionary<string, List<EntryInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move EntryInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move EntryInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
EntryInfo tmp = _CacheList[0]; // Get the first EntryInfo EntryInfo tmp = _CacheList[0]; // Get the first EntryInfo
string pKey = tmp.ContentID.ToString(); string pKey = tmp.ContentID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<EntryInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<EntryInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first EntryInfo _CacheList.RemoveAt(0); // Remove the first EntryInfo
} }
} }
internal static void AddList(EntryInfoList lst) internal static void AddList(EntryInfoList lst)
{ {
foreach (EntryInfo item in lst) AddToCache(item); foreach (EntryInfo item in lst) AddToCache(item);
} }
protected static EntryInfo GetCachedByPrimaryKey(int contentID) protected static EntryInfo GetCachedByPrimaryKey(int contentID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = contentID.ToString(); string key = contentID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Entry _Editable; protected Entry _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _ContentID; private int _ContentID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int ContentID public int ContentID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
if (_MyContent != null) _ContentID = _MyContent.ContentID; CanReadProperty("ContentID", true);
return _ContentID; if (_MyContent != null) _ContentID = _MyContent.ContentID;
} return _ContentID;
} }
private ContentInfo _MyContent; }
[System.ComponentModel.DataObjectField(true, true)] private ContentInfo _MyContent;
public ContentInfo MyContent [System.ComponentModel.DataObjectField(true, true)]
{ public ContentInfo MyContent
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); {
return _MyContent; CanReadProperty("MyContent", true);
} if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID);
} return _MyContent;
private int _DocID; }
public int DocID }
{ private int _DocID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public int DocID
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyDocument != null) _DocID = _MyDocument.DocID; get
return _DocID; {
} CanReadProperty("DocID", true);
} if (_MyDocument != null) _DocID = _MyDocument.DocID;
private DocumentInfo _MyDocument; return _DocID;
public DocumentInfo MyDocument }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private DocumentInfo _MyDocument;
get public DocumentInfo MyDocument
{ {
if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _MyDocument; get
} {
} CanReadProperty("MyDocument", true);
private DateTime _DTS = new DateTime(); if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID);
public DateTime DTS return _MyDocument;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private DateTime _DTS = new DateTime();
{ public DateTime DTS
return _DTS; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _UserID = string.Empty; {
public string UserID CanReadProperty("DTS", true);
{ return _DTS;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _UserID = string.Empty;
return _UserID; public string UserID
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
// CSLATODO: Replace base EntryInfo.ToString function as necessary get
/// <summary> {
/// Overrides Base ToString CanReadProperty("UserID", true);
/// </summary> return _UserID;
/// <returns>A string representation of current EntryInfo</returns> }
//public override string ToString() }
//{ // CSLATODO: Replace base EntryInfo.ToString function as necessary
// return base.ToString(); /// <summary>
//} /// Overrides Base ToString
// CSLATODO: Check EntryInfo.GetIdValue to assure that the ID returned is unique /// </summary>
/// <summary> /// <returns>A string representation of current EntryInfo</returns>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality //public override string ToString()
/// </summary> //{
/// <returns>A Unique ID for the current EntryInfo</returns> // return base.ToString();
protected override object GetIdValue() //}
{ // CSLATODO: Check EntryInfo.GetIdValue to assure that the ID returned is unique
return MyEntryInfoUnique; // Absolutely Unique ID /// <summary>
} /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
#endregion /// </summary>
#region Factory Methods /// <returns>A Unique ID for the current EntryInfo</returns>
private static int _EntryInfoUnique = 0; protected override object GetIdValue()
private static int EntryInfoUnique {
{ get { return ++_EntryInfoUnique; } } return MyEntryInfoUnique; // Absolutely Unique ID
private int _MyEntryInfoUnique = EntryInfoUnique; }
public int MyEntryInfoUnique // Absolutely Unique ID - Info #endregion
{ get { return _MyEntryInfoUnique; } } #region Factory Methods
protected EntryInfo() private static int _EntryInfoUnique = 0;
{/* require use of factory methods */ private static int EntryInfoUnique
AddToCache(this); { get { return ++_EntryInfoUnique; } }
} private int _MyEntryInfoUnique = EntryInfoUnique;
private bool _Disposed = false; public int MyEntryInfoUnique // Absolutely Unique ID - Info
private static int _CountCreated = 0; { get { return _MyEntryInfoUnique; } }
private static int _CountDisposed = 0; protected EntryInfo()
private static int _CountFinalized = 0; {/* require use of factory methods */
private static int IncrementCountCreated AddToCache(this);
{ get { return ++_CountCreated; } } }
private int _CountWhenCreated = IncrementCountCreated; private bool _Disposed = false;
public static int CountCreated private static int _CountCreated = 0;
{ get { return _CountCreated; } } private static int _CountDisposed = 0;
public static int CountNotDisposed private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int IncrementCountCreated
public static int CountNotFinalized { get { return ++_CountCreated; } }
{ get { return _CountCreated - _CountFinalized; } } private int _CountWhenCreated = IncrementCountCreated;
~EntryInfo() public static int CountCreated
{ { get { return _CountCreated; } }
_CountFinalized++; public static int CountNotDisposed
} { get { return _CountCreated - _CountDisposed; } }
public void Dispose() public static int CountNotFinalized
{ { get { return _CountCreated - _CountFinalized; } }
if (_Disposed) return; ~EntryInfo()
_CountDisposed++; {
_Disposed = true; _CountFinalized++;
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return; public void Dispose()
List<EntryInfo> listEntryInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items {
while (listEntryInfo.Contains(this)) listEntryInfo.Remove(this); // Remove the item from the list if (_Disposed) return;
if (listEntryInfo.Count == 0) // If there are no items left in the list _CountDisposed++;
_CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list _Disposed = true;
} RemoveFromCache(this);
public virtual Entry Get() if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return;
{ List<EntryInfo> listEntryInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items
return _Editable = Entry.Get(_ContentID); while (listEntryInfo.Contains(this)) listEntryInfo.Remove(this); // Remove the item from the list
} if (listEntryInfo.Count == 0) // If there are no items left in the list
public static void Refresh(Entry tmp) _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list
{ }
string key = tmp.ContentID.ToString(); public virtual Entry Get()
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) return _Editable = Entry.Get(_ContentID);
foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public static void Refresh(Entry tmp)
} {
protected virtual void RefreshFields(Entry tmp) string key = tmp.ContentID.ToString();
{ ConvertListToDictionary();
if (_DocID != tmp.DocID) if (_CacheByPrimaryKey.ContainsKey(key))
{ foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key])
if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for old value tmpInfo.RefreshFields(tmp);
_DocID = tmp.DocID; // Update the value }
} protected virtual void RefreshFields(Entry tmp)
_MyDocument = null; // Reset list so that the next line gets a new list {
if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for new value if (_DocID != tmp.DocID)
_DTS = tmp.DTS; {
_UserID = tmp.UserID; if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for old value
_EntryInfoExtension.Refresh(this); _DocID = tmp.DocID; // Update the value
OnChange();// raise an event }
} _MyDocument = null; // Reset list so that the next line gets a new list
public static void Refresh(DocumentEntry tmp) if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for new value
{ _DTS = tmp.DTS;
string key = tmp.ContentID.ToString(); _UserID = tmp.UserID;
ConvertListToDictionary(); _EntryInfoExtension.Refresh(this);
if (_CacheByPrimaryKey.ContainsKey(key)) OnChange();// raise an event
foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public static void Refresh(DocumentEntry tmp)
} {
protected virtual void RefreshFields(DocumentEntry tmp) string key = tmp.ContentID.ToString();
{ ConvertListToDictionary();
_DTS = tmp.DTS; if (_CacheByPrimaryKey.ContainsKey(key))
_UserID = tmp.UserID; foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key])
_EntryInfoExtension.Refresh(this); tmpInfo.RefreshFields(tmp);
OnChange();// raise an event }
} protected virtual void RefreshFields(DocumentEntry tmp)
public static EntryInfo Get(int contentID) {
{ _DTS = tmp.DTS;
//if (!CanGetObject()) _UserID = tmp.UserID;
// throw new System.Security.SecurityException("User not authorized to view a Entry"); _EntryInfoExtension.Refresh(this);
try OnChange();// raise an event
{ }
EntryInfo tmp = GetCachedByPrimaryKey(contentID); public static EntryInfo Get(int contentID)
if (tmp == null) {
{ //if (!CanGetObject())
tmp = DataPortal.Fetch<EntryInfo>(new PKCriteria(contentID)); // throw new System.Security.SecurityException("User not authorized to view a Entry");
AddToCache(tmp); try
} {
if (tmp.ErrorMessage == "No Record Found") EntryInfo tmp = GetCachedByPrimaryKey(contentID);
{ if (tmp == null)
tmp.Dispose(); // Clean-up EntryInfo {
tmp = null; tmp = DataPortal.Fetch<EntryInfo>(new PKCriteria(contentID));
} AddToCache(tmp);
return tmp; }
} if (tmp.ErrorMessage == "No Record Found")
catch (Exception ex) {
{ tmp.Dispose(); // Clean-up EntryInfo
throw new DbCslaException("Error on EntryInfo.Get", ex); tmp = null;
} }
} return tmp;
#endregion }
#region Data Access Portal catch (Exception ex)
internal EntryInfo(SafeDataReader dr) {
{ throw new DbCslaException("Error on EntryInfo.Get", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.Constructor", GetHashCode()); }
try }
{ #endregion
ReadData(dr); #region Data Access Portal
} internal EntryInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.Constructor", GetHashCode());
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.Constructor", ex); try
throw new DbCslaException("EntryInfo.Constructor", ex); {
} ReadData(dr);
} }
[Serializable()] catch (Exception ex)
protected class PKCriteria {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.Constructor", ex);
private int _ContentID; throw new DbCslaException("EntryInfo.Constructor", ex);
public int ContentID }
{ get { return _ContentID; } } }
public PKCriteria(int contentID) [Serializable()]
{ protected class PKCriteria
_ContentID = contentID; {
} private int _ContentID;
} public int ContentID
private void ReadData(SafeDataReader dr) { get { return _ContentID; } }
{ public PKCriteria(int contentID)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.ReadData", GetHashCode()); {
try _ContentID = contentID;
{ }
_ContentID = dr.GetInt32("ContentID"); }
_DocID = dr.GetInt32("DocID"); private void ReadData(SafeDataReader dr)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.ReadData", GetHashCode());
} try
catch (Exception ex) {
{ _ContentID = dr.GetInt32("ContentID");
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.ReadData", ex); _DocID = dr.GetInt32("DocID");
_ErrorMessage = ex.Message; _DTS = dr.GetDateTime("DTS");
throw new DbCslaException("EntryInfo.ReadData", ex); _UserID = dr.GetString("UserID");
} }
} catch (Exception ex)
private void DataPortal_Fetch(PKCriteria criteria) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.ReadData", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.DataPortal_Fetch", GetHashCode()); _ErrorMessage = ex.Message;
try throw new DbCslaException("EntryInfo.ReadData", ex);
{ }
using (SqlConnection cn = Database.VEPROMS_SqlConnection) }
{ private void DataPortal_Fetch(PKCriteria criteria)
ApplicationContext.LocalContext["cn"] = cn; {
using (SqlCommand cm = cn.CreateCommand()) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.DataPortal_Fetch", GetHashCode());
{ try
cm.CommandType = CommandType.StoredProcedure; {
cm.CommandText = "getEntry"; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); {
cm.CommandTimeout = Database.DefaultTimeout; ApplicationContext.LocalContext["cn"] = cn;
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) using (SqlCommand cm = cn.CreateCommand())
{ {
if (!dr.Read()) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getEntry";
_ErrorMessage = "No Record Found"; cm.Parameters.AddWithValue("@ContentID", criteria.ContentID);
return; cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ReadData(dr); {
} if (!dr.Read())
} {
// removing of item only needed for local data portal _ErrorMessage = "No Record Found";
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) return;
ApplicationContext.LocalContext.Remove("cn"); }
} ReadData(dr);
} }
catch (Exception ex) }
{ // removing of item only needed for local data portal
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.DataPortal_Fetch", ex); if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
_ErrorMessage = ex.Message; ApplicationContext.LocalContext.Remove("cn");
throw new DbCslaException("EntryInfo.DataPortal_Fetch", ex); }
} }
} catch (Exception ex)
#endregion {
// Standard Refresh if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.DataPortal_Fetch", ex);
#region extension _ErrorMessage = ex.Message;
EntryInfoExtension _EntryInfoExtension = new EntryInfoExtension(); throw new DbCslaException("EntryInfo.DataPortal_Fetch", ex);
[Serializable()] }
partial class EntryInfoExtension : extensionBase { } }
[Serializable()] #endregion
class extensionBase // Standard Refresh
{ #region extension
// Default Refresh EntryInfoExtension _EntryInfoExtension = new EntryInfoExtension();
public virtual void Refresh(EntryInfo tmp) { } [Serializable()]
} partial class EntryInfoExtension : extensionBase { }
#endregion [Serializable()]
} // Class class extensionBase
#region Converter {
internal class EntryInfoConverter : ExpandableObjectConverter // Default Refresh
{ public virtual void Refresh(EntryInfo tmp) { }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) }
{ #endregion
if (destType == typeof(string) && value is EntryInfo) } // Class
{ #region Converter
// Return the ToString value internal class EntryInfoConverter : ExpandableObjectConverter
return ((EntryInfo)value).ToString(); {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
return base.ConvertTo(context, culture, value, destType); {
} if (destType == typeof(string) && value is EntryInfo)
} {
#endregion // Return the ToString value
return ((EntryInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

View File

@@ -19,437 +19,446 @@ using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public delegate void FigureInfoEvent(object sender); public delegate void FigureInfoEvent(object sender);
/// <summary> /// <summary>
/// FigureInfo Generated by MyGeneration using the CSLA Object Mapping template /// FigureInfo Generated by MyGeneration using the CSLA Object Mapping template
/// </summary> /// </summary>
[Serializable()] [Serializable()]
[TypeConverter(typeof(FigureInfoConverter))] [TypeConverter(typeof(FigureInfoConverter))]
public partial class FigureInfo : ReadOnlyBase<FigureInfo>, IDisposable public partial class FigureInfo : ReadOnlyBase<FigureInfo>, IDisposable
{ {
public event FigureInfoEvent Changed; public event FigureInfoEvent Changed;
private void OnChange() private void OnChange()
{ {
if (Changed != null) Changed(this); if (Changed != null) Changed(this);
} }
#region Log4Net #region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion #endregion
#region Collection #region Collection
private static List<FigureInfo> _CacheList = new List<FigureInfo>(); private static List<FigureInfo> _CacheList = new List<FigureInfo>();
protected static void AddToCache(FigureInfo figureInfo) protected static void AddToCache(FigureInfo figureInfo)
{ {
if (!_CacheList.Contains(figureInfo)) _CacheList.Add(figureInfo); // In AddToCache if (!_CacheList.Contains(figureInfo)) _CacheList.Add(figureInfo); // In AddToCache
} }
protected static void RemoveFromCache(FigureInfo figureInfo) protected static void RemoveFromCache(FigureInfo figureInfo)
{ {
while (_CacheList.Contains(figureInfo)) _CacheList.Remove(figureInfo); // In RemoveFromCache while (_CacheList.Contains(figureInfo)) _CacheList.Remove(figureInfo); // In RemoveFromCache
} }
private static Dictionary<string, List<FigureInfo>> _CacheByPrimaryKey = new Dictionary<string, List<FigureInfo>>(); private static Dictionary<string, List<FigureInfo>> _CacheByPrimaryKey = new Dictionary<string, List<FigureInfo>>();
private static void ConvertListToDictionary() private static void ConvertListToDictionary()
{ {
while (_CacheList.Count > 0) // Move FigureInfo(s) from temporary _CacheList to _CacheByPrimaryKey while (_CacheList.Count > 0) // Move FigureInfo(s) from temporary _CacheList to _CacheByPrimaryKey
{ {
FigureInfo tmp = _CacheList[0]; // Get the first FigureInfo FigureInfo tmp = _CacheList[0]; // Get the first FigureInfo
string pKey = tmp.FigureID.ToString(); string pKey = tmp.FigureID.ToString();
if (!_CacheByPrimaryKey.ContainsKey(pKey)) if (!_CacheByPrimaryKey.ContainsKey(pKey))
{ {
_CacheByPrimaryKey[pKey] = new List<FigureInfo>(); // Add new list for PrimaryKey _CacheByPrimaryKey[pKey] = new List<FigureInfo>(); // Add new list for PrimaryKey
} }
_CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list
_CacheList.RemoveAt(0); // Remove the first FigureInfo _CacheList.RemoveAt(0); // Remove the first FigureInfo
} }
} }
internal static void AddList(FigureInfoList lst) internal static void AddList(FigureInfoList lst)
{ {
foreach (FigureInfo item in lst) AddToCache(item); foreach (FigureInfo item in lst) AddToCache(item);
} }
protected static FigureInfo GetCachedByPrimaryKey(int figureID) protected static FigureInfo GetCachedByPrimaryKey(int figureID)
{ {
ConvertListToDictionary(); ConvertListToDictionary();
string key = figureID.ToString(); string key = figureID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0];
return null; return null;
} }
#endregion #endregion
#region Business Methods #region Business Methods
private string _ErrorMessage = string.Empty; private string _ErrorMessage = string.Empty;
public string ErrorMessage public string ErrorMessage
{ {
get { return _ErrorMessage; } get { return _ErrorMessage; }
} }
protected Figure _Editable; protected Figure _Editable;
private IVEHasBrokenRules HasBrokenRules private IVEHasBrokenRules HasBrokenRules
{ {
get get
{ {
IVEHasBrokenRules hasBrokenRules = null; IVEHasBrokenRules hasBrokenRules = null;
if (_Editable != null) if (_Editable != null)
hasBrokenRules = _Editable.HasBrokenRules; hasBrokenRules = _Editable.HasBrokenRules;
return hasBrokenRules; return hasBrokenRules;
} }
} }
private int _FigureID; private int _FigureID;
[System.ComponentModel.DataObjectField(true, true)] [System.ComponentModel.DataObjectField(true, true)]
public int FigureID public int FigureID
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
return _FigureID; CanReadProperty("FigureID", true);
} return _FigureID;
} }
private int _ROFstID; }
public int ROFstID private int _ROFstID;
{ public int ROFstID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; {
return _ROFstID; CanReadProperty("ROFstID", true);
} if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID;
} return _ROFstID;
private ROFstInfo _MyROFst; }
public ROFstInfo MyROFst }
{ private ROFstInfo _MyROFst;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public ROFstInfo MyROFst
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); get
return _MyROFst; {
} CanReadProperty("MyROFst", true);
} if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
private int _ImageID; return _MyROFst;
public int ImageID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private int _ImageID;
get public int ImageID
{ {
if (_MyROImage != null) _ImageID = _MyROImage.ImageID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _ImageID; get
} {
} CanReadProperty("ImageID", true);
private ROImageInfo _MyROImage; if (_MyROImage != null) _ImageID = _MyROImage.ImageID;
public ROImageInfo MyROImage return _ImageID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private ROImageInfo _MyROImage;
{ public ROImageInfo MyROImage
if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImageInfo.Get(_ImageID); {
return _MyROImage; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
private string _Config = string.Empty; CanReadProperty("MyROImage", true);
public string Config if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImageInfo.Get(_ImageID);
{ return _MyROImage;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
return _Config; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private DateTime _DTS = new DateTime(); get
public DateTime DTS {
{ CanReadProperty("Config", true);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Config;
get }
{ }
return _DTS; private DateTime _DTS = new DateTime();
} public DateTime DTS
} {
private string _UserID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string UserID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] CanReadProperty("DTS", true);
get return _DTS;
{ }
return _UserID; }
} private string _UserID = string.Empty;
} public string UserID
// CSLATODO: Replace base FigureInfo.ToString function as necessary {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Overrides Base ToString get
/// </summary> {
/// <returns>A string representation of current FigureInfo</returns> CanReadProperty("UserID", true);
//public override string ToString() return _UserID;
//{ }
// return base.ToString(); }
//} // CSLATODO: Replace base FigureInfo.ToString function as necessary
// CSLATODO: Check FigureInfo.GetIdValue to assure that the ID returned is unique /// <summary>
/// <summary> /// Overrides Base ToString
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality /// </summary>
/// </summary> /// <returns>A string representation of current FigureInfo</returns>
/// <returns>A Unique ID for the current FigureInfo</returns> //public override string ToString()
protected override object GetIdValue() //{
{ // return base.ToString();
return MyFigureInfoUnique; // Absolutely Unique ID //}
} // CSLATODO: Check FigureInfo.GetIdValue to assure that the ID returned is unique
#endregion /// <summary>
#region Factory Methods /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private static int _FigureInfoUnique = 0; /// </summary>
private static int FigureInfoUnique /// <returns>A Unique ID for the current FigureInfo</returns>
{ get { return ++_FigureInfoUnique; } } protected override object GetIdValue()
private int _MyFigureInfoUnique = FigureInfoUnique; {
public int MyFigureInfoUnique // Absolutely Unique ID - Info return MyFigureInfoUnique; // Absolutely Unique ID
{ get { return _MyFigureInfoUnique; } } }
protected FigureInfo() #endregion
{/* require use of factory methods */ #region Factory Methods
AddToCache(this); private static int _FigureInfoUnique = 0;
} private static int FigureInfoUnique
private bool _Disposed = false; { get { return ++_FigureInfoUnique; } }
private static int _CountCreated = 0; private int _MyFigureInfoUnique = FigureInfoUnique;
private static int _CountDisposed = 0; public int MyFigureInfoUnique // Absolutely Unique ID - Info
private static int _CountFinalized = 0; { get { return _MyFigureInfoUnique; } }
private static int IncrementCountCreated protected FigureInfo()
{ get { return ++_CountCreated; } } {/* require use of factory methods */
private int _CountWhenCreated = IncrementCountCreated; AddToCache(this);
public static int CountCreated }
{ get { return _CountCreated; } } private bool _Disposed = false;
public static int CountNotDisposed private static int _CountCreated = 0;
{ get { return _CountCreated - _CountDisposed; } } private static int _CountDisposed = 0;
public static int CountNotFinalized private static int _CountFinalized = 0;
{ get { return _CountCreated - _CountFinalized; } } private static int IncrementCountCreated
~FigureInfo() { get { return ++_CountCreated; } }
{ private int _CountWhenCreated = IncrementCountCreated;
_CountFinalized++; public static int CountCreated
} { get { return _CountCreated; } }
public void Dispose() public static int CountNotDisposed
{ { get { return _CountCreated - _CountDisposed; } }
if (_Disposed) return; public static int CountNotFinalized
_CountDisposed++; { get { return _CountCreated - _CountFinalized; } }
_Disposed = true; ~FigureInfo()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(FigureID.ToString())) return; _CountFinalized++;
List<FigureInfo> listFigureInfo = _CacheByPrimaryKey[FigureID.ToString()]; // Get the list of items }
while (listFigureInfo.Contains(this)) listFigureInfo.Remove(this); // Remove the item from the list public void Dispose()
if (listFigureInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(FigureID.ToString()); // remove the list if (_Disposed) return;
} _CountDisposed++;
public virtual Figure Get() _Disposed = true;
{ RemoveFromCache(this);
return _Editable = Figure.Get(_FigureID); if (!_CacheByPrimaryKey.ContainsKey(FigureID.ToString())) return;
} List<FigureInfo> listFigureInfo = _CacheByPrimaryKey[FigureID.ToString()]; // Get the list of items
public static void Refresh(Figure tmp) while (listFigureInfo.Contains(this)) listFigureInfo.Remove(this); // Remove the item from the list
{ if (listFigureInfo.Count == 0) // If there are no items left in the list
string key = tmp.FigureID.ToString(); _CacheByPrimaryKey.Remove(FigureID.ToString()); // remove the list
ConvertListToDictionary(); }
if (_CacheByPrimaryKey.ContainsKey(key)) public virtual Figure Get()
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) {
tmpInfo.RefreshFields(tmp); return _Editable = Figure.Get(_FigureID);
} }
protected virtual void RefreshFields(Figure tmp) public static void Refresh(Figure tmp)
{ {
if (_ROFstID != tmp.ROFstID) string key = tmp.FigureID.ToString();
{ ConvertListToDictionary();
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_ROFstID = tmp.ROFstID; // Update the value foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyROFst = null; // Reset list so that the next line gets a new list }
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value protected virtual void RefreshFields(Figure tmp)
if (_ImageID != tmp.ImageID) {
{ if (_ROFstID != tmp.ROFstID)
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value {
_ImageID = tmp.ImageID; // Update the value if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value
} _ROFstID = tmp.ROFstID; // Update the value
_MyROImage = null; // Reset list so that the next line gets a new list }
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value _MyROFst = null; // Reset list so that the next line gets a new list
_Config = tmp.Config; if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value
_DTS = tmp.DTS; if (_ImageID != tmp.ImageID)
_UserID = tmp.UserID; {
_FigureInfoExtension.Refresh(this); if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value
OnChange();// raise an event _ImageID = tmp.ImageID; // Update the value
} }
public static void Refresh(ROFstFigure tmp) _MyROImage = null; // Reset list so that the next line gets a new list
{ if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value
string key = tmp.FigureID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) _FigureInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(ROFstFigure tmp) public static void Refresh(ROFstFigure tmp)
{ {
if (_ImageID != tmp.ImageID) string key = tmp.FigureID.ToString();
{ ConvertListToDictionary();
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_ImageID = tmp.ImageID; // Update the value foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyROImage = null; // Reset list so that the next line gets a new list }
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value protected virtual void RefreshFields(ROFstFigure tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_ImageID != tmp.ImageID)
_UserID = tmp.UserID; {
_FigureInfoExtension.Refresh(this); if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value
OnChange();// raise an event _ImageID = tmp.ImageID; // Update the value
} }
public static void Refresh(ROImageFigure tmp) _MyROImage = null; // Reset list so that the next line gets a new list
{ if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value
string key = tmp.FigureID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) _FigureInfoExtension.Refresh(this);
tmpInfo.RefreshFields(tmp); OnChange();// raise an event
} }
protected virtual void RefreshFields(ROImageFigure tmp) public static void Refresh(ROImageFigure tmp)
{ {
if (_ROFstID != tmp.ROFstID) string key = tmp.FigureID.ToString();
{ ConvertListToDictionary();
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value if (_CacheByPrimaryKey.ContainsKey(key))
_ROFstID = tmp.ROFstID; // Update the value foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
} tmpInfo.RefreshFields(tmp);
_MyROFst = null; // Reset list so that the next line gets a new list }
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value protected virtual void RefreshFields(ROImageFigure tmp)
_Config = tmp.Config; {
_DTS = tmp.DTS; if (_ROFstID != tmp.ROFstID)
_UserID = tmp.UserID; {
_FigureInfoExtension.Refresh(this); if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value
OnChange();// raise an event _ROFstID = tmp.ROFstID; // Update the value
} }
public static FigureInfo Get(int figureID) _MyROFst = null; // Reset list so that the next line gets a new list
{ if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value
//if (!CanGetObject()) _Config = tmp.Config;
// throw new System.Security.SecurityException("User not authorized to view a Figure"); _DTS = tmp.DTS;
try _UserID = tmp.UserID;
{ _FigureInfoExtension.Refresh(this);
FigureInfo tmp = GetCachedByPrimaryKey(figureID); OnChange();// raise an event
if (tmp == null) }
{ public static FigureInfo Get(int figureID)
tmp = DataPortal.Fetch<FigureInfo>(new PKCriteria(figureID)); {
AddToCache(tmp); //if (!CanGetObject())
} // throw new System.Security.SecurityException("User not authorized to view a Figure");
if (tmp.ErrorMessage == "No Record Found") try
{ {
tmp.Dispose(); // Clean-up FigureInfo FigureInfo tmp = GetCachedByPrimaryKey(figureID);
tmp = null; if (tmp == null)
} {
return tmp; tmp = DataPortal.Fetch<FigureInfo>(new PKCriteria(figureID));
} AddToCache(tmp);
catch (Exception ex) }
{ if (tmp.ErrorMessage == "No Record Found")
throw new DbCslaException("Error on FigureInfo.Get", ex); {
} tmp.Dispose(); // Clean-up FigureInfo
} tmp = null;
#endregion }
#region Data Access Portal return tmp;
internal FigureInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.Constructor", GetHashCode()); {
try throw new DbCslaException("Error on FigureInfo.Get", ex);
{ }
ReadData(dr); }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal FigureInfo(SafeDataReader dr)
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.Constructor", ex); {
throw new DbCslaException("FigureInfo.Constructor", ex); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.Constructor", GetHashCode());
} try
} {
[Serializable()] ReadData(dr);
protected class PKCriteria }
{ catch (Exception ex)
private int _FigureID; {
public int FigureID if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.Constructor", ex);
{ get { return _FigureID; } } throw new DbCslaException("FigureInfo.Constructor", ex);
public PKCriteria(int figureID) }
{ }
_FigureID = figureID; [Serializable()]
} protected class PKCriteria
} {
private string _ROImage_FileName = string.Empty; private int _FigureID;
public string ROImage_FileName public int FigureID
{ { get { return _FigureID; } }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public PKCriteria(int figureID)
get {
{ _FigureID = figureID;
return _ROImage_FileName; }
} }
} private string _ROImage_FileName = string.Empty;
private void ReadData(SafeDataReader dr) public string ROImage_FileName
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.ReadData", GetHashCode()); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
try get
{ {
_FigureID = dr.GetInt32("FigureID"); CanReadProperty("ROImage_FileName", true);
_ROFstID = dr.GetInt32("ROFstID"); return _ROImage_FileName;
_ImageID = dr.GetInt32("ImageID"); }
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); private void ReadData(SafeDataReader dr)
_UserID = dr.GetString("UserID"); {
for (int i = 0; i < dr.FieldCount; i++) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.ReadData", GetHashCode());
{ try
if (dr.GetName(i) == "ROImage_FileName") {
_ROImage_FileName = dr.GetString("ROImage_FileName"); _FigureID = dr.GetInt32("FigureID");
} _ROFstID = dr.GetInt32("ROFstID");
} _ImageID = dr.GetInt32("ImageID");
catch (Exception ex) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.ReadData", ex); _UserID = dr.GetString("UserID");
_ErrorMessage = ex.Message; for (int i = 0; i < dr.FieldCount; i++)
throw new DbCslaException("FigureInfo.ReadData", ex); {
} if (dr.GetName(i) == "ROImage_FileName")
} _ROImage_FileName = dr.GetString("ROImage_FileName");
private void DataPortal_Fetch(PKCriteria criteria) }
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.DataPortal_Fetch", GetHashCode()); catch (Exception ex)
try {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.ReadData", ex);
using (SqlConnection cn = Database.VEPROMS_SqlConnection) _ErrorMessage = ex.Message;
{ throw new DbCslaException("FigureInfo.ReadData", ex);
ApplicationContext.LocalContext["cn"] = cn; }
using (SqlCommand cm = cn.CreateCommand()) }
{ private void DataPortal_Fetch(PKCriteria criteria)
cm.CommandType = CommandType.StoredProcedure; {
cm.CommandText = "getFigure"; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.DataPortal_Fetch", GetHashCode());
cm.Parameters.AddWithValue("@FigureID", criteria.FigureID); try
cm.CommandTimeout = Database.DefaultTimeout; {
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{ {
if (!dr.Read()) ApplicationContext.LocalContext["cn"] = cn;
{ using (SqlCommand cm = cn.CreateCommand())
_ErrorMessage = "No Record Found"; {
return; cm.CommandType = CommandType.StoredProcedure;
} cm.CommandText = "getFigure";
ReadData(dr); cm.Parameters.AddWithValue("@FigureID", criteria.FigureID);
} cm.CommandTimeout = Database.DefaultTimeout;
} using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
// removing of item only needed for local data portal {
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) if (!dr.Read())
ApplicationContext.LocalContext.Remove("cn"); {
} _ErrorMessage = "No Record Found";
} return;
catch (Exception ex) }
{ ReadData(dr);
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.DataPortal_Fetch", ex); }
_ErrorMessage = ex.Message; }
throw new DbCslaException("FigureInfo.DataPortal_Fetch", ex); // removing of item only needed for local data portal
} if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
#endregion }
// Standard Refresh }
#region extension catch (Exception ex)
FigureInfoExtension _FigureInfoExtension = new FigureInfoExtension(); {
[Serializable()] if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.DataPortal_Fetch", ex);
partial class FigureInfoExtension : extensionBase { } _ErrorMessage = ex.Message;
[Serializable()] throw new DbCslaException("FigureInfo.DataPortal_Fetch", ex);
class extensionBase }
{ }
// Default Refresh #endregion
public virtual void Refresh(FigureInfo tmp) { } // Standard Refresh
} #region extension
#endregion FigureInfoExtension _FigureInfoExtension = new FigureInfoExtension();
} // Class [Serializable()]
#region Converter partial class FigureInfoExtension : extensionBase { }
internal class FigureInfoConverter : ExpandableObjectConverter [Serializable()]
{ class extensionBase
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) {
{ // Default Refresh
if (destType == typeof(string) && value is FigureInfo) public virtual void Refresh(FigureInfo tmp) { }
{ }
// Return the ToString value #endregion
return ((FigureInfo)value).ToString(); } // Class
} #region Converter
return base.ConvertTo(context, culture, value, destType); internal class FigureInfoConverter : ExpandableObjectConverter
} {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
#endregion {
if (destType == typeof(string) && value is FigureInfo)
{
// Return the ToString value
return ((FigureInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More