Compare commits

..

100 Commits

Author SHA1 Message Date
bb24d1207d Using Net 4.8.1 build of CSLA 2025-02-06 15:57:41 -05:00
8fc477ec04 Merge pull request 'B2025-014 PROMS – RO Update Admin Tool Error when updating RO containing carats/deltas' (#509) from B2025-014 into Development
good for testing phase
2025-02-05 14:03:18 -05:00
bf06c9e14f B2025-014 PROMS – RO Update Admin Tool Error when updating RO containing carats/deltas
While testing an update for C2025-0011, using BNPP data and ROs, the update ro values crashes at the next to the last procedure set which is folder called "PROMS Tests." It crashes with a null reference as it is not able to detect the format. This is to change this to use the “ActiveFormat” of the Working Folder instead of utilizing “MyFormat”.
2025-02-05 13:34:18 -05:00
5a263107da Merge pull request 'B2025-012 PROMS – Searching Step Elements – All Step Types' (#507) from B2025-012 into Development
good for testing phase
2025-02-05 10:01:13 -05:00
d30bb2e329 B2025-012 PROMS – Searching Step Elements – All Step Types
When searching for step elements (the Find Selected Step Elements option is selected) and "All Types." Is selected for step types, you incorrectly get the "No Types Selected" message box when clicking on search.
2025-02-05 08:38:18 -05:00
8248bd8e47 Merge pull request 'C2025-011 PROMS – RO Update Admin Tool Memory Enhancements' (#506) from C2025-011 into Development
good for the testing phase
2025-02-04 13:47:24 -05:00
378653c536 C2025-011 PROMS – RO Update Admin Tool Memory Enhancements
The purpose of this upgrade is to improve the user experience when using the Admin tool to Update ROs. Currently for larger RO dbs (like Barakah) we can run up against memory constraints that do not allow all the ROs to be updated at one time. This is based upon some initial resource where some places were identified where we could improve memory usage.  Some of these should benefit PROMS as a whole while others will be specific to the RO Update option in Admin Tools.
2025-02-04 13:23:21 -05:00
f2d330bd0e Merge pull request 'F2025-001 Barakah provided us with format changes to add more signoffs to the "BNPP Single Column Format - 2021" in which they had made.' (#505) from F2025-001_BNPP into Development
format only change - ready for testing
2025-02-03 13:41:58 -05:00
c1c93cbdc4 F2025-001 Barakah provided us with format changes to add more signoffs to the "BNPP Single Column Format - 2021" in which they had made. 2025-02-03 13:40:18 -05:00
47a14e143e Merge pull request 'C2019-025_Ability-to-Toggle-Replace-Words-3' (#503) from C2019-025_Ability-to-Toggle-Replace-Words-3 into Development
good for testing phase
2025-01-30 09:26:20 -05:00
b7aa85f4fc C2019-025_Ability-to-Toggle-Replace-Words-3 2025-01-30 09:22:51 -05:00
90e25f3fcf C2019-025_Ability-to-Toggle-Replace-Words-3 2025-01-30 09:09:39 -05:00
d67e81d8a6 Merge pull request 'C2025-005 PROMS – Searching Step Elements' (#502) from C2025-005 into Development
good for testing phase
2025-01-29 15:31:59 -05:00
057915baaa C2025-005 PROMS – Searching Step Elements
When searching for step elements (the Find Selected Step Elements option is selected) and multiple procedure sets are selected, but the procedure sets use different formats, PROMS puts a message in the Results area that says "folders selected contain multiple formats". Need to expand this messaging to provide more clear information regarding which formats are causing the issue, so that they can more easily decide which sets to de-select rather than doing so randomly.  There is also a refresh issue where deselecting everything, it will not always refresh properly.
2025-01-29 15:26:29 -05:00
fe268b6122 Merge pull request 'C2019-025_Ability-to-Toggle-Replace-Words-2' (#501) from C2019-025_Ability-to-Toggle-Replace-Words-2 into Development
good for testing phase
2025-01-29 15:04:09 -05:00
ca61597863 C2019-025_Ability-to-Toggle-Replace-Words-2 2025-01-29 14:21:14 -05:00
a04def360d Merge pull request 'B2025-010 PROMS – Change ID Issues' (#500) from B2025-010 into Development
good for testing phase
2025-01-28 09:05:28 -05:00
5e43a8501b B2025-010 PROMS – Change ID Issues
Removing the change id via backspaces in the change id box in the step properties panel can cause PROMS to crash. Also, it doesn’t always remove the change id properly. Changing this to instead of updating every time text changes in the box, adding a save button. Also, adding some null exception error handling.
2025-01-27 16:09:19 -05:00
e893264075 Merge pull request 'C2019-025_Ability-to-Toggle-Replace-Words' (#499) from C2019-025_Ability-to-Toggle-Replace-Words into Development
OK for testing phase
2025-01-27 15:51:01 -05:00
cf20704811 C2019-025_Ability-to-Toggle-Replace-Words 2025-01-27 15:45:09 -05:00
37c5b23a86 C2019-025_Ability-to-Toggle-Replace-Words 2025-01-27 13:38:48 -05:00
82d8fe6e17 Merge pull request 'B2025-005 PROMS - Change Reports - Invalid Transitions showing Incorrectly' (#498) from B2025-005 into Development
good for testing phase
2025-01-24 15:53:37 -05:00
4ca3697845 B2025-005 PROMS - Change Reports - Invalid Transitions showing Incorrectly 2025-01-24 15:29:07 -05:00
71130bd26b C2019-025_Ability-to-Toggle-Replace-Words 2025-01-24 10:12:43 -05:00
37626d8f45 Merge pull request 'C2025-008 RO Editor – Remove redundant Save Failed message box' (#497) from C2025-008 into Development
Good for testing phase
2025-01-24 08:36:04 -05:00
f95369d3a4 C2025-008 RO Editor – Remove redundant Save Failed message box 2025-01-24 08:02:24 -05:00
aa00891f8e Merge pull request 'B2025-008 PROMS - Display RO Step Properties - RO Tables' (#496) from B2025-008 into Development
good for testing phase
2025-01-23 16:13:56 -05:00
d44f9ba2b6 B2025-008 PROMS - Display RO Step Properties - RO Tables 2025-01-23 15:50:52 -05:00
c3b7b1e5a4 Merge pull request 'B2025-007 RO Editor – RO Figure Default File extension' (#495) from B2025-007 into Development
good for testing phase
2025-01-23 11:06:24 -05:00
f3309e4a40 B2025-007 RO Editor – RO Figure Default File extension 2025-01-23 11:02:15 -05:00
8fa059c186 Merge pull request 'C2025-007 ROEditor - PROMPT to Confirm Deletion' (#494) from C2025-007 into Development
good for testing phase
2025-01-22 13:31:24 -05:00
96e61aea2b C2025-007 ROEditor - PROMPT to Confirm Deletion
When deleting a group or an RO in the RO Editor, consider adding a prompte for the user asking if they are sure they want to delete the ro/group.  Perhaps also add text to the message saying they may want to consider creating a zip file of the RO folder prior to deleting ROs/groups.
2025-01-22 12:45:27 -05:00
565779c9c8 Merge pull request 'B2025-009 RO Editor - Disable the Save As button if it is a new RO that has not been saved yet.' (#493) from B2025-009 into Development
change ready for testing
2025-01-22 12:01:04 -05:00
b4ccd682c3 B2025-009 RO Editor - Disable the Save As button if it is a new RO that has not been saved yet.
Adding a new RO:  when you click Save As, you get the Problem Saving Data message box. Should only be able to “Save As” if it has already been previously saved.
2025-01-22 11:57:57 -05:00
dba1331556 Merge pull request 'B2025-004 Remove dependency on stored procedure (GetDisplayTabdata).' (#492) from B2025-004_v2 into Development
changes good for testing phase
2025-01-22 10:39:24 -05:00
8803ae2274 B2025-004 Remove dependency on stored procedure (GetDisplayTabdata).
-- Found during testing that needed a few additional items that needed to not create hard errors
2025-01-22 10:35:44 -05:00
69d09b7fc2 Merge pull request 'B2025-004 Remove dependency on stored procedure (GetDisplayTabdata).' (#491) from B2025-004 into Development
good for testing phase
2025-01-22 08:25:26 -05:00
8ddfc8654e Merge pull request 'C2025-006_B2025-006 - C2025-006 RO Editor Figure wording update, B2025-006 RO Editor Figure Height or Width warning message update' (#490) from C2025-006_B2025-006 into Development
good for testing phase
2025-01-22 08:19:05 -05:00
7a3243e882 B2025-004 Remove dependency on stored procedure (GetDisplayTabdata). 2025-01-22 06:59:03 -05:00
4fc3b89e06 C2025-006_B2025-006 - C2025-006 RO Editor Figure wording update, B2025-006 RO Editor Figure Height or Width warning message update 2025-01-22 06:26:48 -05:00
a17419ac12 Merge pull request 'C2025-003 Enhanced Copy/Paste Upgrade - Add ability to copy/paste over enhanced master documents' (#487) from C2025-003 into Development
ready for testing phase
2025-01-21 10:48:00 -05:00
88905132e7 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2025-01-21 10:40:06 -05:00
111bed58d6 Merge pull request 'B2025-003 Chronology/Summary of Changes Reports' (#488) from B2025-003 into Development
Reviewed-on: #488

due to GIT restore from backup
2025-01-21 10:31:21 -05:00
bed61324d6 C2025-003 Enhanced Copy/Paste Upgrade - Add ability to copy/paste over enhanced master documents 2025-01-20 14:43:54 -05:00
1a889352b8 Merge pull request 'B2025-003 Chronology/Summary of Changes Reports' (#485) from B2025-003 into Development
ready for testing phase
2025-01-09 11:14:22 -05:00
5bba126a36 B2025-003 Chronology/Summary of Changes Reports 2025-01-09 11:08:30 -05:00
e01b955d46 Merge pull request 'F2024-088 - Per customer’s request, removed “Using”, “Faulted”, “Intact”, “Normal”, “On”, “Off”, “Locally”, “Manually”, “Fall”, “Rise”, and “Ruptured” from the ReplaceWords list' (#484) from F2024-088_FNP into Development
Format only change.  ready for testing phase
2024-12-17 09:48:30 -05:00
e3431b0e1e F2024-088 - Per customer’s request, removed “Using”, “Faulted”, “Intact”, “Normal”, “On”, “Off”, “Locally”, “Manually”, “Fall”, “Rise”, and “Ruptured” from the ReplaceWords list 2024-12-17 09:46:40 -05:00
b6d646b910 Merge pull request 'F2024-086 In the PROMS Manual format in the Attachments (Step Editor) With Border section type, the page number needs centered horizontally on the page (it's located between the section number and section title.' (#483) from F2024-086 into Development
good for testing phase
2024-12-12 08:44:08 -05:00
bb679a2790 F2024-086 In the PROMS Manual format in the Attachments (Step Editor) With Border section type, the page number needs centered horizontally on the page (it's located between the section number and section title. 2024-12-12 08:36:29 -05:00
e3af0a6426 Merge pull request 'B2024-094 - Carats (as Deltas) print as question marks in tables when unit <u> is used in RO Definition Value' (#482) from B2024-094 into Development
good for testing phase
2024-12-12 08:33:12 -05:00
b2108b9e5f B2024-094 - Carats (as Deltas) print as question marks in tables when unit <u> is used in RO Definition Value 2024-12-11 15:35:29 -05:00
d100002107 Merge pull request 'F2024-087 - Fixes printing sub-sections that go from continuous (single column sub-sections) to a separate (two column sub-section) so that the two column sub-section starts at the top of the page.' (#480) from F2024-097_Farley into Development
format only - good for testing phase
2024-12-11 11:14:44 -05:00
afd61303c5 F2024-087 - Fixes printing sub-sections that go from continuous (single column sub-sections) to a separate (two column sub-section) so that the two column sub-section starts at the top of the page. 2024-12-11 11:07:30 -05:00
d1c3e81a38 Merge pull request 'B2024-096 In the Ro Editor, allow <u> for a field name in the Referenced object Definition Return Value.' (#479) from B2024-096 into Development
good for testing phase
2024-12-10 09:00:22 -05:00
46419edfee B2024-096 In the Ro Editor, allow <u> for a field name in the Referenced object Definition Return Value. 2024-12-10 08:36:30 -05:00
81c91d7866 Merge pull request 'C2024-037 Enhanced Print Section so that it can now be utilized for Sections that contain subsections.' (#478) from C2024-037 into Development
good for testing phase
2024-12-09 16:07:53 -05:00
34ee092919 C2024-037 Enhanced Print Section so that it can now be utilized for Sections that contain subsections.
Farley uses subsections in some of their AOP procedures.   The "Print Section" feature did not work for these sections - instead returning a message as if the pdf was already open.
2024-12-09 15:24:34 -05:00
d07344a88a Merge pull request 'B2024-095 In Admin Tools, added minimum heights to the left side panels above selecting items in the trees. Previously when the windows were resized the trees would overlap with buttons and notes.' (#477) from B2024-095 into Development
good for testing phase
2024-12-09 10:34:58 -05:00
66ae1c632b B2024-095 In Admin Tools, added minimum heights to the left side panels above selecting items in the trees. Previously when the windows were resized the trees would overlap with buttons and notes. 2024-12-09 08:00:15 -05:00
7cc7b71edd Merge pull request 'B2024-067 Deleting Folders through Admin Tools missing some folders' (#476) from B2024-067 into Development
ready for testing phase
2024-12-05 15:51:32 -05:00
a223dfd463 B2024-067 Deleting Folders through Admin Tools missing some folders 2024-12-05 15:27:46 -05:00
61e8bc5ffa Merge pull request '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 also fixes restoring a deleted RO table column that has a hyphen in …' (#475) from B2024-003_B2023-113_B2024-093 into Development
good for testing phase
2024-12-03 15:22:47 -05:00
bba52a736a 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 also fixes restoring a deleted RO table column that has a hyphen in it. Also, Dashes/Hyphens and Carets in RO TABLES were behaving differently in different data sets due to different fonts – this fixes so that carats when ConvertCaretToDelta is set in the format, will properly restore/store as Deltas. 2024-12-03 15:12:04 -05:00
c5d575a019 Merge pull request 'F2019-011 Wide step tabs were printing into text. Shifted Left Justification slightly (roughly 2 characters) to account for these / this spacing.' (#474) from F2019-011 into Development
ok for testing phase
2024-11-27 09:28:22 -05:00
08f8441aca F2019-011 Wide step tabs were printing into text. Shifted Left Justification slightly (roughly 2 characters) to account for these / this spacing. 2024-11-27 09:19:42 -05:00
6bf116cbef Merge pull request 'B2023-095_U2022-004 - When Copy/Pasting Symbols, some of the symbols paste in an incorrect font' (#473) from B2023-095_U2022-004 into Development
good for testing phase
2024-11-25 14:51:35 -05:00
cc96b3fa5b B2023-095_U2022-004 - When Copy/Pasting Symbols, some of the symbols paste in an incorrect font 2024-11-25 14:44:50 -05:00
b489452bd1 Merge pull request 'B2023-029 - Added format flag to Continuous Action Note and Continuous Action Caution so that the check box to include on the generated Continuous Action Summary is automatically checked' (#472) from B2023-039_bwd_byr into Development
format only change.
Ready for testing phase
2024-11-22 14:56:17 -05:00
fa4e3997e4 B2023-029 - Added format flag to Continuous Action Note and Continuous Action Caution so that the check box to include on the generated Continuous Action Summary is automatically checked 2024-11-22 14:55:12 -05:00
7659cbbee6 Merge pull request 'B2023-074 - Fixed printing a section title, via the section properties check box, on a two-column step editor section.' (#471) from General_Debugging into Development
minor code change - no review needed.
OK for testing phase
2024-11-22 10:20:22 -05:00
548b845f62 B2023-074 - Fixed printing a section title, via the section properties check box, on a two-column step editor section. 2024-11-22 10:10:57 -05:00
4f733656a0 Merge pull request 'F2024-085 - Added a Conditional Time Critical Action high level step type to the EOP and AOP formats' (#470) from F2024-085_BVPS_ContTimeAction into Development
format only changes
2024-11-20 09:12:29 -05:00
f4ef244a10 F2024-085 - Added a Conditional Time Critical Action high level step type to the EOP and AOP formats 2024-11-20 09:10:46 -05:00
839000d48c Merge pull request 'B2024-003_ B2023-113 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 also fixes restoring a deleted RO table column that has a hyphen in it.' (#469) from B2024-003_B2023_113_GIT into Development
good for testing phase
2024-11-18 16:24:13 -05:00
bcb8f419ee B2024-003_ B2023-113 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 also fixes restoring a deleted RO table column that has a hyphen in it. 2024-11-18 16:17:07 -05:00
059c399240 Merge pull request 'B2021-094 - Fixed shortcut keystroke usage for the GoTo button <Shift><Ctrl><G> when used multiple times' (#468) from B2021-094_keystroke4GoTo into Development
Looks good - ready for QA
2024-11-18 14:59:13 -05:00
13b3cd6bc4 B2021-094 - Fixed shortcut keystroke usage for the GoTo button <Shift><Ctrl><G> when used multiple times 2024-11-18 14:54:34 -05:00
3cd4f4c5d9 Merge pull request 'C2024-028 Add an enhancement to Admin Tools -> Refresh Transitions. Transitions with bad links that cannot be auto-fixed, will now add an annotation of “Bad Transition Link” (which can then be searched for and manually resolved.)' (#467) from C2024-028 into Development
good for testing phase
2024-11-15 09:51:23 -05:00
02b20df652 C2024-028 Add an enhancement to Admin Tools -> Refresh Transitions. Transitions with bad links that cannot be auto-fixed, will now add an annotation of “Bad Transition Link” (which can then be searched for and manually resolved.) 2024-11-15 09:23:27 -05:00
416bdf16e0 Merge pull request 'B2021-043 Step numbering is out of order in RO usage report if RO values exist on steps 10 or higher.' (#466) from B2021-043 into Development
good for testing phase
2024-11-13 14:40:33 -05:00
75a4f66714 B2021-043 Step numbering is out of order in RO usage report if RO values exist on steps 10 or higher. 2024-11-13 14:10:39 -05:00
a5b9c26a97 Merge pull request 'F2024-078 - Adjust the spacing before and after the Note tab, along with the blank space (line) at the bottom of the Note box per the example supplied by the customer. Also made similar adjustments to the Caution tab and box.' (#465) from F2024-078_BVNoteSpacing into Development
Looks good - Ready for QA
2024-11-11 16:35:56 -05:00
0aa476d9dd F2024-078 - Adjust the spacing before and after the Note tab, along with the blank space (line) at the bottom of the Note box per the example supplied by the customer. Also made similar adjustments to the Caution tab and box. 2024-11-11 15:56:55 -05:00
0f4eec1df6 Merge pull request 'B2024-092 Add Initial Line/Ability to Disable to UI for South Texas' (#463) from B2024-092 into Development
good for testing phase
2024-11-11 08:28:36 -05:00
4bc73f847c B2024-092 Add Initial Line/Ability to Disable to UI for South Texas 2024-11-11 07:15:02 -05:00
e1271c16d9 Merge pull request 'B2024-090 If multiple tabs are left open, and Find is clicked before clicking on a tab, PROMS would crash.' (#462) from B2024-090 into Development
good for testing phase
2024-11-08 15:43:30 -05:00
c7d2140e16 B2024-090 If multiple tabs are left open, and Find is clicked before clicking on a tab, PROMS would crash. 2024-11-08 15:37:49 -05:00
ac6ee6ff83 Merge pull request 'C2024-022 Add option to select by unit when generating a Time Critical Action Summary from the ribbon in a Parent document.' (#461) from C2024-022 into Development
good for testing phase
2024-11-07 15:24:47 -05:00
1507cf31ce C2024-022 Add option to select by unit when generating a Time Critical Action Summary from the ribbon in a Parent document. 2024-11-07 15:06:38 -05:00
aad04647ac Merge pull request 'C2024-021 Update the tool tip on the Time Critical Action Summary option (Step Properties panel) to reflect the Time Critical Action Summary text rather than the Continuous Action Summary text.' (#460) from C2024-021 into Development
good for testing phase
2024-11-07 10:54:58 -05:00
934d3977d8 C2024-021 Update the tool tip on the Time Critical Action Summary option (Step Properties panel) to reflect the Time Critical Action Summary text rather than the Continuous Action Summary text. 2024-11-07 10:08:26 -05:00
03b0e52bef Merge pull request 'B2024-064 Improve user experience by providing more descriptive wording when cannot change the Applicability of a Step/Section.' (#459) from B2024-064 into Development
good for testing phase
2024-11-07 09:20:47 -05:00
1da2b8e87c B2024-064 Improve user experience by providing more descriptive wording when cannot change the Applicability of a Step/Section. 2024-11-07 09:13:40 -05:00
e3d16142ac Merge pull request 'C2024-025 Remove the tall box characters from the search results.' (#458) from C2024-025 into Development
Good for testing phase
2024-11-07 08:42:21 -05:00
b972e40a28 C2024-025 Remove the tall box characters from the search results. 2024-11-07 08:26:26 -05:00
c508255ab3 Merge pull request 'C2024-026 Add feature to the transitions panel to allow user to hold currently selected procedure/set in the panel.' (#457) from C2024-026 into Development
good for testing phase
2024-11-05 13:21:31 -05:00
e9ec884eb9 C2024-026 Add feature to the transitions panel to allow user to hold currently selected procedure/set in the panel. 2024-11-05 10:59:01 -05:00
592d28e898 Merge pull request 'B2024-080 Add Image Thumbnails to Find Submenu items to be consistent with elsewhere in the application' (#456) from B2024-080 into Development
Good for testing phase
2024-11-05 10:53:06 -05:00
b826fa6a20 B2024-080 Add Image Thumbnails to Find Submenu items to be consistent with elsewhere in the application 2024-11-05 10:48:52 -05:00
325 changed files with 163468 additions and 165804 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.

Binary file not shown.

View File

@@ -746,6 +746,7 @@ 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,7 +504,6 @@ 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);
@@ -594,7 +593,6 @@ namespace ROEditor
return; return;
} }
roTreeView.SelectedNode = trnd; roTreeView.SelectedNode = trnd;
} }
protected void roTreeView_AfterSelect (object sender, protected void roTreeView_AfterSelect (object sender,
@@ -676,12 +674,14 @@ 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 ((Control.ModifierKeys & Keys.Shift) != 0) // if user does the <Ctrl><Shift><G> keystroke (Goto selected RO from step editor)
// 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,7 +1154,10 @@ namespace ROEditor
tbtnCancel.Enabled = true; tbtnCancel.Enabled = true;
tbtnSave.Enabled = true; tbtnSave.Enabled = true;
tbtnRestore.Enabled = true; tbtnRestore.Enabled = true;
tbtnSaveAs.Enabled = true; if (newone == null)
{ tbtnSaveAs.Enabled = true; }
else
{ tbtnSaveAs.Enabled = false; }
} }
menuROSave.Enabled = tbtnSave.Enabled; menuROSave.Enabled = tbtnSave.Enabled;
} }
@@ -1170,7 +1173,10 @@ namespace ROEditor
tbtnSave.Enabled = true; tbtnSave.Enabled = true;
tbtnRestore.Enabled = true; tbtnRestore.Enabled = true;
tbtnSaveAs.Enabled = true; if (newone == null)
{ 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
@@ -2392,20 +2398,26 @@ namespace ROEditor
*/ */
private void menuRODelete_Click(object sender, System.EventArgs e) private void menuRODelete_Click(object sender, System.EventArgs e)
{ {
bool success=false; 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?";
XmlNode nd = (XmlNode) roTreeView.SelectedNode.Tag;
if (nd.ParentNode.Name == "RO_Root") DialogResult AnswerYN = MessageBox.Show(msgstr, "Deleting ROs/RO Group", MessageBoxButtons.YesNo);
success = myrodb.RODB_DeleteGroup(nd,null,null); if (AnswerYN == DialogResult.Yes)
else
success = myrodb.RODB_DeleteRO(nd);
if (success == true)
{ {
// remove from xml tree & the tree control bool success = false;
XmlNode parent = nd.ParentNode; XmlNode nd = (XmlNode)roTreeView.SelectedNode.Tag;
parent.RemoveChild(nd); if (nd.ParentNode.Name == "RO_Root")
updateRoListView(roTreeView.SelectedNode.Parent); success = myrodb.RODB_DeleteGroup(nd, null, null);
roTreeView.SelectedNode.Remove(); else
roTreeView.Refresh(); success = myrodb.RODB_DeleteRO(nd);
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();
}
} }
} }
@@ -2616,7 +2628,6 @@ namespace ROEditor
success = ctlXMLEdit2.SaveData(); success = ctlXMLEdit2.SaveData();
if (!success) if (!success)
{ {
MessageBox.Show("Save Failed");
return false; return false;
} }
VlnXmlElement myro; VlnXmlElement myro;
@@ -2732,7 +2743,6 @@ 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,29 +324,17 @@ 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 (DefaultGraphicFileExtension.Equals("")) if (string.IsNullOrEmpty(DefaultGraphicFileExtension)) DefaultGraphicFileExtension = in1.ReadString("ROApp", "Extension", ".TIF");
{ // if (File.Exists(PromsINI))
string ApplPathUp = ApplicationPath.ToUpper(); // DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI);
int idx = ApplPathUp.IndexOf("VE-PROMS.NET\\BIN"); // if (File.Exists("ROAPP.INI"))
if (idx >= 0) // DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention",".TIF",5,"ROAPP.INI");
{
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;
@@ -784,6 +772,7 @@ namespace ctlXMLEditLib
dosaveflag = false; dosaveflag = false;
return (true); return (true);
} }
MessageBox.Show("Save Failed");
return (false); return (false);
} }
@@ -1129,7 +1118,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); // C2021-026 applicLabel is the P/C Child name mylabel.Text = (applicLabel.Length > 0) ? applicLabel : CvtFldToUserFld(element.Name).Replace("Image_",""); // 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.
@@ -1484,12 +1473,15 @@ namespace ctlXMLEditLib
if (fnamebox.Text != "" && fnamebox.Modified == true) if (fnamebox.Text != "" && fnamebox.Modified == true)
{ {
FileInfo ifi = new FileInfo(fnamebox.Text); FileInfo ifi = new FileInfo(fnamebox.Text);
if (ifi.Exists == false) if (ifi.Exists == false)
{ {
MessageBoxButtons buttons = MessageBoxButtons.OK; FileInfo ifi2 = new FileInfo(fnamebox.Text + DefaultGraphicFileExtension);
MessageBox.Show( "File does not exist.", if (!ifi2.Exists)
"File Input Error", buttons); {
return; MessageBox.Show("File does not exist.",
"File Input Error", MessageBoxButtons.OK);
return;
}
} }
bool ok = ValidGraphicsFile(fnamebox.Text); bool ok = ValidGraphicsFile(fnamebox.Text);
if (ok != true) if (ok != true)
@@ -1696,7 +1688,7 @@ namespace ctlXMLEditLib
} }
catch (Exception ee) catch (Exception ee)
{ {
MessageBox.Show("Invalid Height Input",ee.ToString()); 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");
} }
} }
} }
@@ -1713,7 +1705,7 @@ namespace ctlXMLEditLib
} }
catch (Exception ee) catch (Exception ee)
{ {
MessageBox.Show("Invalid Width Input", ee.ToString()); 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");
} }
} }
} }

View File

@@ -328,6 +328,18 @@ 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,6 +80,11 @@
<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>

View File

@@ -103,8 +103,9 @@
<Reference Include="C1.Win.C1Command.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=e808566f358766d8" /> <Reference Include="C1.Win.C1Command.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=e808566f358766d8" />
<Reference Include="C1.Win.C1FlexGrid.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=79882d576c6336da, processorArchitecture=MSIL" /> <Reference Include="C1.Win.C1FlexGrid.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=79882d576c6336da, processorArchitecture=MSIL" />
<Reference Include="C1.Win.C1Input.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=7e7ff60f0c214f9a, processorArchitecture=MSIL" /> <Reference Include="C1.Win.C1Input.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=7e7ff60f0c214f9a, processorArchitecture=MSIL" />
<Reference Include="Csla"> <Reference Include="Csla, Version=2.1.4.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30, processorArchitecture=MSIL">
<HintPath>..\..\..\..\3rdPartyLibraries\CSLA\Csla.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\3rdPartyLibraries\CSLA\CSLA20cs_DLL_Net_4.8.1_Build\Csla.dll</HintPath>
</Reference> </Reference>
<Reference Include="DevComponents.DotNetBar2, Version=14.1.0.37, Culture=neutral, PublicKeyToken=7eb7c3a35b91de04, processorArchitecture=MSIL"> <Reference Include="DevComponents.DotNetBar2, Version=14.1.0.37, Culture=neutral, PublicKeyToken=7eb7c3a35b91de04, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,5 @@
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;
@@ -10,7 +8,6 @@ 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
@@ -178,6 +175,8 @@ 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);
@@ -233,7 +232,7 @@ namespace VEPROMS
loadedWorkingDraft = true; loadedWorkingDraft = true;
} }
if (tn.Parent != null && !loadedWorkingDraft) if (tn.Parent != null && !loadedWorkingDraft && fi.FolderDocVersionCount == 0)
{ {
tn.Remove(); tn.Remove();
} }
@@ -340,6 +339,8 @@ namespace VEPROMS
pbProcess.PerformStep(); pbProcess.PerformStep();
Application.DoEvents(); Application.DoEvents();
} }
ClearCache();
} }
Application.DoEvents(); Application.DoEvents();
@@ -387,6 +388,23 @@ 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()
@@ -481,12 +499,14 @@ 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()
@@ -535,11 +555,12 @@ 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) if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0)
{ {
txtResults.AppendText("No Transitions Needed Updated."); txtResults.AppendText("No Transitions Needed Updated.");
txtResults.AppendText(Environment.NewLine); txtResults.AppendText(Environment.NewLine);
@@ -551,16 +572,18 @@ 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))); txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed + numTransCantFix)));
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 usccessful for all procedures selected."); sb.AppendLine("The batch refresh process was not successful 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());
@@ -579,11 +602,11 @@ namespace VEPROMS
} }
} }
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
// B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic // B2018-002 - Invalid Transitions - Display Transition Refresh Statistic
if (numTransFixed == 0 && numTransConverted == 0) if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 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.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted), numTransFixed, numTransConverted), "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.\n\n {4} Transitions unable to be automatically fixed (Annotation: Bad Transition Link).", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted + numTransCantFix), numTransFixed, numTransConverted, numTransCantFix), "Refresh Transitions Completed");
} }
// C2017-030 - new Admin Tools user interface // C2017-030 - new Admin Tools user interface
@@ -995,6 +1018,9 @@ 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);
@@ -1081,6 +1107,7 @@ 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);
} }
@@ -1103,8 +1130,7 @@ 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}Elapsed Seconds:{5}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds)); 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));
//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());
@@ -1970,7 +1996,20 @@ 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/xhBQAAAplJREFUOE+N iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84 ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
zJwL4b/EAAAAAElFTkSuQmCC ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</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/xhBQAAAplJREFUOE+N iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84 ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
zJwL4b/EAAAAAElFTkSuQmCC ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</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/xhBQAAAplJREFUOE+N iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84 ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
zJwL4b/EAAAAAElFTkSuQmCC ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</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/xhBQAAAplJREFUOE+N iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84 ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
zJwL4b/EAAAAAElFTkSuQmCC ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</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/xhBQAAAplJREFUOE+N iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84 ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
zJwL4b/EAAAAAElFTkSuQmCC ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="swRmObsoleteROData.SuperTooltip" xml:space="preserve"> <data name="swRmObsoleteROData.SuperTooltip" xml:space="preserve">

View File

@@ -88,6 +88,12 @@ 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();
@@ -95,11 +101,6 @@ 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();
@@ -120,9 +121,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();
@@ -871,8 +872,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.tcpGeneral);
this.tcSectionProp.Controls.Add(this.tcpFormat); this.tcSectionProp.Controls.Add(this.tcpFormat);
this.tcSectionProp.Controls.Add(this.tcpGeneral);
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);
@@ -892,6 +893,151 @@ 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);
@@ -1046,138 +1192,6 @@ 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);
@@ -1465,7 +1479,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(730, 398); this.ClientSize = new System.Drawing.Size(722, 390);
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);
@@ -1489,12 +1503,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);
@@ -1598,5 +1612,6 @@ 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,6 +523,23 @@ 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
@@ -1211,6 +1228,7 @@ 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)
@@ -1380,7 +1398,8 @@ 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);
@@ -1447,6 +1466,14 @@ 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,8 +142,11 @@ 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,8 +77,10 @@ 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();
@@ -95,6 +97,7 @@ 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
@@ -301,6 +304,7 @@ 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);
@@ -1120,6 +1124,20 @@ 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
// //
// //
@@ -1179,6 +1197,48 @@ 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;
@@ -1214,6 +1274,8 @@ 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);
} }
@@ -1268,7 +1330,9 @@ 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,6 +68,7 @@ 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;
@@ -180,6 +181,7 @@ 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;
@@ -195,6 +197,8 @@ 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;
@@ -211,6 +215,7 @@ 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;
@@ -344,10 +349,16 @@ 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)
{ {
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked; Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked;
} VlnSettings.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked;
Properties.Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked; // update setting value
Properties.Settings.Default.Save(); // save settings
}
} }
} }

View File

@@ -524,6 +524,7 @@ 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);
@@ -816,6 +817,11 @@ 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;
@@ -2385,6 +2391,16 @@ namespace VEPROMS
OpenItem(_Procedure); OpenItem(_Procedure);
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work. // SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel; SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
//CSM B2024-090 - if last displaytab item,
//select the steptab panel for it
//and set the EditItem for Find/Replace
//otherwise will cause PROMS to crash if Find clicked before a Tab is given Focus
if ((DisPlayTabState.Rows.IndexOf(TabState) == DisPlayTabState.Rows.Count - 1))
{
SelectedStepTabPanel.Select();
dlgFindReplace.MyEditItem = tc.MyEditItem;
}
} }
} }
} }

View File

@@ -517,6 +517,57 @@ 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,6 +528,24 @@ 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,6 +493,34 @@ 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,19 +687,46 @@ 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);
} }
@@ -708,6 +735,8 @@ 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);
} }
@@ -719,7 +748,17 @@ namespace VEPROMS.CSLA.Library
if (gg != newvalue) if (gg != newvalue)
{ {
retval = gg; retval = gg;
MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength); //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.
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;
} }
} }
@@ -729,6 +768,64 @@ 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
@@ -1255,6 +1352,16 @@ 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", " ");
@@ -1307,7 +1414,19 @@ 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,11 +6,18 @@ 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);
@@ -46,6 +53,45 @@ 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
{ {
@@ -357,9 +403,34 @@ 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");
text = DoReplaceWords2(text); // C2029-025 Show or hide replace words. Can highlight replace words in editor.
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
@@ -2101,7 +2172,7 @@ namespace VEPROMS.CSLA.Library
return (bool) _ProcessReplaceWords; return (bool) _ProcessReplaceWords;
} }
} }
private string DoReplaceWords2(string Text) private string DoReplaceWords2(string Text, E_EditPrintMode epMode)
{ {
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).
@@ -2162,6 +2233,7 @@ 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|^)";
@@ -2188,7 +2260,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(); Text = myMatches.ReplaceMatches(epMode);
//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;
@@ -2480,7 +2552,8 @@ 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;
@@ -2572,6 +2645,11 @@ 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,29 +49,35 @@ namespace VEPROMS.CSLA.Library
{ {
if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false; if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false;
ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID); using (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;
RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID); FileInfo fiRofst = new FileInfo(rofstPath);
string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return false;
FileInfo fiRofst = new FileInfo(rofstPath); // if the database Ro.Fst is newer or if the files have identical DTS,
// assume that they are the same file.
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false;
// if the database Ro.Fst is newer or if the files have identical DTS, // next see if the data is the same size, i.e. byte count of record and byte count
// assume that they are the same file. // of file. If different sizes, the date/time stamp check will hold.
if (roFstInfo.DTS >= fiRofst.LastWriteTimeUtc) return false; // B2022-026 RO Memory reduction - new logic
var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID);
// next see if the data is the same size, i.e. byte count of record and byte count if (bytes != null && fiRofst.Length != bytes.Length)
// of file. If different sizes, the date/time stamp check will hold. return fiRofst.LastWriteTimeUtc > roFstInfo.DTS;
// B2022-026 RO Memory reduction - new logic
var bytes = ROFSTLookup.GetRofstLookupBytes(roFstInfo.ROFstID); // 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);
}
}
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,6 +11,7 @@ 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
{ {
@@ -39,6 +40,17 @@ 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();
@@ -325,6 +337,32 @@ 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
@@ -402,6 +440,99 @@ 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);
@@ -619,12 +750,14 @@ 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;
@@ -731,6 +864,15 @@ 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);
}
}
} }
} }
} }
@@ -2386,15 +2528,19 @@ namespace VEPROMS.CSLA.Library
} }
public ItemInfo LastChild(E_FromType partType) public ItemInfo LastChild(E_FromType partType)
{ {
ItemInfoList myitems = Lookup((int)partType); using (ItemInfoList myitems = Lookup((int)partType))
if (myitems != null) return myitems[myitems.Count - 1]; {
return null; if (myitems != null) return myitems[myitems.Count - 1];
return null;
}
} }
public ItemInfo FirstChild(E_FromType partType) public ItemInfo FirstChild(E_FromType partType)
{ {
ItemInfoList myitems = Lookup((int)partType); using (ItemInfoList myitems = Lookup((int)partType))
if (myitems != null) return myitems[0]; {
return null; if (myitems != null) return myitems[0];
return null;
}
} }
public bool HasAncestor(ItemInfo ancestor) public bool HasAncestor(ItemInfo ancestor)
{ {
@@ -2752,6 +2898,29 @@ namespace VEPROMS.CSLA.Library
} }
#endregion UnlinkEnhanced #endregion UnlinkEnhanced
#region Search #region Search
//CSM C2024-025 Removing the strange tall box characters that appear in the search results tree
//Create cleaned version of variable for use in DisplaySearch
//This is the Function that does the cleaning
public string CleanSearchString(string value)
{
// \u000C = PageBreak
// \u0009 = Tab
// \u160? = Hard Space
// \u0007 = Bell (Separates Parent Path and Child Path)
// \u0011 - Separates DisplayNumber & DisplayText of Step
if (value == null)
return null;
string tmp = value.Replace("\a", "\\").Replace("\u0007", "\\");
tmp = tmp.Replace("\u000C", " ").Replace("\u0009", " ").Replace(@"\u160?", " ").Replace("\u0011", " ");
if (tmp.StartsWith("\\"))
tmp = tmp.Substring(1);
return tmp;
}
internal string _SearchDVPath; internal string _SearchDVPath;
public string SearchDVPath public string SearchDVPath
{ {
@@ -2767,7 +2936,11 @@ namespace VEPROMS.CSLA.Library
return _SearchDVPath; return _SearchDVPath;
} }
} }
internal string _SearchPath; //CSM C2024-025 Removing the strange tall box characters that appear in the search results tree
//Create cleaned version of variable for use in DisplaySearch
public string SearchDVPath_clean => CleanSearchString(SearchDVPath);
internal string _SearchPath;
public string SearchPath public string SearchPath
{ {
get get
@@ -2790,6 +2963,10 @@ namespace VEPROMS.CSLA.Library
return _SearchPath; return _SearchPath;
} }
} }
//CSM C2024-025 Removing the strange tall box characters that appear in the search results tree
//Create cleaned version of variable for use in DisplaySearch
public string SearchPath_clean => CleanSearchString(SearchPath);
public string ShortSearchPath public string ShortSearchPath
{ {
get get
@@ -2800,6 +2977,9 @@ namespace VEPROMS.CSLA.Library
return dtext; return dtext;
} }
} }
//CSM C2024-025 Removing the strange tall box characters that appear in the search results tree
//Create cleaned version of variable for use in DisplaySearch
public string ShortSearchPath_clean => CleanSearchString(ShortSearchPath);
// B2021-076: Proms search results are not presented in order when printed to PDF // B2021-076: Proms search results are not presented in order when printed to PDF
internal string _SearchDefaultSort; internal string _SearchDefaultSort;
@@ -3100,6 +3280,24 @@ 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)
@@ -3706,30 +3904,33 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region IVEReadOnlyItem #region IVEReadOnlyItem
PartInfoList _PartInfoList;
public System.Collections.IList GetChildren() public System.Collections.IList GetChildren()
{ {
_PartInfoList = this.MyContent.ContentParts; using (PartInfoList _PartInfoList = this.MyContent.ContentParts)
if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps"))
return _PartInfoList[0].GetChildren();
return _PartInfoList;
}
public System.Collections.IList GetChildren(bool allParts)
{
_PartInfoList = this.MyContent.ContentParts;
if (allParts)
{ {
if (_PartInfoList.Count == 1 && ((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 }
{ public System.Collections.IList GetChildren(bool allParts)
for (int i = 0; i < _PartInfoList.Count; i++) {
if (_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps") using (PartInfoList _PartInfoList = this.MyContent.ContentParts)
return _PartInfoList[i].GetChildren(); {
return null; if (allParts)
{
if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps"))
return _PartInfoList[0].GetChildren();
return _PartInfoList;
}
else // Steps and Sections only
{
for (int i = 0; i < _PartInfoList.Count; i++)
if (_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps")
return _PartInfoList[i].GetChildren();
return null;
}
} }
} }
//public bool ChildrenAreLoaded //public bool ChildrenAreLoaded
@@ -4252,7 +4453,7 @@ namespace VEPROMS.CSLA.Library
tstr = tbformat.Replace("{!.+?}", " "); // Comanche Peak Indented Paragraph tstr = tbformat.Replace("{!.+?}", " "); // Comanche Peak Indented Paragraph
_MyTab.Text = tstr; _MyTab.Text = tstr;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled)
{ {
if (tstr.StartsWith(" ")) if (tstr.StartsWith(" "))
tstr = tstr.Substring(1); tstr = tstr.Substring(1);
@@ -4350,7 +4551,7 @@ namespace VEPROMS.CSLA.Library
{ {
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub; string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub;
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_"))
{ {
if (tstr.StartsWith(" ")) if (tstr.StartsWith(" "))
tstr = tstr.Substring(1); tstr = tstr.Substring(1);
@@ -4367,7 +4568,7 @@ namespace VEPROMS.CSLA.Library
{ {
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub + " "; string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub + " ";
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_"))
{ {
if (tstr.StartsWith(" ")) if (tstr.StartsWith(" "))
tstr = tstr.Substring(1); tstr = tstr.Substring(1);
@@ -4383,7 +4584,7 @@ namespace VEPROMS.CSLA.Library
string tmprnotab = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.CleanText.IndexOf(".") + 1) + incSub; string tmprnotab = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.CleanText.IndexOf(".") + 1) + incSub;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
tmprnotab = tmprnotab.TrimStart(); tmprnotab = tmprnotab.TrimStart();
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tmprnotab.StartsWith("_")) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tmprnotab.StartsWith("_"))
{ {
if (tmprnotab.StartsWith(" ")) if (tmprnotab.StartsWith(" "))
tmprnotab = tmprnotab.Substring(1); tmprnotab = tmprnotab.Substring(1);
@@ -4401,7 +4602,7 @@ namespace VEPROMS.CSLA.Library
_MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText; _MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText;
_MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text; _MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text;
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !_MyTab.CleanText.StartsWith("_")) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !_MyTab.CleanText.StartsWith("_"))
{ {
if (_MyTab.CleanText.StartsWith(" ")) if (_MyTab.CleanText.StartsWith(" "))
_MyTab.CleanText = _MyTab.CleanText.Substring(1); _MyTab.CleanText = _MyTab.CleanText.Substring(1);
@@ -4749,7 +4950,7 @@ namespace VEPROMS.CSLA.Library
// Note could have modified logic for clock macro (above) but older logic uses the IdentEdit setting // Note could have modified logic for clock macro (above) but older logic uses the IdentEdit setting
// for CAS (Continuous Action Summary steps) that have a circle printed around the step number // for CAS (Continuous Action Summary steps) that have a circle printed around the step number
// this is the least impact of current code/formats // this is the least impact of current code/formats
if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag)) if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag))
{ {
int eidx = tbformat.IndexOf("}", macroindx); int eidx = tbformat.IndexOf("}", macroindx);
if (eidx > -1) if (eidx > -1)
@@ -4772,12 +4973,14 @@ namespace VEPROMS.CSLA.Library
} }
} }
//CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line
else if (macroindx == -1 && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) else if (macroindx == -1 && !string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled)
{ {
if (cltext == null) if (cltext == null)
cltext = tbformat; cltext = tbformat;
if (cltext.StartsWith(" ")) if (cltext.StartsWith(" "))
cltext = cltext.Substring(1); cltext = cltext.Substring(1);
if (tbformat.StartsWith(" "))
tbformat = tbformat.Substring(1);
cltext = FormatStepData.TabData.MacroEditTag + cltext; cltext = FormatStepData.TabData.MacroEditTag + cltext;
} }
} }
@@ -5586,7 +5789,7 @@ namespace VEPROMS.CSLA.Library
} }
//CSM F2024 - 080: For South Texas - if initial line is disabled for this step, do not add the macro //CSM F2024 - 080: For South Texas - if initial line is disabled for this step, do not add the macro
if (macro.Name.ToUpper() == "CHECKOFF" && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroEditTag == "_" && IsInitialLineDisabled) if (macro.Name.ToUpper() == "CHECKOFF" && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroEditTag == "_" && IsInitialLineDisabled)
addToList = false; addToList = false;
if (addToList) tmp.Add(macro); if (addToList) tmp.Add(macro);
@@ -6026,8 +6229,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new MoveItemCriteria(itemID, index)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new MoveItemCriteria(itemID, index)))
return tmp; { return tmp; }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6039,13 +6242,15 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListCriteria(itemID, type)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListCriteria(itemID, type)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList tmp.AddEvents();
ContentInfoList.GetList(itemID); // Performance - Load All Content #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#endif ContentInfoList.GetList(itemID); // Performance - Load All Content
return tmp; #endif
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6056,13 +6261,16 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranToListCriteria()); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranToListCriteria()))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList tmp.AddEvents();
ContentInfoList.GetList(itemID); // Performance - Load All Content #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#endif ContentInfoList.GetList(itemID); // Performance - Load All Content
return tmp; #endif
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6073,13 +6281,15 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranFromListCriteria()); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemTranFromListCriteria()))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList tmp.AddEvents();
ContentInfoList.GetList(itemID); // Performance - Load All Content #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#endif ContentInfoList.GetList(itemID); // Performance - Load All Content
return tmp; #endif
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6090,19 +6300,183 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListPartTypeCriteria(fromType)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListPartTypeCriteria(fromType)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList tmp.AddEvents();
ContentInfoList.GetList(itemID); // Performance - Load All Content #if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList
#endif ContentInfoList.GetList(itemID); // Performance - Load All Content
return tmp; #endif
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
{ {
@@ -6419,8 +6793,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedTextDifferencesCriteria(procItem.ItemID)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedTextDifferencesCriteria(procItem.ItemID)))
return tmp; { return tmp; }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6488,8 +6862,8 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedMissingCriteria(srcItem.ItemID, enhType)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListEnhancedMissingCriteria(srcItem.ItemID, enhType)))
return tmp; { return tmp; }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6558,11 +6932,13 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, byWordPrefix, byWordSuffix)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, byWordPrefix, byWordSuffix)))
tmp.SourceOfList = "Search"; {
ItemInfo.AddList(tmp); tmp.SourceOfList = "Search";
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6717,10 +7093,12 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6821,10 +7199,12 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive, unitPrefix)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive, unitPrefix)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -6945,10 +7325,12 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListTransitionSearchCriteria(docVersionList, tranType, tranCategory, stepTypeList)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListTransitionSearchCriteria(docVersionList, tranType, tranCategory, stepTypeList)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7034,10 +7416,12 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROReportCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListROReportCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix)))
ItemInfo.AddList(tmp); {
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7139,11 +7523,13 @@ namespace VEPROMS.CSLA.Library
{ {
try try
{ {
ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListApplicabilitySearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, applicSetting)); using (ItemInfoList tmp = DataPortal.Fetch<ItemInfoList>(new ItemListApplicabilitySearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, applicSetting)))
tmp.SourceOfList = "Search"; {
ItemInfo.AddList(tmp); tmp.SourceOfList = "Search";
tmp.AddEvents(); ItemInfo.AddList(tmp);
return tmp; tmp.AddEvents();
return tmp;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -7278,11 +7664,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;
@@ -7793,27 +8179,30 @@ 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.
// from sql list, get display text of source items & compare to this procedure's items. This using (ItemInfoList iil = ItemInfoList.GetListEnhancedTextDifferences(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 (iil == null || iil.Count == 0) return null; // no differences were found.
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)
{ {
@@ -8126,97 +8515,7 @@ 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,97 +2650,174 @@ 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 desintation types and display message box if needed // B2016-009 check source and destination 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;
try using (ItemInfo copyItemInfo = ItemInfo.Get(copyStartID))
{ {
// C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query try
if (itemInfo.IsEnhancedStep)
{ {
newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo); // C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query
if (newItemInfo == null) return null; if (itemInfo.IsEnhancedStep)
{
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;
}
} }
else catch (Exception ex1)
{ {
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); if (newItemInfo == null) return null; if (ex1.Message.Contains("has External Transitions and has no next step")
}
}
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); 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; return null;
}
} }
} try
try {
{ // Delete business objects, including remove from tree
// Delete business objects, including remove from tree ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children
ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item);
using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item); ItemInfo.PasteSetChangeId(newItemInfo, chgid);
ItemInfo.PasteSetChangeId(newItemInfo, chgid); if (!copyItemInfo.HasEnhancedLinkedStep && !itemInfo.HasEnhancedLinkedStep) ItemInfo.PasteClearEnhanced(newItemInfo);
ItemInfo.PasteClearEnhanced(newItemInfo); if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item);
if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item); newItemInfo.RefreshNextItems();
newItemInfo.RefreshNextItems(); // if inserting after a caution or note, refreshes tabs. This will adjust bullets
// if inserting after a caution or note, refreshes tabs. This will adjust bullets // of any previous cautions or notes.
// of any previous cautions or notes. if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal();
if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal(); newItemInfo.UpdateTransitionText();
newItemInfo.UpdateTransitionText(); newItemInfo.UpdateROText();
newItemInfo.UpdateROText(); newItemInfo.UpdatePastedStepTransitionText();
newItemInfo.UpdatePastedStepTransitionText();
// Add to tree // Add to tree
if (newItemInfo.NextItem != null) if (newItemInfo.NextItem != null)
{
using (ItemInfo itm = ItemInfo.GetNonCached(newItemInfo.NextItem.ItemID))
{ {
itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before)); using (ItemInfo itm = ItemInfo.GetNonCached(newItemInfo.NextItem.ItemID))
{
itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before));
}
} }
} else if (newItemInfo.PreviousID != null)
else if (newItemInfo.PreviousID != null)
{
using (ItemInfo itm2 = ItemInfo.GetNonCached((int)newItemInfo.PreviousID))
{ {
itm2.OnNewSiblingAfter(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.After)); 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;
} }
else catch (Exception ex)
{ {
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single ItemInfo iii = itemInfo.HandleSqlExceptionOnDelete(ex);
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo. if (iii == itemInfo) return null;// If self returned then return null
// For the single procedure case, the user interface code in vlntreeview will update the tree. if (iii != null)
if (newItemInfo.MyParent != null) {
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child)); 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;
} }
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,7 +84,6 @@ 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,7 +80,6 @@ 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,6 +2173,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
#endregion #endregion
#region CheckOff #region CheckOff
[TypeConverter(typeof(ExpandableObjectConverter))] [TypeConverter(typeof(ExpandableObjectConverter))]
@@ -2284,6 +2285,49 @@ 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>
@@ -6213,6 +6257,36 @@ 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,7 +108,6 @@ 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,7 +117,6 @@ 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;
} }
@@ -129,14 +127,12 @@ 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;
@@ -151,7 +147,6 @@ 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;
} }
@@ -162,14 +157,12 @@ 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;
@@ -184,13 +177,11 @@ 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)
{ {
@@ -205,13 +196,11 @@ 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)
{ {
@@ -226,13 +215,11 @@ 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)
{ {
@@ -247,13 +234,11 @@ 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;
@@ -267,13 +252,11 @@ 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,7 +106,6 @@ 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;
} }
} }
@@ -116,13 +115,11 @@ 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;
@@ -136,13 +133,11 @@ 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;
@@ -156,13 +151,11 @@ 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;
@@ -176,13 +169,11 @@ 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)
{ {
@@ -197,13 +188,11 @@ 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)
{ {
@@ -218,13 +207,11 @@ 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)
{ {
@@ -239,13 +226,11 @@ 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;
@@ -259,13 +244,11 @@ 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)
{ {
@@ -280,13 +263,11 @@ 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,7 +96,6 @@ 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;
} }
} }
@@ -106,7 +105,6 @@ 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;
} }
} }
@@ -116,7 +114,6 @@ 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;
} }
} }
@@ -126,7 +123,6 @@ 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;
} }
} }
@@ -136,7 +132,6 @@ 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;
} }
} }
@@ -146,7 +141,6 @@ 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;
} }
} }
@@ -156,7 +150,6 @@ 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;
} }
} }
@@ -166,7 +159,6 @@ 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;
} }
} }
@@ -176,7 +168,6 @@ 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;
} }
} }
@@ -186,7 +177,6 @@ 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,7 +109,6 @@ 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;
} }
} }
@@ -119,7 +118,6 @@ 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;
} }
@@ -130,7 +128,6 @@ 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;
} }
@@ -141,7 +138,6 @@ 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;
} }
@@ -152,7 +148,6 @@ 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;
} }
@@ -163,7 +158,6 @@ 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;
} }
} }
@@ -173,7 +167,6 @@ 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;
} }
} }
@@ -183,7 +176,6 @@ 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;
} }
} }
@@ -193,7 +185,6 @@ 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;
} }
} }
@@ -203,7 +194,6 @@ 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,7 +129,6 @@ 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;
} }
} }
@@ -139,13 +138,11 @@ 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)
{ {
@@ -160,13 +157,11 @@ 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)
{ {
@@ -181,13 +176,11 @@ 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;
@@ -201,13 +194,11 @@ 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)
{ {
@@ -226,7 +217,6 @@ 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;
} }
} }
@@ -240,7 +230,6 @@ 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,7 +43,6 @@ 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;
} }
@@ -55,7 +54,6 @@ 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;
} }
@@ -66,7 +64,6 @@ 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;
} }
@@ -77,14 +74,12 @@ 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;
@@ -99,13 +94,11 @@ 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)
{ {
@@ -120,13 +113,11 @@ 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)
{ {
@@ -141,13 +132,11 @@ 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)
{ {
@@ -162,13 +151,11 @@ 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;
@@ -182,13 +169,11 @@ 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)
{ {
@@ -204,7 +189,6 @@ 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;
} }
} }
@@ -214,7 +198,6 @@ 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;
} }
} }
@@ -224,7 +207,6 @@ 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;
} }
} }
@@ -234,7 +216,6 @@ 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,7 +96,6 @@ 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;
} }
} }
@@ -106,7 +105,6 @@ 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;
} }
} }
@@ -116,7 +114,6 @@ 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;
} }
} }
@@ -126,7 +123,6 @@ 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;
} }
} }
@@ -136,7 +132,6 @@ 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;
} }
} }
@@ -149,7 +144,6 @@ 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;
@@ -162,7 +156,6 @@ 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,7 +109,6 @@ 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;
} }
} }
@@ -119,7 +118,6 @@ 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;
} }
@@ -130,14 +128,12 @@ 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;
@@ -152,7 +148,6 @@ 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;
} }
@@ -163,14 +158,12 @@ 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;
@@ -185,7 +178,6 @@ 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;
} }
@@ -196,14 +188,12 @@ 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;
@@ -218,13 +208,11 @@ 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
@@ -248,13 +236,11 @@ 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
@@ -278,13 +264,11 @@ 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;
@@ -298,13 +282,11 @@ 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,432 +19,424 @@ 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
{ {
CanReadProperty("AssociationID", true); return _AssociationID;
return _AssociationID; }
} }
} private int _VersionID;
private int _VersionID; public int VersionID
public int VersionID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID;
CanReadProperty("VersionID", true); return _VersionID;
if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; }
return _VersionID; }
} private DocVersionInfo _MyDocVersion;
} public DocVersionInfo MyDocVersion
private DocVersionInfo _MyDocVersion; {
public DocVersionInfo MyDocVersion [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersionInfo.Get(_VersionID);
{ return _MyDocVersion;
CanReadProperty("MyDocVersion", true); }
if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersionInfo.Get(_VersionID); }
return _MyDocVersion; private int _ROFstID;
} public int ROFstID
} {
private int _ROFstID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int ROFstID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID;
get return _ROFstID;
{ }
CanReadProperty("ROFstID", true); }
if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; private ROFstInfo _MyROFst;
return _ROFstID; public ROFstInfo MyROFst
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private ROFstInfo _MyROFst; get
public ROFstInfo MyROFst {
{ //if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.GetJustROFst(_ROFstID);// Improve performance by not loading all ROImages
get return _MyROFst;
{ }
CanReadProperty("MyROFst", true); }
//if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); private string _Config = string.Empty;
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.GetJustROFst(_ROFstID);// Improve performance by not loading all ROImages public string Config
return _MyROFst; {
} [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 }
{ // CSLATODO: Replace base AssociationInfo.ToString function as necessary
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Overrides Base ToString
{ /// </summary>
CanReadProperty("UserID", true); /// <returns>A string representation of current AssociationInfo</returns>
return _UserID; //public override string ToString()
} //{
} // return base.ToString();
// CSLATODO: Replace base AssociationInfo.ToString function as necessary //}
/// <summary> // CSLATODO: Check AssociationInfo.GetIdValue to assure that the ID returned is unique
/// Overrides Base ToString /// <summary>
/// </summary> /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// <returns>A string representation of current AssociationInfo</returns> /// </summary>
//public override string ToString() /// <returns>A Unique ID for the current AssociationInfo</returns>
//{ protected override object GetIdValue()
// return base.ToString(); {
//} return MyAssociationInfoUnique; // Absolutely Unique ID
// CSLATODO: Check AssociationInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> #endregion
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality #region Factory Methods
/// </summary> private static int _AssociationInfoUnique = 0;
/// <returns>A Unique ID for the current AssociationInfo</returns> private static int AssociationInfoUnique
protected override object GetIdValue() { get { return ++_AssociationInfoUnique; } }
{ private int _MyAssociationInfoUnique = AssociationInfoUnique;
return MyAssociationInfoUnique; // Absolutely Unique ID public int MyAssociationInfoUnique // Absolutely Unique ID - Info
} { get { return _MyAssociationInfoUnique; } }
#endregion protected AssociationInfo()
#region Factory Methods {/* require use of factory methods */
private static int _AssociationInfoUnique = 0; AddToCache(this);
private static int AssociationInfoUnique }
{ get { return ++_AssociationInfoUnique; } } private bool _Disposed = false;
private int _MyAssociationInfoUnique = AssociationInfoUnique; private static int _CountCreated = 0;
public int MyAssociationInfoUnique // Absolutely Unique ID - Info private static int _CountDisposed = 0;
{ get { return _MyAssociationInfoUnique; } } private static int _CountFinalized = 0;
protected AssociationInfo() private static int IncrementCountCreated
{/* require use of factory methods */ { get { return ++_CountCreated; } }
AddToCache(this); private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
private bool _Disposed = false; { get { return _CountCreated; } }
private static int _CountCreated = 0; public static int CountNotDisposed
private static int _CountDisposed = 0; { get { return _CountCreated - _CountDisposed; } }
private static int _CountFinalized = 0; public static int CountNotFinalized
private static int IncrementCountCreated { get { return _CountCreated - _CountFinalized; } }
{ get { return ++_CountCreated; } } ~AssociationInfo()
private int _CountWhenCreated = IncrementCountCreated; {
public static int CountCreated _CountFinalized++;
{ get { return _CountCreated; } } }
public static int CountNotDisposed public void Dispose()
{ get { return _CountCreated - _CountDisposed; } } {
public static int CountNotFinalized if (_Disposed) return;
{ get { return _CountCreated - _CountFinalized; } } _CountDisposed++;
~AssociationInfo() _Disposed = true;
{ RemoveFromCache(this);
_CountFinalized++; if (!_CacheByPrimaryKey.ContainsKey(AssociationID.ToString())) return;
} List<AssociationInfo> listAssociationInfo = _CacheByPrimaryKey[AssociationID.ToString()]; // Get the list of items
public void Dispose() 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
if (_Disposed) return; _CacheByPrimaryKey.Remove(AssociationID.ToString()); // remove the list
_CountDisposed++; }
_Disposed = true; public virtual Association Get()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(AssociationID.ToString())) return; return _Editable = Association.Get(_AssociationID);
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 static void Refresh(Association tmp)
if (listAssociationInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(AssociationID.ToString()); // remove the list string key = tmp.AssociationID.ToString();
} ConvertListToDictionary();
public virtual Association Get() if (_CacheByPrimaryKey.ContainsKey(key))
{ foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
return _Editable = Association.Get(_AssociationID); tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(Association tmp) protected virtual void RefreshFields(Association tmp)
{ {
string key = tmp.AssociationID.ToString(); if (_VersionID != tmp.VersionID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) _VersionID = tmp.VersionID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyDocVersion = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(Association tmp) if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value
{ if (_ROFstID != tmp.ROFstID)
if (_VersionID != tmp.VersionID) {
{ if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value _ROFstID = tmp.ROFstID; // Update the value
_VersionID = tmp.VersionID; // Update the value }
} _MyROFst = null; // Reset list so that the next line gets a new list
_MyDocVersion = null; // Reset list so that the next line gets a new list if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value _Config = tmp.Config;
if (_ROFstID != tmp.ROFstID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value _AssociationInfoExtension.Refresh(this);
_ROFstID = tmp.ROFstID; // Update the value OnChange();// raise an event
} }
_MyROFst = null; // Reset list so that the next line gets a new list public static void Refresh(DocVersionAssociation tmp)
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value {
_Config = tmp.Config; string key = tmp.AssociationID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_AssociationInfoExtension.Refresh(this); foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(DocVersionAssociation tmp) protected virtual void RefreshFields(DocVersionAssociation tmp)
{ {
string key = tmp.AssociationID.ToString(); if (_ROFstID != tmp.ROFstID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) _ROFstID = tmp.ROFstID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyROFst = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(DocVersionAssociation tmp) if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value
{ _Config = tmp.Config;
if (_ROFstID != tmp.ROFstID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for old value _AssociationInfoExtension.Refresh(this);
_ROFstID = tmp.ROFstID; // Update the value OnChange();// raise an event
} }
_MyROFst = null; // Reset list so that the next line gets a new list public static void Refresh(ROFstAssociation tmp)
if (MyROFst != null) MyROFst.RefreshROFstAssociations(); // Update List for new value {
_Config = tmp.Config; string key = tmp.AssociationID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_AssociationInfoExtension.Refresh(this); foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(ROFstAssociation tmp) protected virtual void RefreshFields(ROFstAssociation tmp)
{ {
string key = tmp.AssociationID.ToString(); if (_VersionID != tmp.VersionID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value
foreach (AssociationInfo tmpInfo in _CacheByPrimaryKey[key]) _VersionID = tmp.VersionID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyDocVersion = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(ROFstAssociation tmp) if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value
{ _Config = tmp.Config;
if (_VersionID != tmp.VersionID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for old value _AssociationInfoExtension.Refresh(this);
_VersionID = tmp.VersionID; // Update the value OnChange();// raise an event
} }
_MyDocVersion = null; // Reset list so that the next line gets a new list public static AssociationInfo Get(int associationID)
if (MyDocVersion != null) MyDocVersion.RefreshDocVersionAssociations(); // Update List for new value {
_Config = tmp.Config; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a Association");
_UserID = tmp.UserID; try
_AssociationInfoExtension.Refresh(this); {
OnChange();// raise an event AssociationInfo tmp = GetCachedByPrimaryKey(associationID);
} if (tmp == null)
public static AssociationInfo Get(int associationID) {
{ tmp = DataPortal.Fetch<AssociationInfo>(new PKCriteria(associationID));
//if (!CanGetObject()) AddToCache(tmp);
// throw new System.Security.SecurityException("User not authorized to view a Association"); }
try if (tmp.ErrorMessage == "No Record Found")
{ {
AssociationInfo tmp = GetCachedByPrimaryKey(associationID); tmp.Dispose(); // Clean-up AssociationInfo
if (tmp == null) tmp = null;
{ }
tmp = DataPortal.Fetch<AssociationInfo>(new PKCriteria(associationID)); return tmp;
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
return tmp; #region Data Access Portal
} internal AssociationInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.Constructor", GetHashCode());
throw new DbCslaException("Error on AssociationInfo.Get", ex); try
} {
} ReadData(dr);
#endregion }
#region Data Access Portal catch (Exception ex)
internal AssociationInfo(SafeDataReader dr) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.Constructor", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.Constructor", GetHashCode()); throw new DbCslaException("AssociationInfo.Constructor", ex);
try }
{ }
ReadData(dr); [Serializable()]
} protected class PKCriteria
catch (Exception ex) {
{ private int _AssociationID;
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.Constructor", ex); public int AssociationID
throw new DbCslaException("AssociationInfo.Constructor", ex); { get { return _AssociationID; } }
} public PKCriteria(int associationID)
} {
[Serializable()] _AssociationID = associationID;
protected class PKCriteria }
{ }
private int _AssociationID; private void ReadData(SafeDataReader dr)
public int AssociationID {
{ get { return _AssociationID; } } if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.ReadData", GetHashCode());
public PKCriteria(int associationID) try
{ {
_AssociationID = associationID; _AssociationID = dr.GetInt32("AssociationID");
} _VersionID = dr.GetInt32("VersionID");
} _ROFstID = dr.GetInt32("ROFstID");
private void ReadData(SafeDataReader dr) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.ReadData", GetHashCode()); _UserID = dr.GetString("UserID");
try }
{ catch (Exception ex)
_AssociationID = dr.GetInt32("AssociationID"); {
_VersionID = dr.GetInt32("VersionID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.ReadData", ex);
_ROFstID = dr.GetInt32("ROFstID"); _ErrorMessage = ex.Message;
_Config = dr.GetString("Config"); throw new DbCslaException("AssociationInfo.ReadData", ex);
_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());
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.ReadData", ex); try
_ErrorMessage = ex.Message; {
throw new DbCslaException("AssociationInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
} {
} ApplicationContext.LocalContext["cn"] = cn;
private void DataPortal_Fetch(PKCriteria criteria) using (SqlCommand cm = cn.CreateCommand())
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssociationInfo.DataPortal_Fetch", GetHashCode()); cm.CommandType = CommandType.StoredProcedure;
try cm.CommandText = "getAssociation";
{ cm.Parameters.AddWithValue("@AssociationID", criteria.AssociationID);
using (SqlConnection cn = Database.VEPROMS_SqlConnection) cm.CommandTimeout = Database.DefaultTimeout;
{ using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ApplicationContext.LocalContext["cn"] = cn; {
using (SqlCommand cm = cn.CreateCommand()) if (!dr.Read())
{ {
cm.CommandType = CommandType.StoredProcedure; _ErrorMessage = "No Record Found";
cm.CommandText = "getAssociation"; return;
cm.Parameters.AddWithValue("@AssociationID", criteria.AssociationID); }
cm.CommandTimeout = Database.DefaultTimeout; ReadData(dr);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) }
{ }
if (!dr.Read()) // removing of item only needed for local data portal
{ if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
_ErrorMessage = "No Record Found"; ApplicationContext.LocalContext.Remove("cn");
return; }
} }
ReadData(dr); catch (Exception ex)
} {
} if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.DataPortal_Fetch", ex);
// removing of item only needed for local data portal _ErrorMessage = ex.Message;
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) throw new DbCslaException("AssociationInfo.DataPortal_Fetch", ex);
ApplicationContext.LocalContext.Remove("cn"); }
} }
} #endregion
catch (Exception ex) // Standard Refresh
{ #region extension
if (_MyLog.IsErrorEnabled) _MyLog.Error("AssociationInfo.DataPortal_Fetch", ex); AssociationInfoExtension _AssociationInfoExtension = new AssociationInfoExtension();
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("AssociationInfo.DataPortal_Fetch", ex); partial class AssociationInfoExtension : extensionBase { }
} [Serializable()]
} class extensionBase
#endregion {
// Standard Refresh // Default Refresh
#region extension public virtual void Refresh(AssociationInfo tmp) { }
AssociationInfoExtension _AssociationInfoExtension = new AssociationInfoExtension(); }
[Serializable()] #endregion
partial class AssociationInfoExtension : extensionBase { } } // Class
[Serializable()] #region Converter
class extensionBase internal class AssociationInfoConverter : ExpandableObjectConverter
{ {
// Default Refresh public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
public virtual void Refresh(AssociationInfo tmp) { } {
} if (destType == typeof(string) && value is AssociationInfo)
#endregion {
} // Class // Return the ToString value
#region Converter return ((AssociationInfo)value).ToString();
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) }
{ }
if (destType == typeof(string) && value is AssociationInfo) #endregion
{
// 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,431 +19,423 @@ 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
{ {
CanReadProperty("CheckID", true); return _CheckID;
return _CheckID; }
} }
} private int _RevisionID;
private int _RevisionID; public int RevisionID
public int RevisionID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyRevision != null) _RevisionID = _MyRevision.RevisionID;
CanReadProperty("RevisionID", true); return _RevisionID;
if (_MyRevision != null) _RevisionID = _MyRevision.RevisionID; }
return _RevisionID; }
} private RevisionInfo _MyRevision;
} public RevisionInfo MyRevision
private RevisionInfo _MyRevision; {
public RevisionInfo MyRevision [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_MyRevision == null && _RevisionID != 0) _MyRevision = RevisionInfo.Get(_RevisionID);
{ return _MyRevision;
CanReadProperty("MyRevision", true); }
if (_MyRevision == null && _RevisionID != 0) _MyRevision = RevisionInfo.Get(_RevisionID); }
return _MyRevision; private int _StageID;
} public int StageID
} {
private int _StageID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int StageID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyStage != null) _StageID = _MyStage.StageID;
get return _StageID;
{ }
CanReadProperty("StageID", true); }
if (_MyStage != null) _StageID = _MyStage.StageID; private StageInfo _MyStage;
return _StageID; public StageInfo MyStage
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private StageInfo _MyStage; get
public StageInfo MyStage {
{ if (_MyStage == null && _StageID != 0) _MyStage = StageInfo.GetJustStage(_StageID);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _MyStage;
get }
{ }
CanReadProperty("MyStage", true); private string _ConsistencyChecks = string.Empty;
if (_MyStage == null && _StageID != 0) _MyStage = StageInfo.GetJustStage(_StageID); public string ConsistencyChecks
return _MyStage; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _ConsistencyChecks = string.Empty; {
public string ConsistencyChecks return _ConsistencyChecks;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private DateTime _DTS = new DateTime();
{ public DateTime DTS
CanReadProperty("ConsistencyChecks", true); {
return _ConsistencyChecks; [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 }
{ // CSLATODO: Replace base CheckInfo.ToString function as necessary
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Overrides Base ToString
{ /// </summary>
CanReadProperty("UserID", true); /// <returns>A string representation of current CheckInfo</returns>
return _UserID; //public override string ToString()
} //{
} // return base.ToString();
// CSLATODO: Replace base CheckInfo.ToString function as necessary //}
/// <summary> // CSLATODO: Check CheckInfo.GetIdValue to assure that the ID returned is unique
/// Overrides Base ToString /// <summary>
/// </summary> /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// <returns>A string representation of current CheckInfo</returns> /// </summary>
//public override string ToString() /// <returns>A Unique ID for the current CheckInfo</returns>
//{ protected override object GetIdValue()
// return base.ToString(); {
//} return MyCheckInfoUnique; // Absolutely Unique ID
// CSLATODO: Check CheckInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> #endregion
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality #region Factory Methods
/// </summary> private static int _CheckInfoUnique = 0;
/// <returns>A Unique ID for the current CheckInfo</returns> private static int CheckInfoUnique
protected override object GetIdValue() { get { return ++_CheckInfoUnique; } }
{ private int _MyCheckInfoUnique = CheckInfoUnique;
return MyCheckInfoUnique; // Absolutely Unique ID public int MyCheckInfoUnique // Absolutely Unique ID - Info
} { get { return _MyCheckInfoUnique; } }
#endregion protected CheckInfo()
#region Factory Methods {/* require use of factory methods */
private static int _CheckInfoUnique = 0; AddToCache(this);
private static int CheckInfoUnique }
{ get { return ++_CheckInfoUnique; } } private bool _Disposed = false;
private int _MyCheckInfoUnique = CheckInfoUnique; private static int _CountCreated = 0;
public int MyCheckInfoUnique // Absolutely Unique ID - Info private static int _CountDisposed = 0;
{ get { return _MyCheckInfoUnique; } } private static int _CountFinalized = 0;
protected CheckInfo() private static int IncrementCountCreated
{/* require use of factory methods */ { get { return ++_CountCreated; } }
AddToCache(this); private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
private bool _Disposed = false; { get { return _CountCreated; } }
private static int _CountCreated = 0; public static int CountNotDisposed
private static int _CountDisposed = 0; { get { return _CountCreated - _CountDisposed; } }
private static int _CountFinalized = 0; public static int CountNotFinalized
private static int IncrementCountCreated { get { return _CountCreated - _CountFinalized; } }
{ get { return ++_CountCreated; } } ~CheckInfo()
private int _CountWhenCreated = IncrementCountCreated; {
public static int CountCreated _CountFinalized++;
{ get { return _CountCreated; } } }
public static int CountNotDisposed public void Dispose()
{ get { return _CountCreated - _CountDisposed; } } {
public static int CountNotFinalized if (_Disposed) return;
{ get { return _CountCreated - _CountFinalized; } } _CountDisposed++;
~CheckInfo() _Disposed = true;
{ RemoveFromCache(this);
_CountFinalized++; if (!_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) return;
} List<CheckInfo> listCheckInfo = _CacheByPrimaryKey[CheckID.ToString()]; // Get the list of items
public void Dispose() 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
if (_Disposed) return; _CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list
_CountDisposed++; }
_Disposed = true; public virtual Check Get()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) return; return _Editable = Check.Get(_CheckID);
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 static void Refresh(Check tmp)
if (listCheckInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list string key = tmp.CheckID.ToString();
} ConvertListToDictionary();
public virtual Check Get() if (_CacheByPrimaryKey.ContainsKey(key))
{ foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
return _Editable = Check.Get(_CheckID); tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(Check tmp) protected virtual void RefreshFields(Check tmp)
{ {
string key = tmp.CheckID.ToString(); if (_RevisionID != tmp.RevisionID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) _RevisionID = tmp.RevisionID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyRevision = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(Check tmp) if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value
{ if (_StageID != tmp.StageID)
if (_RevisionID != tmp.RevisionID) {
{ if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value _StageID = tmp.StageID; // Update the value
_RevisionID = tmp.RevisionID; // Update the value }
} _MyStage = null; // Reset list so that the next line gets a new list
_MyRevision = null; // Reset list so that the next line gets a new list if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value _ConsistencyChecks = tmp.ConsistencyChecks;
if (_StageID != tmp.StageID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value _CheckInfoExtension.Refresh(this);
_StageID = tmp.StageID; // Update the value OnChange();// raise an event
} }
_MyStage = null; // Reset list so that the next line gets a new list public static void Refresh(RevisionCheck tmp)
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value {
_ConsistencyChecks = tmp.ConsistencyChecks; string key = tmp.CheckID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_CheckInfoExtension.Refresh(this); foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(RevisionCheck tmp) protected virtual void RefreshFields(RevisionCheck tmp)
{ {
string key = tmp.CheckID.ToString(); if (_StageID != tmp.StageID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) _StageID = tmp.StageID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyStage = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(RevisionCheck tmp) if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value
{ _ConsistencyChecks = tmp.ConsistencyChecks;
if (_StageID != tmp.StageID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for old value _CheckInfoExtension.Refresh(this);
_StageID = tmp.StageID; // Update the value OnChange();// raise an event
} }
_MyStage = null; // Reset list so that the next line gets a new list public static void Refresh(StageCheck tmp)
if (MyStage != null) MyStage.RefreshStageChecks(); // Update List for new value {
_ConsistencyChecks = tmp.ConsistencyChecks; string key = tmp.CheckID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_CheckInfoExtension.Refresh(this); foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(StageCheck tmp) protected virtual void RefreshFields(StageCheck tmp)
{ {
string key = tmp.CheckID.ToString(); if (_RevisionID != tmp.RevisionID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value
foreach (CheckInfo tmpInfo in _CacheByPrimaryKey[key]) _RevisionID = tmp.RevisionID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyRevision = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(StageCheck tmp) if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value
{ _ConsistencyChecks = tmp.ConsistencyChecks;
if (_RevisionID != tmp.RevisionID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for old value _CheckInfoExtension.Refresh(this);
_RevisionID = tmp.RevisionID; // Update the value OnChange();// raise an event
} }
_MyRevision = null; // Reset list so that the next line gets a new list public static CheckInfo Get(int checkID)
if (MyRevision != null) MyRevision.RefreshRevisionChecks(); // Update List for new value {
_ConsistencyChecks = tmp.ConsistencyChecks; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a Check");
_UserID = tmp.UserID; try
_CheckInfoExtension.Refresh(this); {
OnChange();// raise an event CheckInfo tmp = GetCachedByPrimaryKey(checkID);
} if (tmp == null)
public static CheckInfo Get(int checkID) {
{ tmp = DataPortal.Fetch<CheckInfo>(new PKCriteria(checkID));
//if (!CanGetObject()) AddToCache(tmp);
// throw new System.Security.SecurityException("User not authorized to view a Check"); }
try if (tmp.ErrorMessage == "No Record Found")
{ {
CheckInfo tmp = GetCachedByPrimaryKey(checkID); tmp.Dispose(); // Clean-up CheckInfo
if (tmp == null) tmp = null;
{ }
tmp = DataPortal.Fetch<CheckInfo>(new PKCriteria(checkID)); return tmp;
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
return tmp; #region Data Access Portal
} internal CheckInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.Constructor", GetHashCode());
throw new DbCslaException("Error on CheckInfo.Get", ex); try
} {
} ReadData(dr);
#endregion }
#region Data Access Portal catch (Exception ex)
internal CheckInfo(SafeDataReader dr) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.Constructor", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.Constructor", GetHashCode()); throw new DbCslaException("CheckInfo.Constructor", ex);
try }
{ }
ReadData(dr); [Serializable()]
} protected class PKCriteria
catch (Exception ex) {
{ private int _CheckID;
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.Constructor", ex); public int CheckID
throw new DbCslaException("CheckInfo.Constructor", ex); { get { return _CheckID; } }
} public PKCriteria(int checkID)
} {
[Serializable()] _CheckID = checkID;
protected class PKCriteria }
{ }
private int _CheckID; private void ReadData(SafeDataReader dr)
public int CheckID {
{ get { return _CheckID; } } if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.ReadData", GetHashCode());
public PKCriteria(int checkID) try
{ {
_CheckID = checkID; _CheckID = dr.GetInt32("CheckID");
} _RevisionID = dr.GetInt32("RevisionID");
} _StageID = dr.GetInt32("StageID");
private void ReadData(SafeDataReader dr) _ConsistencyChecks = dr.GetString("ConsistencyChecks");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.ReadData", GetHashCode()); _UserID = dr.GetString("UserID");
try }
{ catch (Exception ex)
_CheckID = dr.GetInt32("CheckID"); {
_RevisionID = dr.GetInt32("RevisionID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.ReadData", ex);
_StageID = dr.GetInt32("StageID"); _ErrorMessage = ex.Message;
_ConsistencyChecks = dr.GetString("ConsistencyChecks"); throw new DbCslaException("CheckInfo.ReadData", ex);
_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());
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.ReadData", ex); try
_ErrorMessage = ex.Message; {
throw new DbCslaException("CheckInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
} {
} ApplicationContext.LocalContext["cn"] = cn;
private void DataPortal_Fetch(PKCriteria criteria) using (SqlCommand cm = cn.CreateCommand())
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CheckInfo.DataPortal_Fetch", GetHashCode()); cm.CommandType = CommandType.StoredProcedure;
try cm.CommandText = "getCheck";
{ cm.Parameters.AddWithValue("@CheckID", criteria.CheckID);
using (SqlConnection cn = Database.VEPROMS_SqlConnection) cm.CommandTimeout = Database.DefaultTimeout;
{ using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ApplicationContext.LocalContext["cn"] = cn; {
using (SqlCommand cm = cn.CreateCommand()) if (!dr.Read())
{ {
cm.CommandType = CommandType.StoredProcedure; _ErrorMessage = "No Record Found";
cm.CommandText = "getCheck"; return;
cm.Parameters.AddWithValue("@CheckID", criteria.CheckID); }
cm.CommandTimeout = Database.DefaultTimeout; ReadData(dr);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) }
{ }
if (!dr.Read()) // removing of item only needed for local data portal
{ if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
_ErrorMessage = "No Record Found"; ApplicationContext.LocalContext.Remove("cn");
return; }
} }
ReadData(dr); catch (Exception ex)
} {
} if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.DataPortal_Fetch", ex);
// removing of item only needed for local data portal _ErrorMessage = ex.Message;
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) throw new DbCslaException("CheckInfo.DataPortal_Fetch", ex);
ApplicationContext.LocalContext.Remove("cn"); }
} }
} #endregion
catch (Exception ex) // Standard Refresh
{ #region extension
if (_MyLog.IsErrorEnabled) _MyLog.Error("CheckInfo.DataPortal_Fetch", ex); CheckInfoExtension _CheckInfoExtension = new CheckInfoExtension();
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("CheckInfo.DataPortal_Fetch", ex); partial class CheckInfoExtension : extensionBase { }
} [Serializable()]
} class extensionBase
#endregion {
// Standard Refresh // Default Refresh
#region extension public virtual void Refresh(CheckInfo tmp) { }
CheckInfoExtension _CheckInfoExtension = new CheckInfoExtension(); }
[Serializable()] #endregion
partial class CheckInfoExtension : extensionBase { } } // Class
[Serializable()] #region Converter
class extensionBase internal class CheckInfoConverter : ExpandableObjectConverter
{ {
// Default Refresh public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
public virtual void Refresh(CheckInfo tmp) { } {
} if (destType == typeof(string) && value is CheckInfo)
#endregion {
} // Class // Return the ToString value
#region Converter return ((CheckInfo)value).ToString();
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) }
{ }
if (destType == typeof(string) && value is CheckInfo) #endregion
{
// 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,415 +19,405 @@ 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
{ {
CanReadProperty("DBID", true); return _DBID;
return _DBID; }
} }
} private string _Name = string.Empty;
private string _Name = string.Empty; public string Name
public string Name {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ return _Name;
CanReadProperty("Name", true); }
return _Name; }
} private string _Title = string.Empty;
} public string Title
private string _Title = string.Empty; {
public string Title [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _Title;
{ }
CanReadProperty("Title", true); }
return _Title; private string _ConnectionString = string.Empty;
} public string ConnectionString
} {
private string _ConnectionString = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string ConnectionString get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _ConnectionString;
get }
{ }
CanReadProperty("ConnectionString", true); private int _ServerType;
return _ConnectionString; /// <summary>
} /// 0 SQL Server
} /// </summary>
private int _ServerType; public int ServerType
/// <summary> {
/// 0 SQL Server [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// </summary> get
public int ServerType {
{ return _ServerType;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _Config = string.Empty;
CanReadProperty("ServerType", true); public string Config
return _ServerType; {
} [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 _UsrID = string.Empty;
get public string UsrID
{ {
CanReadProperty("DTS", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _DTS; get
} {
} return _UsrID;
private string _UsrID = string.Empty; }
public string UsrID }
{ private int _ConnectionFolderCount = 0;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Count of ConnectionFolders for this Connection
{ /// </summary>
CanReadProperty("UsrID", true); public int ConnectionFolderCount
return _UsrID; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int _ConnectionFolderCount = 0; {
/// <summary> if (_ConnectionFolderCount < 0)
/// Count of ConnectionFolders for this Connection _ConnectionFolderCount = ConnectionFolders.Count;
/// </summary> return _ConnectionFolderCount;
public int ConnectionFolderCount }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private FolderInfoList _ConnectionFolders = null;
get [TypeConverter(typeof(FolderInfoListConverter))]
{ public FolderInfoList ConnectionFolders
CanReadProperty("ConnectionFolderCount", true); {
if (_ConnectionFolderCount < 0) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_ConnectionFolderCount = ConnectionFolders.Count; get
return _ConnectionFolderCount; {
} if (_ConnectionFolderCount < 0 || (_ConnectionFolderCount > 0 && _ConnectionFolders == null))
} _ConnectionFolders = FolderInfoList.GetByDBID(_DBID);
private FolderInfoList _ConnectionFolders = null; if (_ConnectionFolderCount < 0)
[TypeConverter(typeof(FolderInfoListConverter))] _ConnectionFolderCount = _ConnectionFolders.Count;
public FolderInfoList ConnectionFolders return _ConnectionFolders;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get public void RefreshConnectionFolders()
{ {
CanReadProperty("ConnectionFolders", true); _ConnectionFolderCount = -1;
if (_ConnectionFolderCount < 0 || (_ConnectionFolderCount > 0 && _ConnectionFolders == null)) ConvertListToDictionary();
_ConnectionFolders = FolderInfoList.GetByDBID(_DBID); if (_CacheByPrimaryKey.ContainsKey(_DBID.ToString()))
if (_ConnectionFolderCount < 0) foreach (ConnectionInfo tmp in _CacheByPrimaryKey[_DBID.ToString()])
_ConnectionFolderCount = _ConnectionFolders.Count; tmp._ConnectionFolderCount = -1; // This will cause the data to be requeried
return _ConnectionFolders; }
} // CSLATODO: Replace base ConnectionInfo.ToString function as necessary
} /// <summary>
public void RefreshConnectionFolders() /// Overrides Base ToString
{ /// </summary>
_ConnectionFolderCount = -1; /// <returns>A string representation of current ConnectionInfo</returns>
ConvertListToDictionary(); //public override string ToString()
if (_CacheByPrimaryKey.ContainsKey(_DBID.ToString())) //{
foreach (ConnectionInfo tmp in _CacheByPrimaryKey[_DBID.ToString()]) // return base.ToString();
tmp._ConnectionFolderCount = -1; // This will cause the data to be requeried //}
} // CSLATODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique
// CSLATODO: Replace base ConnectionInfo.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 ConnectionInfo</returns>
/// <returns>A string representation of current ConnectionInfo</returns> protected override object GetIdValue()
//public override string ToString() {
//{ return MyConnectionInfoUnique; // Absolutely Unique ID
// return base.ToString(); }
//} #endregion
// CSLATODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique #region Factory Methods
/// <summary> private static int _ConnectionInfoUnique = 0;
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private static int ConnectionInfoUnique
/// </summary> { get { return ++_ConnectionInfoUnique; } }
/// <returns>A Unique ID for the current ConnectionInfo</returns> private int _MyConnectionInfoUnique = ConnectionInfoUnique;
protected override object GetIdValue() public int MyConnectionInfoUnique // Absolutely Unique ID - Info
{ { get { return _MyConnectionInfoUnique; } }
return MyConnectionInfoUnique; // Absolutely Unique ID protected ConnectionInfo()
} {/* require use of factory methods */
#endregion AddToCache(this);
#region Factory Methods }
private static int _ConnectionInfoUnique = 0; private bool _Disposed = false;
private static int ConnectionInfoUnique private static int _CountCreated = 0;
{ get { return ++_ConnectionInfoUnique; } } private static int _CountDisposed = 0;
private int _MyConnectionInfoUnique = ConnectionInfoUnique; private static int _CountFinalized = 0;
public int MyConnectionInfoUnique // Absolutely Unique ID - Info private static int IncrementCountCreated
{ get { return _MyConnectionInfoUnique; } } { get { return ++_CountCreated; } }
protected ConnectionInfo() 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; ~ConnectionInfo()
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);
~ConnectionInfo() if (!_CacheByPrimaryKey.ContainsKey(DBID.ToString())) return;
{ List<ConnectionInfo> listConnectionInfo = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items
_CountFinalized++; while (listConnectionInfo.Contains(this)) listConnectionInfo.Remove(this); // Remove the item from the list
} if (listConnectionInfo.Count == 0) // If there are no items left in the list
public void Dispose() _CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list
{ }
if (_Disposed) return; public virtual Connection Get()
_CountDisposed++; {
_Disposed = true; return _Editable = Connection.Get(_DBID);
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(DBID.ToString())) return; public static void Refresh(Connection tmp)
List<ConnectionInfo> listConnectionInfo = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items {
while (listConnectionInfo.Contains(this)) listConnectionInfo.Remove(this); // Remove the item from the list string key = tmp.DBID.ToString();
if (listConnectionInfo.Count == 0) // If there are no items left in the list ConvertListToDictionary();
_CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (ConnectionInfo tmpInfo in _CacheByPrimaryKey[key])
public virtual Connection Get() tmpInfo.RefreshFields(tmp);
{ }
return _Editable = Connection.Get(_DBID); protected virtual void RefreshFields(Connection tmp)
} {
public static void Refresh(Connection tmp) _Name = tmp.Name;
{ _Title = tmp.Title;
string key = tmp.DBID.ToString(); _ConnectionString = tmp.ConnectionString;
ConvertListToDictionary(); _ServerType = tmp.ServerType;
if (_CacheByPrimaryKey.ContainsKey(key)) _Config = tmp.Config;
foreach (ConnectionInfo tmpInfo in _CacheByPrimaryKey[key]) _DTS = tmp.DTS;
tmpInfo.RefreshFields(tmp); _UsrID = tmp.UsrID;
} _ConnectionInfoExtension.Refresh(this);
protected virtual void RefreshFields(Connection tmp) OnChange();// raise an event
{ }
_Name = tmp.Name; public static ConnectionInfo Get(int dbid)
_Title = tmp.Title; {
_ConnectionString = tmp.ConnectionString; //if (!CanGetObject())
_ServerType = tmp.ServerType; // throw new System.Security.SecurityException("User not authorized to view a Connection");
_Config = tmp.Config; try
_DTS = tmp.DTS; {
_UsrID = tmp.UsrID; ConnectionInfo tmp = GetCachedByPrimaryKey(dbid);
_ConnectionInfoExtension.Refresh(this); if (tmp == null)
OnChange();// raise an event {
} tmp = DataPortal.Fetch<ConnectionInfo>(new PKCriteria(dbid));
public static ConnectionInfo Get(int dbid) AddToCache(tmp);
{ }
//if (!CanGetObject()) if (tmp.ErrorMessage == "No Record Found")
// throw new System.Security.SecurityException("User not authorized to view a Connection"); {
try tmp.Dispose(); // Clean-up ConnectionInfo
{ tmp = null;
ConnectionInfo tmp = GetCachedByPrimaryKey(dbid); }
if (tmp == null) return tmp;
{ }
tmp = DataPortal.Fetch<ConnectionInfo>(new PKCriteria(dbid)); catch (Exception ex)
AddToCache(tmp); {
} throw new DbCslaException("Error on ConnectionInfo.Get", ex);
if (tmp.ErrorMessage == "No Record Found") }
{ }
tmp.Dispose(); // Clean-up ConnectionInfo #endregion
tmp = null; #region Data Access Portal
} internal ConnectionInfo(SafeDataReader dr)
return tmp; {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.Constructor", GetHashCode());
catch (Exception ex) try
{ {
throw new DbCslaException("Error on ConnectionInfo.Get", ex); ReadData(dr);
} }
} catch (Exception ex)
#endregion {
#region Data Access Portal if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.Constructor", ex);
internal ConnectionInfo(SafeDataReader dr) throw new DbCslaException("ConnectionInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.Constructor", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
ReadData(dr); {
} private int _DBID;
catch (Exception ex) public int DBID
{ { get { return _DBID; } }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.Constructor", ex); public PKCriteria(int dbid)
throw new DbCslaException("ConnectionInfo.Constructor", ex); {
} _DBID = dbid;
} }
[Serializable()] }
protected class PKCriteria private void ReadData(SafeDataReader dr)
{ {
private int _DBID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.ReadData", GetHashCode());
public int DBID try
{ get { return _DBID; } } {
public PKCriteria(int dbid) _DBID = dr.GetInt32("DBID");
{ _Name = dr.GetString("Name");
_DBID = dbid; _Title = dr.GetString("Title");
} _ConnectionString = dr.GetString("ConnectionString");
} _ServerType = dr.GetInt32("ServerType");
private void ReadData(SafeDataReader dr) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.ReadData", GetHashCode()); _UsrID = dr.GetString("UsrID");
try _ConnectionFolderCount = dr.GetInt32("FolderCount");
{ }
_DBID = dr.GetInt32("DBID"); catch (Exception ex)
_Name = dr.GetString("Name"); {
_Title = dr.GetString("Title"); if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.ReadData", ex);
_ConnectionString = dr.GetString("ConnectionString"); _ErrorMessage = ex.Message;
_ServerType = dr.GetInt32("ServerType"); throw new DbCslaException("ConnectionInfo.ReadData", ex);
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); }
_UsrID = dr.GetString("UsrID"); private void DataPortal_Fetch(PKCriteria criteria)
_ConnectionFolderCount = dr.GetInt32("FolderCount"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.DataPortal_Fetch", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = ex.Message; {
throw new DbCslaException("ConnectionInfo.ReadData", ex); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
private void DataPortal_Fetch(PKCriteria criteria) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getConnection";
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.DataPortal_Fetch", GetHashCode()); cm.Parameters.AddWithValue("@DBID", criteria.DBID);
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 = "getConnection"; ReadData(dr);
cm.Parameters.AddWithValue("@DBID", criteria.DBID); }
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("ConnectionInfo.DataPortal_Fetch", ex);
} _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) }
ApplicationContext.LocalContext.Remove("cn"); #endregion
} // Standard Refresh
} #region extension
catch (Exception ex) ConnectionInfoExtension _ConnectionInfoExtension = new ConnectionInfoExtension();
{ [Serializable()]
if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.DataPortal_Fetch", ex); partial class ConnectionInfoExtension : extensionBase { }
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("ConnectionInfo.DataPortal_Fetch", ex); class extensionBase
} {
} // Default Refresh
#endregion public virtual void Refresh(ConnectionInfo tmp) { }
// Standard Refresh }
#region extension #endregion
ConnectionInfoExtension _ConnectionInfoExtension = new ConnectionInfoExtension(); } // Class
[Serializable()] #region Converter
partial class ConnectionInfoExtension : extensionBase { } internal class ConnectionInfoConverter : 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 ConnectionInfo)
public virtual void Refresh(ConnectionInfo tmp) { } {
} // Return the ToString value
#endregion return ((ConnectionInfo)value).ToString();
} // Class }
#region Converter return base.ConvertTo(context, culture, value, destType);
internal class ConnectionInfoConverter : ExpandableObjectConverter }
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) #endregion
{
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,397 +19,387 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _ContentID;
private int _ContentID; 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 {
{ return _ContentID;
CanReadProperty("ContentID", true); }
return _ContentID; }
} private string _Number = string.Empty;
} public string Number
private string _Number = string.Empty; {
public string Number [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _Number;
{ }
CanReadProperty("Number", true); }
return _Number; private string _Text = string.Empty;
} public string Text
} {
private string _Text = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string Text get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Text;
get }
{ }
CanReadProperty("Text", true); private int? _Type;
return _Text; public int? Type
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private int? _Type; get
public int? Type {
{ return _Type;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int? _FormatID;
CanReadProperty("Type", true); public int? FormatID
return _Type; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int? _FormatID; {
public int? FormatID return _FormatID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Config = string.Empty;
{ public string Config
CanReadProperty("FormatID", true); {
return _FormatID; [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 int _DeleteStatus;
{ public int DeleteStatus
[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 _DeleteStatus;
} }
} }
private int _DeleteStatus; // CSLATODO: Replace base ContentAuditInfo.ToString function as necessary
public int DeleteStatus /// <summary>
{ /// Overrides Base ToString
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// </summary>
get /// <returns>A string representation of current ContentAuditInfo</returns>
{ //public override string ToString()
CanReadProperty("DeleteStatus", true); //{
return _DeleteStatus; // return base.ToString();
} //}
} // CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique
// CSLATODO: Replace base ContentAuditInfo.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 ContentAuditInfo</returns>
/// <returns>A string representation of current ContentAuditInfo</returns> protected override object GetIdValue()
//public override string ToString() {
//{ return MyContentAuditInfoUnique; // Absolutely Unique ID
// return base.ToString(); }
//} #endregion
// CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique #region Factory Methods
/// <summary> private static int _ContentAuditInfoUnique = 0;
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private static int ContentAuditInfoUnique
/// </summary> { get { return ++_ContentAuditInfoUnique; } }
/// <returns>A Unique ID for the current ContentAuditInfo</returns> private int _MyContentAuditInfoUnique = ContentAuditInfoUnique;
protected override object GetIdValue() public int MyContentAuditInfoUnique // Absolutely Unique ID - Info
{ { get { return _MyContentAuditInfoUnique; } }
return MyContentAuditInfoUnique; // Absolutely Unique ID protected ContentAuditInfo()
} {/* require use of factory methods */
#endregion AddToCache(this);
#region Factory Methods }
private static int _ContentAuditInfoUnique = 0; private bool _Disposed = false;
private static int ContentAuditInfoUnique private static int _CountCreated = 0;
{ get { return ++_ContentAuditInfoUnique; } } private static int _CountDisposed = 0;
private int _MyContentAuditInfoUnique = ContentAuditInfoUnique; private static int _CountFinalized = 0;
public int MyContentAuditInfoUnique // Absolutely Unique ID - Info private static int IncrementCountCreated
{ get { return _MyContentAuditInfoUnique; } } { get { return ++_CountCreated; } }
protected ContentAuditInfo() 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; ~ContentAuditInfo()
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);
~ContentAuditInfo() if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
_CountFinalized++; while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list
} if (listContentAuditInfo.Count == 0) // If there are no items left in the list
public void Dispose() _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
{ }
if (_Disposed) return; public virtual ContentAudit Get()
_CountDisposed++; {
_Disposed = true; return _Editable = ContentAudit.Get(_AuditID);
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public static void Refresh(ContentAudit tmp)
List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list string key = tmp.AuditID.ToString();
if (listContentAuditInfo.Count == 0) // If there are no items left in the list ConvertListToDictionary();
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
public virtual ContentAudit Get() tmpInfo.RefreshFields(tmp);
{ }
return _Editable = ContentAudit.Get(_AuditID); protected virtual void RefreshFields(ContentAudit tmp)
} {
public static void Refresh(ContentAudit tmp) _ContentID = tmp.ContentID;
{ _Number = tmp.Number;
string key = tmp.AuditID.ToString(); _Text = tmp.Text;
ConvertListToDictionary(); _Type = tmp.Type;
if (_CacheByPrimaryKey.ContainsKey(key)) _FormatID = tmp.FormatID;
foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _Config = tmp.Config;
tmpInfo.RefreshFields(tmp); _DTS = tmp.DTS;
} _UserID = tmp.UserID;
protected virtual void RefreshFields(ContentAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _ContentAuditInfoExtension.Refresh(this);
_ContentID = tmp.ContentID; OnChange();// raise an event
_Number = tmp.Number; }
_Text = tmp.Text; public static ContentAuditInfo Get(long auditID)
_Type = tmp.Type; {
_FormatID = tmp.FormatID; //if (!CanGetObject())
_Config = tmp.Config; // throw new System.Security.SecurityException("User not authorized to view a ContentAudit");
_DTS = tmp.DTS; try
_UserID = tmp.UserID; {
_DeleteStatus = tmp.DeleteStatus; ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
_ContentAuditInfoExtension.Refresh(this); if (tmp == null)
OnChange();// raise an event {
} tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID));
public static ContentAuditInfo Get(long auditID) AddToCache(tmp);
{ }
//if (!CanGetObject()) if (tmp.ErrorMessage == "No Record Found")
// throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); {
try tmp.Dispose(); // Clean-up ContentAuditInfo
{ tmp = null;
ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID); }
if (tmp == null) return tmp;
{ }
tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID)); catch (Exception ex)
AddToCache(tmp); {
} throw new DbCslaException("Error on ContentAuditInfo.Get", ex);
if (tmp.ErrorMessage == "No Record Found") }
{ }
tmp.Dispose(); // Clean-up ContentAuditInfo #endregion
tmp = null; #region Data Access Portal
} internal ContentAuditInfo(SafeDataReader dr)
return tmp; {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode());
catch (Exception ex) try
{ {
throw new DbCslaException("Error on ContentAuditInfo.Get", ex); ReadData(dr);
} }
} catch (Exception ex)
#endregion {
#region Data Access Portal if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex);
internal ContentAuditInfo(SafeDataReader dr) throw new DbCslaException("ContentAuditInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
ReadData(dr); {
} private long _AuditID;
catch (Exception ex) public long AuditID
{ { get { return _AuditID; } }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex); public PKCriteria(long auditID)
throw new DbCslaException("ContentAuditInfo.Constructor", ex); {
} _AuditID = auditID;
} }
[Serializable()] }
protected class PKCriteria private void ReadData(SafeDataReader dr)
{ {
private long _AuditID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode());
public long AuditID try
{ get { return _AuditID; } } {
public PKCriteria(long auditID) _AuditID = dr.GetInt64("AuditID");
{ _ContentID = dr.GetInt32("ContentID");
_AuditID = auditID; _Number = dr.GetString("Number");
} _Text = dr.GetString("Text");
} _Type = (int?)dr.GetValue("Type");
private void ReadData(SafeDataReader dr) _FormatID = (int?)dr.GetValue("FormatID");
{ _Config = dr.GetString("Config");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode()); _DTS = dr.GetDateTime("DTS");
try _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_ContentID = dr.GetInt32("ContentID"); catch (Exception ex)
_Number = dr.GetString("Number"); {
_Text = dr.GetString("Text"); if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex);
_Type = (int?)dr.GetValue("Type"); _ErrorMessage = ex.Message;
_FormatID = (int?)dr.GetValue("FormatID"); throw new DbCslaException("ContentAuditInfo.ReadData", ex);
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); private void DataPortal_Fetch(PKCriteria criteria)
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = ex.Message; {
throw new DbCslaException("ContentAuditInfo.ReadData", ex); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
private void DataPortal_Fetch(PKCriteria criteria) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getContentAudit";
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode()); cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
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 = "getContentAudit"; ReadData(dr);
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); }
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("ContentAuditInfo.DataPortal_Fetch", ex);
} _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) }
ApplicationContext.LocalContext.Remove("cn"); #endregion
} // Standard Refresh
} #region extension
catch (Exception ex) ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension();
{ [Serializable()]
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex); partial class ContentAuditInfoExtension : extensionBase { }
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex); class extensionBase
} {
} // Default Refresh
#endregion public virtual void Refresh(ContentAuditInfo tmp) { }
// Standard Refresh }
#region extension #endregion
ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension(); } // Class
[Serializable()] #region Converter
partial class ContentAuditInfoExtension : extensionBase { } internal class ContentAuditInfoConverter : 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 ContentAuditInfo)
public virtual void Refresh(ContentAuditInfo tmp) { } {
} // Return the ToString value
#endregion return ((ContentAuditInfo)value).ToString();
} // Class }
#region Converter return base.ConvertTo(context, culture, value, destType);
internal class ContentAuditInfoConverter : ExpandableObjectConverter }
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) #endregion
{
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,456 +20,444 @@ 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
{ {
CanReadProperty("DetailID", true); if (_MyDetail != null) _DetailID = _MyDetail.DetailID;
if (_MyDetail != null) _DetailID = _MyDetail.DetailID; return _DetailID;
return _DetailID; }
} }
} private Detail _MyDetail;
private Detail _MyDetail; [System.ComponentModel.DataObjectField(true, true)]
[System.ComponentModel.DataObjectField(true, true)] public Detail MyDetail
public Detail MyDetail {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyDetail == null && _DetailID != 0) _MyDetail = Detail.Get(_DetailID);
CanReadProperty("MyDetail", true); return _MyDetail;
if (_MyDetail == null && _DetailID != 0) _MyDetail = Detail.Get(_DetailID); }
return _MyDetail; }
} private int _ItemType;
} public int ItemType
private int _ItemType; {
public int ItemType [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _ItemType;
{ }
CanReadProperty("ItemType", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _ItemType; set
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_ItemType != value)
set {
{ _ItemType = value;
CanWriteProperty("ItemType", true); PropertyHasChanged();
if (_ItemType != value) }
{ }
_ItemType = value; }
PropertyHasChanged(); private string _Text = string.Empty;
} 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 [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
CanReadProperty("Text", true); {
return _Text; if (value == null) value = string.Empty;
} if (_Text != value)
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
set _Text = value;
{ PropertyHasChanged();
CanWriteProperty("Text", true); }
if (value == null) value = string.Empty; }
if (_Text != value) }
{ private string _Config = string.Empty;
_Text = value; public string Config
PropertyHasChanged(); {
} [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)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] set
get {
{ if (value == null) value = string.Empty;
CanReadProperty("Config", true); if (_Config != value)
return _Config; {
} _Config = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
set }
{ }
CanWriteProperty("Config", true); }
if (value == null) value = string.Empty; private DateTime _DTS = new DateTime();
if (_Config != value) public DateTime DTS
{ {
_Config = value; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
PropertyHasChanged(); get
} {
} return _DTS;
} }
private DateTime _DTS = new DateTime(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public DateTime DTS set
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_DTS != value)
get {
{ _DTS = value;
CanReadProperty("DTS", true); PropertyHasChanged();
return _DTS; }
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
set private string _UserID = string.Empty;
{ public string UserID
CanWriteProperty("DTS", true); {
if (_DTS != value) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
_DTS = value; {
PropertyHasChanged(); return _UserID;
} }
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} set
private string _UserID = string.Empty; {
public string UserID if (value == null) value = string.Empty;
{ if (_UserID != value)
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get _UserID = value;
{ PropertyHasChanged();
CanReadProperty("UserID", true); }
return _UserID; }
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private byte[] _LastChanged = new byte[8];//timestamp
set // CSLATODO: Check ContentDetail.GetIdValue to assure that the ID returned is unique
{ /// <summary>
CanWriteProperty("UserID", true); /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
if (value == null) value = string.Empty; /// </summary>
if (_UserID != value) /// <returns>A Unique ID for the current ContentDetail</returns>
{ protected override object GetIdValue()
_UserID = value; {
PropertyHasChanged(); return MyContentDetailUnique; // Absolutely Unique ID
} }
} // CSLATODO: Replace base ContentDetail.ToString function as necessary
} /// <summary>
private byte[] _LastChanged = new byte[8];//timestamp /// Overrides Base ToString
// CSLATODO: Check ContentDetail.GetIdValue to assure that the ID returned is unique /// </summary>
/// <summary> /// <returns>A string representation of current ContentDetail</returns>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality //public override string ToString()
/// </summary> //{
/// <returns>A Unique ID for the current ContentDetail</returns> // return base.ToString();
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 }
/// <summary> public bool IsDirtyList(List<object> list)
/// Overrides Base ToString {
/// </summary> return base.IsDirty;
/// <returns>A string representation of current ContentDetail</returns> }
//public override string ToString() public override bool IsValid
//{ {
// return base.ToString(); get { return (IsNew && !IsDirty) ? true : base.IsValid; }
//} }
public override bool IsDirty public bool IsValidList(List<object> list)
{ {
get { return base.IsDirty; } return (IsNew && !IsDirty) ? true : base.IsValid;
} }
public bool IsDirtyList(List<object> list) #endregion
{ #region ValidationRules
return base.IsDirty; [NonSerialized]
} private bool _CheckingBrokenRules = false;
public override bool IsValid public IVEHasBrokenRules HasBrokenRules
{ {
get { return (IsNew && !IsDirty) ? true : base.IsValid; } get
} {
public bool IsValidList(List<object> list) if (_CheckingBrokenRules) return null;
{ if (BrokenRulesCollection.Count > 0) return this;
return (IsNew && !IsDirty) ? true : base.IsValid; try
} {
#endregion _CheckingBrokenRules = true;
#region ValidationRules IVEHasBrokenRules hasBrokenRules = null;
[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; {
return hasBrokenRules; IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
} if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
finally return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
{ }
_CheckingBrokenRules = false; }
} protected override void AddBusinessRules()
} {
} ValidationRules.AddRule(
public BrokenRulesCollection BrokenRules Csla.Validation.CommonRules.StringRequired, "Text");
{ ValidationRules.AddRule(
get Csla.Validation.CommonRules.StringMaxLength,
{ new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823));
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; ValidationRules.AddRule(
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; Csla.Validation.CommonRules.StringMaxLength,
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823));
} ValidationRules.AddRule(
} Csla.Validation.CommonRules.StringRequired, "UserID");
protected override void AddBusinessRules() ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringMaxLength,
ValidationRules.AddRule( new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
Csla.Validation.CommonRules.StringRequired, "Text"); // CSLATODO: Add other validation rules
ValidationRules.AddRule( }
Csla.Validation.CommonRules.StringMaxLength, // Sample data comparison validation rule
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
ValidationRules.AddRule( //{
Csla.Validation.CommonRules.StringMaxLength, // if (_started > _ended)
new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); // {
ValidationRules.AddRule( // e.Description = "Start date can't be after end date";
Csla.Validation.CommonRules.StringRequired, "UserID"); // return false;
ValidationRules.AddRule( // }
Csla.Validation.CommonRules.StringMaxLength, // else
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); // return true;
// CSLATODO: Add other validation rules //}
} #endregion
// Sample data comparison validation rule #region Authorization Rules
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) protected override void AddAuthorizationRules()
//{ {
// if (_started > _ended) //CSLATODO: Who can read/write which fields
// { //AuthorizationRules.AllowRead(DetailID, "<Role(s)>");
// e.Description = "Start date can't be after end date"; //AuthorizationRules.AllowRead(ItemType, "<Role(s)>");
// return false; //AuthorizationRules.AllowWrite(ItemType, "<Role(s)>");
// } //AuthorizationRules.AllowRead(Text, "<Role(s)>");
// else //AuthorizationRules.AllowWrite(Text, "<Role(s)>");
// return true; //AuthorizationRules.AllowRead(Config, "<Role(s)>");
//} //AuthorizationRules.AllowWrite(Config, "<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(DetailID, "<Role(s)>"); public static bool CanAddObject()
//AuthorizationRules.AllowRead(ItemType, "<Role(s)>"); {
//AuthorizationRules.AllowWrite(ItemType, "<Role(s)>"); // CSLATODO: Can Add Authorization
//AuthorizationRules.AllowRead(Text, "<Role(s)>"); //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//AuthorizationRules.AllowWrite(Text, "<Role(s)>"); return true;
//AuthorizationRules.AllowRead(Config, "<Role(s)>"); }
//AuthorizationRules.AllowWrite(Config, "<Role(s)>"); public static bool CanGetObject()
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); {
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); // CSLATODO: CanGet Authorization
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); return true;
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); }
} public static bool CanDeleteObject()
public static bool CanAddObject() {
{ // CSLATODO: CanDelete Authorization
// CSLATODO: Can Add Authorization //bool result = false;
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
return true; //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
} //return result;
public static bool CanGetObject() return true;
{ }
// CSLATODO: CanGet Authorization public static bool CanEditObject()
return true; {
} // CSLATODO: CanEdit Authorization
public static bool CanDeleteObject() //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
{ return true;
// CSLATODO: CanDelete Authorization }
//bool result = false; #endregion
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; #region Factory Methods
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; public int CurrentEditLevel
//return result; { get { return EditLevel; } }
return true; private static int _ContentDetailUnique = 0;
} private static int ContentDetailUnique
public static bool CanEditObject() { get { return ++_ContentDetailUnique; } }
{ private int _MyContentDetailUnique = ContentDetailUnique;
// CSLATODO: CanEdit Authorization public int MyContentDetailUnique // Absolutely Unique ID - Editable FK
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); { get { return _MyContentDetailUnique; } }
return true; internal static ContentDetail New(int itemType, string text)
} {
#endregion return new ContentDetail(itemType, text);
#region Factory Methods }
public int CurrentEditLevel internal static ContentDetail Get(SafeDataReader dr)
{ get { return EditLevel; } } {
private static int _ContentDetailUnique = 0; return new ContentDetail(dr);
private static int ContentDetailUnique }
{ get { return ++_ContentDetailUnique; } } public ContentDetail()
private int _MyContentDetailUnique = ContentDetailUnique; {
public int MyContentDetailUnique // Absolutely Unique ID - Editable FK MarkAsChild();
{ get { return _MyContentDetailUnique; } } _DetailID = Detail.NextDetailID;
internal static ContentDetail New(int itemType, string text) _DTS = _ContentDetailExtension.DefaultDTS;
{ _UserID = _ContentDetailExtension.DefaultUserID;
return new ContentDetail(itemType, text); ValidationRules.CheckRules();
} }
internal static ContentDetail Get(SafeDataReader dr) private ContentDetail(int itemType, string text)
{ {
return new ContentDetail(dr); MarkAsChild();
} // CSLATODO: Add any initialization & defaults
public ContentDetail() _DetailID = Detail.NextDetailID;
{ _DTS = _ContentDetailExtension.DefaultDTS;
MarkAsChild(); _UserID = _ContentDetailExtension.DefaultUserID;
_DetailID = Detail.NextDetailID; _ItemType = itemType;
_DTS = _ContentDetailExtension.DefaultDTS; _Text = text;
_UserID = _ContentDetailExtension.DefaultUserID; ValidationRules.CheckRules();
ValidationRules.CheckRules(); }
} internal ContentDetail(SafeDataReader dr)
private ContentDetail(int itemType, string text) {
{ MarkAsChild();
MarkAsChild(); Fetch(dr);
// CSLATODO: Add any initialization & defaults }
_DetailID = Detail.NextDetailID; private bool _Disposed = false;
_DTS = _ContentDetailExtension.DefaultDTS; private static int _CountCreated = 0;
_UserID = _ContentDetailExtension.DefaultUserID; private static int _CountDisposed = 0;
_ItemType = itemType; private static int _CountFinalized = 0;
_Text = text; private static int IncrementCountCreated
ValidationRules.CheckRules(); { get { return ++_CountCreated; } }
} private int _CountWhenCreated = IncrementCountCreated;
internal ContentDetail(SafeDataReader dr) public static int CountCreated
{ { get { return _CountCreated; } }
MarkAsChild(); public static int CountNotDisposed
Fetch(dr); { get { return _CountCreated - _CountDisposed; } }
} public static int CountNotFinalized
private bool _Disposed = false; { get { return _CountCreated - _CountFinalized; } }
private static int _CountCreated = 0; ~ContentDetail()
private static int _CountDisposed = 0; {
private static int _CountFinalized = 0; _CountFinalized++;
private static int IncrementCountCreated }
{ get { return ++_CountCreated; } } public void Dispose()
private int _CountWhenCreated = IncrementCountCreated; {
public static int CountCreated if (_Disposed) return;
{ get { return _CountCreated; } } _CountDisposed++;
public static int CountNotDisposed _Disposed = true;
{ get { return _CountCreated - _CountDisposed; } } }
public static int CountNotFinalized #endregion
{ get { return _CountCreated - _CountFinalized; } } #region Data Access Portal
~ContentDetail() private void Fetch(SafeDataReader dr)
{ {
_CountFinalized++; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentDetail.FetchDR", GetHashCode());
} try
public void Dispose() {
{ _DetailID = dr.GetInt32("DetailID");
if (_Disposed) return; _ItemType = dr.GetInt32("ItemType");
_CountDisposed++; _Text = dr.GetString("Text");
_Disposed = true; _Config = dr.GetString("Config");
} _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}] ContentDetail.FetchDR", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetail.FetchDR", ex);
{ throw new DbCslaException("ContentDetail.Fetch", ex);
_DetailID = dr.GetInt32("DetailID"); }
_ItemType = dr.GetInt32("ItemType"); MarkOld();
_Text = dr.GetString("Text"); }
_Config = dr.GetString("Config"); internal void Insert(Content myContent)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); // if we're not dirty then don't update the database
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); if (!this.IsDirty) return;
} SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
catch (Exception ex) // FKItem Fetch _LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID);
{ MarkOld();
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetail.FetchDR", ex); }
throw new DbCslaException("ContentDetail.Fetch", ex); internal void Update(Content myContent)
} {
MarkOld(); // if we're not dirty then don't update the database
} if (!this.IsDirty) return;
internal void Insert(Content myContent) SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
{ _LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged);
// if we're not dirty then don't update the database MarkOld();
if (!this.IsDirty) return; }
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; internal void DeleteSelf(Content myContent)
_LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID); {
MarkOld(); // if we're not dirty then don't update the database
} if (!this.IsDirty) return;
internal void Update(Content myContent) // if we're new then don't update the database
{ if (this.IsNew) return;
// if we're not dirty then don't update the database SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
if (!this.IsDirty) return; Detail.Remove(cn, _DetailID);
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; MarkNew();
_LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged); }
MarkOld(); #endregion
} // Standard Default Code
internal void DeleteSelf(Content myContent) #region extension
{ ContentDetailExtension _ContentDetailExtension = new ContentDetailExtension();
// if we're not dirty then don't update the database [Serializable()]
if (!this.IsDirty) return; partial class ContentDetailExtension : extensionBase
// if we're new then don't update the database {
if (this.IsNew) return; }
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; [Serializable()]
Detail.Remove(cn, _DetailID); class extensionBase
MarkNew(); {
} // Default Values
#endregion public virtual DateTime DefaultDTS
// Standard Default Code {
#region extension get { return DateTime.Now; }
ContentDetailExtension _ContentDetailExtension = new ContentDetailExtension(); }
[Serializable()] public virtual string DefaultUserID
partial class ContentDetailExtension : extensionBase {
{ get { return Volian.Base.Library.VlnSettings.UserID; }
} }
[Serializable()] // Authorization Rules
class extensionBase public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
// Default Values // Needs to be overriden to add new authorization rules
public virtual DateTime DefaultDTS }
{ // Instance Authorization Rules
get { return DateTime.Now; } public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules)
} {
public virtual string DefaultUserID // Needs to be overriden to add new authorization rules
{ }
get { return Volian.Base.Library.VlnSettings.UserID; } // Validation Rules
} public virtual void AddValidationRules(Csla.Validation.ValidationRules rules)
// Authorization Rules {
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) // Needs to be overriden to add new validation rules
{ }
// Needs to be overriden to add new authorization rules // InstanceValidation Rules
} public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules)
// Instance Authorization Rules {
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) // Needs to be overriden to add new validation rules
{ }
// Needs to be overriden to add new authorization rules }
} #endregion
// Validation Rules } // Class
public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) #region Converter
{ 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 {
public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) if (destType == typeof(string) && value is ContentDetail)
{ {
// Needs to be overriden to add new validation rules // Return the ToString value
} return ((ContentDetail)value).ToString();
} }
#endregion return base.ConvertTo(context, culture, value, destType);
} // Class }
#region Converter }
internal class ContentDetailConverter : ExpandableObjectConverter #endregion
{
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,403 +20,394 @@ 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
{ {
CanReadProperty("ItemID", true); if (_MyItem != null) _ItemID = _MyItem.ItemID;
if (_MyItem != null) _ItemID = _MyItem.ItemID; return _ItemID;
return _ItemID; }
} }
} private Item _MyItem;
private Item _MyItem; [System.ComponentModel.DataObjectField(true, true)]
[System.ComponentModel.DataObjectField(true, true)] public Item MyItem
public Item MyItem {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID);
CanReadProperty("MyItem", true); return _MyItem;
if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); }
return _MyItem; }
} private int? _PreviousID;
} public int? PreviousID
private int? _PreviousID; {
public int? PreviousID [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID;
{ return _PreviousID;
CanReadProperty("PreviousID", true); }
if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; }
return _PreviousID; private Item _MyPrevious;
} public Item MyPrevious
} {
private Item _MyPrevious; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public Item MyPrevious get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID);
get return _MyPrevious;
{ }
CanReadProperty("MyPrevious", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID); set
return _MyPrevious; {
} if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID))
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
set _MyPrevious = value;
{ _PreviousID = (value == null ? null : (int?)value.ItemID);
CanWriteProperty("MyPrevious", true); PropertyHasChanged();
if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID)) }
{ }
_MyPrevious = value; }
_PreviousID = (value == null ? null : (int?)value.ItemID); 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; // CSLATODO: Check ContentItem.GetIdValue to assure that the ID returned is unique
if (_UserID != value) /// <summary>
{ /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
_UserID = value; /// </summary>
PropertyHasChanged(); /// <returns>A Unique ID for the current ContentItem</returns>
} protected override object GetIdValue()
} {
} return MyContentItemUnique; // Absolutely Unique ID
private byte[] _LastChanged = new byte[8];//timestamp }
// CSLATODO: Check ContentItem.GetIdValue to assure that the ID returned is unique // CSLATODO: Replace base ContentItem.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 ContentItem</returns> /// <returns>A string representation of current ContentItem</returns>
protected override object GetIdValue() //public override string ToString()
{ //{
return MyContentItemUnique; // Absolutely Unique ID // return base.ToString();
} //}
// CSLATODO: Replace base ContentItem.ToString function as necessary public override bool IsDirty
/// <summary> {
/// Overrides Base ToString get { return base.IsDirty; }
/// </summary> }
/// <returns>A string representation of current ContentItem</returns> public bool IsDirtyList(List<object> list)
//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
public override bool IsValid #region ValidationRules
{ [NonSerialized]
get { return (IsNew && !IsDirty) ? true : base.IsValid; } private bool _CheckingBrokenRules = false;
} public IVEHasBrokenRules HasBrokenRules
public bool IsValidList(List<object> list) {
{ get
return (IsNew && !IsDirty) ? true : base.IsValid; {
} if (_CheckingBrokenRules) return null;
#endregion if (BrokenRulesCollection.Count > 0) return this;
#region ValidationRules try
[NonSerialized] {
private bool _CheckingBrokenRules = false; _CheckingBrokenRules = true;
public IVEHasBrokenRules HasBrokenRules IVEHasBrokenRules hasBrokenRules = null;
{ if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules;
get return hasBrokenRules;
{ }
if (_CheckingBrokenRules) return null; finally
if (BrokenRulesCollection.Count > 0) return this; {
try _CheckingBrokenRules = false;
{ }
_CheckingBrokenRules = true; }
IVEHasBrokenRules hasBrokenRules = null; }
if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; public BrokenRulesCollection BrokenRules
return hasBrokenRules; {
} get
finally {
{ IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
_CheckingBrokenRules = false; if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
} return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
} }
} }
public BrokenRulesCollection BrokenRules protected override void AddBusinessRules()
{ {
get ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringRequired, "UserID");
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; ValidationRules.AddRule(
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; Csla.Validation.CommonRules.StringMaxLength,
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
} // CSLATODO: Add other validation rules
} }
protected override void AddBusinessRules() // Sample data comparison validation rule
{ //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
ValidationRules.AddRule( //{
Csla.Validation.CommonRules.StringRequired, "UserID"); // if (_started > _ended)
ValidationRules.AddRule( // {
Csla.Validation.CommonRules.StringMaxLength, // e.Description = "Start date can't be after end date";
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); // return false;
// CSLATODO: Add other validation rules // }
} // else
// Sample data comparison validation rule // return true;
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) //}
//{ #endregion
// if (_started > _ended) #region Authorization Rules
// { protected override void AddAuthorizationRules()
// e.Description = "Start date can't be after end date"; {
// return false; //CSLATODO: Who can read/write which fields
// } //AuthorizationRules.AllowRead(ItemID, "<Role(s)>");
// else //AuthorizationRules.AllowRead(PreviousID, "<Role(s)>");
// return true; //AuthorizationRules.AllowWrite(PreviousID, "<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(ItemID, "<Role(s)>"); {
//AuthorizationRules.AllowRead(PreviousID, "<Role(s)>"); // CSLATODO: Can Add Authorization
//AuthorizationRules.AllowWrite(PreviousID, "<Role(s)>"); //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); return true;
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); }
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); public static bool CanGetObject()
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); {
} // CSLATODO: CanGet Authorization
public static bool CanAddObject() return true;
{ }
// CSLATODO: Can Add Authorization public static bool CanDeleteObject()
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); {
return true; // CSLATODO: CanDelete Authorization
} //bool result = false;
public static bool CanGetObject() //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
{ //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
// CSLATODO: CanGet Authorization //return result;
return true; return true;
} }
public static bool CanDeleteObject() public static bool CanEditObject()
{ {
// CSLATODO: CanDelete Authorization // CSLATODO: CanEdit Authorization
//bool result = false; //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; return true;
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; }
//return result; #endregion
return true; #region Factory Methods
} public int CurrentEditLevel
public static bool CanEditObject() { get { return EditLevel; } }
{ private static int _ContentItemUnique = 0;
// CSLATODO: CanEdit Authorization private static int ContentItemUnique
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); { get { return ++_ContentItemUnique; } }
return true; private int _MyContentItemUnique = ContentItemUnique;
} public int MyContentItemUnique // Absolutely Unique ID - Editable FK
#endregion { get { return _MyContentItemUnique; } }
#region Factory Methods internal static ContentItem New()
public int CurrentEditLevel {
{ get { return EditLevel; } } return new ContentItem();
private static int _ContentItemUnique = 0; }
private static int ContentItemUnique internal static ContentItem Get(SafeDataReader dr)
{ get { return ++_ContentItemUnique; } } {
private int _MyContentItemUnique = ContentItemUnique; return new ContentItem(dr);
public int MyContentItemUnique // Absolutely Unique ID - Editable FK }
{ get { return _MyContentItemUnique; } } public ContentItem()
internal static ContentItem New() {
{ MarkAsChild();
return new ContentItem(); _ItemID = Item.NextItemID;
} _DTS = _ContentItemExtension.DefaultDTS;
internal static ContentItem Get(SafeDataReader dr) _UserID = _ContentItemExtension.DefaultUserID;
{ ValidationRules.CheckRules();
return new ContentItem(dr); }
} internal ContentItem(SafeDataReader dr)
public ContentItem() {
{ MarkAsChild();
MarkAsChild(); Fetch(dr);
_ItemID = Item.NextItemID; }
_DTS = _ContentItemExtension.DefaultDTS; private bool _Disposed = false;
_UserID = _ContentItemExtension.DefaultUserID; private static int _CountCreated = 0;
ValidationRules.CheckRules(); private static int _CountDisposed = 0;
} private static int _CountFinalized = 0;
internal ContentItem(SafeDataReader dr) private static int IncrementCountCreated
{ { get { return ++_CountCreated; } }
MarkAsChild(); private int _CountWhenCreated = IncrementCountCreated;
Fetch(dr); 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 ~ContentItem()
{ 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;
~ContentItem() }
{ #endregion
_CountFinalized++; #region Data Access Portal
} private void Fetch(SafeDataReader dr)
public void Dispose() {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItem.FetchDR", GetHashCode());
if (_Disposed) return; try
_CountDisposed++; {
_Disposed = true; _ItemID = dr.GetInt32("ItemID");
} _PreviousID = (int?)dr.GetValue("PreviousID");
#endregion _DTS = dr.GetDateTime("DTS");
#region Data Access Portal _UserID = dr.GetString("UserID");
private void Fetch(SafeDataReader dr) dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItem.FetchDR", GetHashCode()); catch (Exception ex) // FKItem Fetch
try {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItem.FetchDR", ex);
_ItemID = dr.GetInt32("ItemID"); throw new DbCslaException("ContentItem.Fetch", ex);
_PreviousID = (int?)dr.GetValue("PreviousID"); }
_DTS = dr.GetDateTime("DTS"); MarkOld();
_UserID = dr.GetString("UserID"); }
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); internal void Insert(Content myContent)
} {
catch (Exception ex) // FKItem Fetch // if we're not dirty then don't update the database
{ if (!this.IsDirty) return;
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItem.FetchDR", ex); SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
throw new DbCslaException("ContentItem.Fetch", ex); _LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID);
} MarkOld();
MarkOld(); }
} internal void Update(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 = Item.Update(cn, ref _ItemID, _PreviousID, myContent.ContentID, _DTS, _UserID, ref _LastChanged);
_LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID); MarkOld();
MarkOld(); }
} internal void DeleteSelf(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; // if we're new then don't update the database
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; if (this.IsNew) return;
_LastChanged = Item.Update(cn, ref _ItemID, _PreviousID, myContent.ContentID, _DTS, _UserID, ref _LastChanged); SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
MarkOld(); Item.Remove(cn, _ItemID);
} MarkNew();
internal void DeleteSelf(Content myContent) }
{ #endregion
// if we're not dirty then don't update the database // Standard Default Code
if (!this.IsDirty) return; #region extension
// if we're new then don't update the database ContentItemExtension _ContentItemExtension = new ContentItemExtension();
if (this.IsNew) return; [Serializable()]
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; partial class ContentItemExtension : extensionBase
Item.Remove(cn, _ItemID); {
MarkNew(); }
} [Serializable()]
#endregion class extensionBase
// Standard Default Code {
#region extension // Default Values
ContentItemExtension _ContentItemExtension = new ContentItemExtension(); public virtual DateTime DefaultDTS
[Serializable()] {
partial class ContentItemExtension : extensionBase get { return DateTime.Now; }
{ }
} public virtual string DefaultUserID
[Serializable()] {
class extensionBase get { return Volian.Base.Library.VlnSettings.UserID; }
{ }
// Default Values // Authorization Rules
public virtual DateTime DefaultDTS public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules)
{ {
get { return DateTime.Now; } // Needs to be overriden to add new authorization rules
} }
public virtual string DefaultUserID // Instance Authorization Rules
{ 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 }
public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) // Validation 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 }
public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) // InstanceValidation 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
// Needs to be overriden to add new validation rules } // Class
} #region Converter
// InstanceValidation Rules internal class ContentItemConverter : ExpandableObjectConverter
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)
} {
#endregion // Return the ToString value
} // Class return ((ContentItem)value).ToString();
#region Converter }
internal class ContentItemConverter : 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 ContentItem)
{
// Return the ToString value
return ((ContentItem)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -20,470 +20,458 @@ 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
{ {
CanReadProperty("FromType", true); return _FromType;
return _FromType; }
} }
} private int _ItemID;
private int _ItemID; 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;
} public Item MyItem
private Item _MyItem; {
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); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _MyItem; set
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyItem != value)
set {
{ _MyItem = value;
CanWriteProperty("MyItem", true); _ItemID = value.ItemID;// Update underlying data field
if (_MyItem != value) PropertyHasChanged();
{ }
_MyItem = value; }
_ItemID = value.ItemID;// Update underlying data field }
PropertyHasChanged(); private DateTime _DTS = new DateTime();
} 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 [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
CanReadProperty("DTS", true); {
return _DTS; if (_DTS != value)
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] _DTS = value;
set PropertyHasChanged();
{ }
CanWriteProperty("DTS", true); }
if (_DTS != value) }
{ private string _UserID = string.Empty;
_DTS = value; public string UserID
PropertyHasChanged(); {
} [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)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] set
get {
{ if (value == null) value = string.Empty;
CanReadProperty("UserID", true); if (_UserID != value)
return _UserID; {
} _UserID = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
set }
{ }
CanWriteProperty("UserID", true); }
if (value == null) value = string.Empty; private byte[] _LastChanged = new byte[8];//timestamp
if (_UserID != value) private int? _Item_PreviousID;
{ public int? Item_PreviousID
_UserID = value; {
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
} return _Item_PreviousID;
private byte[] _LastChanged = new byte[8];//timestamp }
private int? _Item_PreviousID; }
public int? Item_PreviousID private int _Item_ContentID;
{ public int Item_ContentID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
CanReadProperty("Item_PreviousID", true); {
return _Item_PreviousID; return _Item_ContentID;
} }
} }
private int _Item_ContentID; private DateTime _Item_DTS = new DateTime();
public int Item_ContentID public DateTime Item_DTS
{ {
[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_DTS;
return _Item_ContentID; }
} }
} private string _Item_UserID = string.Empty;
private DateTime _Item_DTS = new DateTime(); public string Item_UserID
public DateTime Item_DTS {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ return _Item_UserID;
CanReadProperty("Item_DTS", true); }
return _Item_DTS; }
} // CSLATODO: Check ContentPart.GetIdValue to assure that the ID returned is unique
} /// <summary>
private string _Item_UserID = string.Empty; /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
public string Item_UserID /// </summary>
{ /// <returns>A Unique ID for the current ContentPart</returns>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] protected override object GetIdValue()
get {
{ return MyContentPartUnique; // Absolutely Unique ID
CanReadProperty("Item_UserID", true); }
return _Item_UserID; // CSLATODO: Replace base ContentPart.ToString function as necessary
} /// <summary>
} /// Overrides Base ToString
// CSLATODO: Check ContentPart.GetIdValue to assure that the ID returned is unique /// </summary>
/// <summary> /// <returns>A string representation of current ContentPart</returns>
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality //public override string ToString()
/// </summary> //{
/// <returns>A Unique ID for the current ContentPart</returns> // return base.ToString();
protected override object GetIdValue() //}
{ public override bool IsDirty
return MyContentPartUnique; // Absolutely Unique ID {
} get
// CSLATODO: Replace base ContentPart.ToString function as necessary {
/// <summary> if (base.IsDirty)
/// Overrides Base ToString return true;
/// </summary> return IsDirtyList(new List<object>());
/// <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))
public override bool IsDirty return base.IsDirty;
{ list.Add(this);
get return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list));
{ }
if ( base.IsDirty ) public override bool IsValid
return true; {
return IsDirtyList(new List<object>()); get { return IsValidList(new List<object>()); }
} }
} public bool IsValidList(List<object> list)
public bool IsDirtyList(List<object> list) {
{ if (list.Contains(this))
if (base.IsDirty || list.Contains(this)) return (IsNew && !IsDirty) ? true : base.IsValid;
return base.IsDirty; list.Add(this);
list.Add(this); return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValidList(list));
return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); }
} #endregion
public override bool IsValid #region ValidationRules
{ [NonSerialized]
get { return IsValidList(new List<object>()); } private bool _CheckingBrokenRules = false;
} public IVEHasBrokenRules HasBrokenRules
public bool IsValidList(List<object> list) {
{ get
if(list.Contains(this)) {
return (IsNew && !IsDirty) ? true : base.IsValid; if (_CheckingBrokenRules) return null;
list.Add(this); if (BrokenRulesCollection.Count > 0) return this;
return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValidList(list)); try
} {
#endregion _CheckingBrokenRules = true;
#region ValidationRules IVEHasBrokenRules hasBrokenRules = null;
[NonSerialized] if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules;
private bool _CheckingBrokenRules = false; return hasBrokenRules;
public IVEHasBrokenRules HasBrokenRules }
{ finally
get {
{ _CheckingBrokenRules = false;
if (_CheckingBrokenRules) return null; }
if (BrokenRulesCollection.Count > 0) return this; }
try }
{ public BrokenRulesCollection BrokenRules
_CheckingBrokenRules = true; {
IVEHasBrokenRules hasBrokenRules = null; get
if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; {
return hasBrokenRules; IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
} if (this.Equals(hasBrokenRules)) return BrokenRulesCollection;
finally return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
{ }
_CheckingBrokenRules = false; }
} protected override void AddBusinessRules()
} {
} ValidationRules.AddRule<ContentPart>(MyItemRequired, "MyItem");
public BrokenRulesCollection BrokenRules ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringRequired, "UserID");
get ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringMaxLength,
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; // CSLATODO: Add other validation rules
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); }
} private static bool MyItemRequired(ContentPart target, Csla.Validation.RuleArgs e)
} {
protected override void AddBusinessRules() if (target._ItemID == 0 && target._MyItem == null) // Required field missing
{ {
ValidationRules.AddRule<ContentPart>(MyItemRequired, "MyItem"); e.Description = "Required";
ValidationRules.AddRule( return false;
Csla.Validation.CommonRules.StringRequired, "UserID"); }
ValidationRules.AddRule( return true;
Csla.Validation.CommonRules.StringMaxLength, }
new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); // Sample data comparison validation rule
// CSLATODO: Add other validation rules //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
} //{
private static bool MyItemRequired(ContentPart target, Csla.Validation.RuleArgs e) // if (_started > _ended)
{ // {
if (target._ItemID == 0 && target._MyItem == null) // Required field missing // e.Description = "Start date can't be after end date";
{ // return false;
e.Description = "Required"; // }
return false; // else
} // return true;
return true; //}
} #endregion
// Sample data comparison validation rule #region Authorization Rules
//private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) protected override void AddAuthorizationRules()
//{ {
// if (_started > _ended) //CSLATODO: Who can read/write which fields
// { //AuthorizationRules.AllowRead(FromType, "<Role(s)>");
// e.Description = "Start date can't be after end date"; //AuthorizationRules.AllowRead(ItemID, "<Role(s)>");
// return false; //AuthorizationRules.AllowWrite(ItemID, "<Role(s)>");
// } //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
// else //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
// return true; //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
//} //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
#endregion }
#region Authorization Rules public static bool CanAddObject()
protected override void AddAuthorizationRules() {
{ // CSLATODO: Can Add Authorization
//CSLATODO: Who can read/write which fields //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//AuthorizationRules.AllowRead(FromType, "<Role(s)>"); return true;
//AuthorizationRules.AllowRead(ItemID, "<Role(s)>"); }
//AuthorizationRules.AllowWrite(ItemID, "<Role(s)>"); public static bool CanGetObject()
//AuthorizationRules.AllowRead(DTS, "<Role(s)>"); {
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>"); // CSLATODO: CanGet Authorization
//AuthorizationRules.AllowRead(UserID, "<Role(s)>"); return true;
//AuthorizationRules.AllowWrite(UserID, "<Role(s)>"); }
} public static bool CanDeleteObject()
public static bool CanAddObject() {
{ // CSLATODO: CanDelete Authorization
// CSLATODO: Can Add Authorization //bool result = false;
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true;
return true; //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true;
} //return result;
public static bool CanGetObject() return true;
{ }
// CSLATODO: CanGet Authorization public static bool CanEditObject()
return true; {
} // CSLATODO: CanEdit Authorization
public static bool CanDeleteObject() //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
{ return true;
// CSLATODO: CanDelete Authorization }
//bool result = false; #endregion
//if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; #region Factory Methods
//if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; public int CurrentEditLevel
//return result; { get { return EditLevel; } }
return true; private static int _ContentPartUnique = 0;
} private static int ContentPartUnique
public static bool CanEditObject() { get { return ++_ContentPartUnique; } }
{ private int _MyContentPartUnique = ContentPartUnique;
// CSLATODO: CanEdit Authorization public int MyContentPartUnique // Absolutely Unique ID - Editable FK
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); { get { return _MyContentPartUnique; } }
return true; internal static ContentPart New(int fromType, Item myItem)
} {
#endregion return new ContentPart(fromType, myItem);
#region Factory Methods }
public int CurrentEditLevel internal static ContentPart Get(SafeDataReader dr)
{ get { return EditLevel; } } {
private static int _ContentPartUnique = 0; return new ContentPart(dr);
private static int ContentPartUnique }
{ get { return ++_ContentPartUnique; } } public ContentPart()
private int _MyContentPartUnique = ContentPartUnique; {
public int MyContentPartUnique // Absolutely Unique ID - Editable FK MarkAsChild();
{ 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,376 +19,366 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _AnnotationID;
private int _AnnotationID; public int AnnotationID
public int AnnotationID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ return _AnnotationID;
CanReadProperty("AnnotationID", true); }
return _AnnotationID; }
} 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 return _ItemID;
{ }
CanReadProperty("ItemID", true); }
return _ItemID; private int _TypeID;
} public int TypeID
} {
private int _TypeID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int TypeID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _TypeID;
get }
{ }
CanReadProperty("TypeID", true); private string _RtfText = string.Empty;
return _TypeID; public string RtfText
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _RtfText = string.Empty; get
public string RtfText {
{ return _RtfText;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private string _SearchText = string.Empty;
CanReadProperty("RtfText", true); public string SearchText
return _RtfText; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private string _SearchText = string.Empty; {
public string SearchText return _SearchText;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Config = string.Empty;
{ public string Config
CanReadProperty("SearchText", true); {
return _SearchText; [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 int _DeleteStatus;
{ public int DeleteStatus
[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 _DeleteStatus;
} }
} }
private int _DeleteStatus; // CSLATODO: Replace base AnnotationAuditInfo.ToString function as necessary
public int DeleteStatus /// <summary>
{ /// Overrides Base ToString
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// </summary>
get /// <returns>A string representation of current AnnotationAuditInfo</returns>
{ //public override string ToString()
CanReadProperty("DeleteStatus", true); //{
return _DeleteStatus; // return base.ToString();
} //}
} // CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique
// CSLATODO: Replace base AnnotationAuditInfo.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 AnnotationAuditInfo</returns>
/// <returns>A string representation of current AnnotationAuditInfo</returns> protected override object GetIdValue()
//public override string ToString() {
//{ return MyAnnotationAuditInfoUnique; // Absolutely Unique ID
// return base.ToString(); }
//} #endregion
// CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique #region Factory Methods
/// <summary> private static int _AnnotationAuditInfoUnique = 0;
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private static int AnnotationAuditInfoUnique
/// </summary> { get { return ++_AnnotationAuditInfoUnique; } }
/// <returns>A Unique ID for the current AnnotationAuditInfo</returns> private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique;
protected override object GetIdValue() public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info
{ { get { return _MyAnnotationAuditInfoUnique; } }
return MyAnnotationAuditInfoUnique; // Absolutely Unique ID protected AnnotationAuditInfo()
} {/* require use of factory methods */
#endregion AddToCache(this);
#region Factory Methods }
private static int _AnnotationAuditInfoUnique = 0; public void Dispose()
private static int AnnotationAuditInfoUnique {
{ get { return ++_AnnotationAuditInfoUnique; } } RemoveFromCache(this);
private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique; if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info List<AnnotationAuditInfo> listAnnotationAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
{ get { return _MyAnnotationAuditInfoUnique; } } while (listAnnotationAuditInfo.Contains(this)) listAnnotationAuditInfo.Remove(this); // Remove the item from the list
protected AnnotationAuditInfo() if (listAnnotationAuditInfo.Count == 0) // If there are no items left in the list
{/* require use of factory methods */ _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
AddToCache(this); }
} public virtual AnnotationAudit Get()
public void Dispose() {
{ return _Editable = AnnotationAudit.Get(_AuditID);
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public static void Refresh(AnnotationAudit tmp)
List<AnnotationAuditInfo> listAnnotationAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listAnnotationAuditInfo.Contains(this)) listAnnotationAuditInfo.Remove(this); // Remove the item from the list string key = tmp.AuditID.ToString();
if (listAnnotationAuditInfo.Count == 0) // If there are no items left in the list ConvertListToDictionary();
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (AnnotationAuditInfo tmpInfo in _CacheByPrimaryKey[key])
public virtual AnnotationAudit Get() tmpInfo.RefreshFields(tmp);
{ }
return _Editable = AnnotationAudit.Get(_AuditID); protected virtual void RefreshFields(AnnotationAudit tmp)
} {
public static void Refresh(AnnotationAudit tmp) _AnnotationID = tmp.AnnotationID;
{ _ItemID = tmp.ItemID;
string key = tmp.AuditID.ToString(); _TypeID = tmp.TypeID;
ConvertListToDictionary(); _RtfText = tmp.RtfText;
if (_CacheByPrimaryKey.ContainsKey(key)) _SearchText = tmp.SearchText;
foreach (AnnotationAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _Config = tmp.Config;
tmpInfo.RefreshFields(tmp); _DTS = tmp.DTS;
} _UserID = tmp.UserID;
protected virtual void RefreshFields(AnnotationAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _AnnotationAuditInfoExtension.Refresh(this);
_AnnotationID = tmp.AnnotationID; OnChange();// raise an event
_ItemID = tmp.ItemID; }
_TypeID = tmp.TypeID; public static AnnotationAuditInfo Get(long auditID)
_RtfText = tmp.RtfText; {
_SearchText = tmp.SearchText; //if (!CanGetObject())
_Config = tmp.Config; // throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit");
_DTS = tmp.DTS; try
_UserID = tmp.UserID; {
_DeleteStatus = tmp.DeleteStatus; AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID);
_AnnotationAuditInfoExtension.Refresh(this); if (tmp == null)
OnChange();// raise an event {
} tmp = DataPortal.Fetch<AnnotationAuditInfo>(new PKCriteria(auditID));
public static AnnotationAuditInfo Get(long auditID) AddToCache(tmp);
{ }
//if (!CanGetObject()) if (tmp.ErrorMessage == "No Record Found")
// throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit"); {
try tmp.Dispose(); // Clean-up AnnotationAuditInfo
{ tmp = null;
AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID); }
if (tmp == null) return tmp;
{ }
tmp = DataPortal.Fetch<AnnotationAuditInfo>(new PKCriteria(auditID)); catch (Exception ex)
AddToCache(tmp); {
} throw new DbCslaException("Error on AnnotationAuditInfo.Get", ex);
if (tmp.ErrorMessage == "No Record Found") }
{ }
tmp.Dispose(); // Clean-up AnnotationAuditInfo #endregion
tmp = null; #region Data Access Portal
} internal AnnotationAuditInfo(SafeDataReader dr)
return tmp; {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.Constructor", GetHashCode());
catch (Exception ex) try
{ {
throw new DbCslaException("Error on AnnotationAuditInfo.Get", ex); ReadData(dr);
} }
} catch (Exception ex)
#endregion {
#region Data Access Portal if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.Constructor", ex);
internal AnnotationAuditInfo(SafeDataReader dr) throw new DbCslaException("AnnotationAuditInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.Constructor", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
ReadData(dr); {
} private long _AuditID;
catch (Exception ex) public long AuditID
{ { get { return _AuditID; } }
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.Constructor", ex); public PKCriteria(long auditID)
throw new DbCslaException("AnnotationAuditInfo.Constructor", ex); {
} _AuditID = auditID;
} }
[Serializable()] }
protected class PKCriteria private void ReadData(SafeDataReader dr)
{ {
private long _AuditID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode());
public long AuditID try
{ get { return _AuditID; } } {
public PKCriteria(long auditID) _AuditID = dr.GetInt64("AuditID");
{ _AnnotationID = dr.GetInt32("AnnotationID");
_AuditID = auditID; _ItemID = dr.GetInt32("ItemID");
} _TypeID = dr.GetInt32("TypeID");
} _RtfText = dr.GetString("RtfText");
private void ReadData(SafeDataReader dr) _SearchText = dr.GetString("SearchText");
{ _Config = dr.GetString("Config");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode()); _DTS = dr.GetDateTime("DTS");
try _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_AnnotationID = dr.GetInt32("AnnotationID"); catch (Exception ex)
_ItemID = dr.GetInt32("ItemID"); {
_TypeID = dr.GetInt32("TypeID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.ReadData", ex);
_RtfText = dr.GetString("RtfText"); _ErrorMessage = ex.Message;
_SearchText = dr.GetString("SearchText"); throw new DbCslaException("AnnotationAuditInfo.ReadData", ex);
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); private void DataPortal_Fetch(PKCriteria criteria)
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.DataPortal_Fetch", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = ex.Message; {
throw new DbCslaException("AnnotationAuditInfo.ReadData", ex); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
private void DataPortal_Fetch(PKCriteria criteria) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getAnnotationAudit";
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.DataPortal_Fetch", GetHashCode()); cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
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 = "getAnnotationAudit"; }
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); }
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("AnnotationAuditInfo.DataPortal_Fetch", ex);
} _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) }
ApplicationContext.LocalContext.Remove("cn"); #endregion
} // Standard Refresh
} #region extension
catch (Exception ex) AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension();
{ [Serializable()]
if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.DataPortal_Fetch", ex); partial class AnnotationAuditInfoExtension : extensionBase { }
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("AnnotationAuditInfo.DataPortal_Fetch", ex); class extensionBase
} {
} // Default Refresh
#endregion public virtual void Refresh(AnnotationAuditInfo tmp) { }
// Standard Refresh }
#region extension #endregion
AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension(); } // Class
[Serializable()] #region Converter
partial class AnnotationAuditInfoExtension : extensionBase { } internal class AnnotationAuditInfoConverter : 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 AnnotationAuditInfo)
public virtual void Refresh(AnnotationAuditInfo tmp) { } {
} // Return the ToString value
#endregion return ((AnnotationAuditInfo)value).ToString();
} // Class }
#region Converter return base.ConvertTo(context, culture, value, destType);
internal class AnnotationAuditInfoConverter : ExpandableObjectConverter }
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) #endregion
{
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,376 +19,366 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _ContentID;
private int _ContentID; 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 {
{ return _ContentID;
CanReadProperty("ContentID", true); }
return _ContentID; }
} private string _Number = string.Empty;
} public string Number
private string _Number = string.Empty; {
public string Number [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _Number;
{ }
CanReadProperty("Number", true); }
return _Number; private string _Text = string.Empty;
} public string Text
} {
private string _Text = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string Text get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _Text;
get }
{ }
CanReadProperty("Text", true); private int? _Type;
return _Text; public int? Type
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private int? _Type; get
public int? Type {
{ return _Type;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int? _FormatID;
CanReadProperty("Type", true); public int? FormatID
return _Type; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int? _FormatID; {
public int? FormatID return _FormatID;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get private string _Config = string.Empty;
{ public string Config
CanReadProperty("FormatID", true); {
return _FormatID; [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 int _DeleteStatus;
{ public int DeleteStatus
[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 _DeleteStatus;
} }
} }
private int _DeleteStatus; // CSLATODO: Replace base ContentAuditInfo.ToString function as necessary
public int DeleteStatus /// <summary>
{ /// Overrides Base ToString
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// </summary>
get /// <returns>A string representation of current ContentAuditInfo</returns>
{ //public override string ToString()
CanReadProperty("DeleteStatus", true); //{
return _DeleteStatus; // return base.ToString();
} //}
} // CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique
// CSLATODO: Replace base ContentAuditInfo.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 ContentAuditInfo</returns>
/// <returns>A string representation of current ContentAuditInfo</returns> protected override object GetIdValue()
//public override string ToString() {
//{ return MyContentAuditInfoUnique; // Absolutely Unique ID
// return base.ToString(); }
//} #endregion
// CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique #region Factory Methods
/// <summary> private static int _ContentAuditInfoUnique = 0;
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private static int ContentAuditInfoUnique
/// </summary> { get { return ++_ContentAuditInfoUnique; } }
/// <returns>A Unique ID for the current ContentAuditInfo</returns> private int _MyContentAuditInfoUnique = ContentAuditInfoUnique;
protected override object GetIdValue() public int MyContentAuditInfoUnique // Absolutely Unique ID - Info
{ { get { return _MyContentAuditInfoUnique; } }
return MyContentAuditInfoUnique; // Absolutely Unique ID protected ContentAuditInfo()
} {/* require use of factory methods */
#endregion AddToCache(this);
#region Factory Methods }
private static int _ContentAuditInfoUnique = 0; public void Dispose()
private static int ContentAuditInfoUnique {
{ get { return ++_ContentAuditInfoUnique; } } RemoveFromCache(this);
private int _MyContentAuditInfoUnique = ContentAuditInfoUnique; if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
public int MyContentAuditInfoUnique // Absolutely Unique ID - Info List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
{ get { return _MyContentAuditInfoUnique; } } while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list
protected ContentAuditInfo() if (listContentAuditInfo.Count == 0) // If there are no items left in the list
{/* require use of factory methods */ _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
AddToCache(this); }
} public virtual ContentAudit Get()
public void Dispose() {
{ return _Editable = ContentAudit.Get(_AuditID);
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public static void Refresh(ContentAudit tmp)
List<ContentAuditInfo> listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list string key = tmp.AuditID.ToString();
if (listContentAuditInfo.Count == 0) // If there are no items left in the list ConvertListToDictionary();
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
public virtual ContentAudit Get() tmpInfo.RefreshFields(tmp);
{ }
return _Editable = ContentAudit.Get(_AuditID); protected virtual void RefreshFields(ContentAudit tmp)
} {
public static void Refresh(ContentAudit tmp) _ContentID = tmp.ContentID;
{ _Number = tmp.Number;
string key = tmp.AuditID.ToString(); _Text = tmp.Text;
ConvertListToDictionary(); _Type = tmp.Type;
if (_CacheByPrimaryKey.ContainsKey(key)) _FormatID = tmp.FormatID;
foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _Config = tmp.Config;
tmpInfo.RefreshFields(tmp); _DTS = tmp.DTS;
} _UserID = tmp.UserID;
protected virtual void RefreshFields(ContentAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _ContentAuditInfoExtension.Refresh(this);
_ContentID = tmp.ContentID; OnChange();// raise an event
_Number = tmp.Number; }
_Text = tmp.Text; public static ContentAuditInfo Get(long auditID)
_Type = tmp.Type; {
_FormatID = tmp.FormatID; //if (!CanGetObject())
_Config = tmp.Config; // throw new System.Security.SecurityException("User not authorized to view a ContentAudit");
_DTS = tmp.DTS; try
_UserID = tmp.UserID; {
_DeleteStatus = tmp.DeleteStatus; ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
_ContentAuditInfoExtension.Refresh(this); if (tmp == null)
OnChange();// raise an event {
} tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID));
public static ContentAuditInfo Get(long auditID) AddToCache(tmp);
{ }
//if (!CanGetObject()) if (tmp.ErrorMessage == "No Record Found")
// throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); {
try tmp.Dispose(); // Clean-up ContentAuditInfo
{ tmp = null;
ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID); }
if (tmp == null) return tmp;
{ }
tmp = DataPortal.Fetch<ContentAuditInfo>(new PKCriteria(auditID)); catch (Exception ex)
AddToCache(tmp); {
} throw new DbCslaException("Error on ContentAuditInfo.Get", ex);
if (tmp.ErrorMessage == "No Record Found") }
{ }
tmp.Dispose(); // Clean-up ContentAuditInfo #endregion
tmp = null; #region Data Access Portal
} internal ContentAuditInfo(SafeDataReader dr)
return tmp; {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode());
catch (Exception ex) try
{ {
throw new DbCslaException("Error on ContentAuditInfo.Get", ex); ReadData(dr);
} }
} catch (Exception ex)
#endregion {
#region Data Access Portal if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex);
internal ContentAuditInfo(SafeDataReader dr) throw new DbCslaException("ContentAuditInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
ReadData(dr); {
} private long _AuditID;
catch (Exception ex) public long AuditID
{ { get { return _AuditID; } }
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex); public PKCriteria(long auditID)
throw new DbCslaException("ContentAuditInfo.Constructor", ex); {
} _AuditID = auditID;
} }
[Serializable()] }
protected class PKCriteria private void ReadData(SafeDataReader dr)
{ {
private long _AuditID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode());
public long AuditID try
{ get { return _AuditID; } } {
public PKCriteria(long auditID) _AuditID = dr.GetInt64("AuditID");
{ _ContentID = dr.GetInt32("ContentID");
_AuditID = auditID; _Number = dr.GetString("Number");
} _Text = dr.GetString("Text");
} _Type = (int?)dr.GetValue("Type");
private void ReadData(SafeDataReader dr) _FormatID = (int?)dr.GetValue("FormatID");
{ _Config = dr.GetString("Config");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode()); _DTS = dr.GetDateTime("DTS");
try _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_ContentID = dr.GetInt32("ContentID"); catch (Exception ex)
_Number = dr.GetString("Number"); {
_Text = dr.GetString("Text"); if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex);
_Type = (int?)dr.GetValue("Type"); _ErrorMessage = ex.Message;
_FormatID = (int?)dr.GetValue("FormatID"); throw new DbCslaException("ContentAuditInfo.ReadData", ex);
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); private void DataPortal_Fetch(PKCriteria criteria)
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = ex.Message; {
throw new DbCslaException("ContentAuditInfo.ReadData", ex); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
private void DataPortal_Fetch(PKCriteria criteria) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getContentAudit";
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode()); cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
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); }
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("ContentAuditInfo.DataPortal_Fetch", ex);
} _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) }
ApplicationContext.LocalContext.Remove("cn"); #endregion
} // Standard Refresh
} #region extension
catch (Exception ex) ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension();
{ [Serializable()]
if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex); partial class ContentAuditInfoExtension : extensionBase { }
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex); class extensionBase
} {
} // Default Refresh
#endregion public virtual void Refresh(ContentAuditInfo tmp) { }
// Standard Refresh }
#region extension #endregion
ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension(); } // Class
[Serializable()] #region Converter
partial class ContentAuditInfoExtension : extensionBase { } internal class ContentAuditInfoConverter : 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 ContentAuditInfo)
public virtual void Refresh(ContentAuditInfo tmp) { } {
} // Return the ToString value
#endregion return ((ContentAuditInfo)value).ToString();
} // Class }
#region Converter return base.ConvertTo(context, culture, value, destType);
internal class ContentAuditInfoConverter : ExpandableObjectConverter }
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) #endregion
{
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,388 +19,377 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _DocID;
private int _DocID; 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;
} public byte[] DocContent
} {
private byte[] _DocContent; [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; public string DocAscii
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _DocAscii = string.Empty; 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 byte[] _DocPdf;
{ public byte[] DocPdf
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
CanReadProperty("FileExtension", true); {
return _FileExtension; return _DocPdf;
} }
} }
private byte[] _DocPdf; private int _DeleteStatus;
public byte[] DocPdf public int DeleteStatus
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DocPdf", true); return _DeleteStatus;
return _DocPdf; }
} }
} // 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 public void Dispose()
private static int _DocumentAuditInfoUnique = 0; {
private static int DocumentAuditInfoUnique RemoveFromCache(this);
{ get { return ++_DocumentAuditInfoUnique; } } if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique; List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list
{ get { return _MyDocumentAuditInfoUnique; } } if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list
protected DocumentAuditInfo() _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
{/* require use of factory methods */ }
AddToCache(this); public virtual DocumentAudit Get()
} {
public void Dispose() return _Editable = DocumentAudit.Get(_AuditID);
{ }
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;
} _DocPdf = tmp.DocPdf;
protected virtual void RefreshFields(DocumentAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _DocumentAuditInfoExtension.Refresh(this);
_DocID = tmp.DocID; OnChange();// raise an event
_LibTitle = tmp.LibTitle; }
_DocContent = tmp.DocContent; public static DocumentAuditInfo Get(long auditID)
_DocAscii = tmp.DocAscii; {
_Config = tmp.Config; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a DocumentAudit");
_UserID = tmp.UserID; try
_FileExtension = tmp.FileExtension; {
_DocPdf = tmp.DocPdf; 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 _DocPdf = (byte[])dr.GetValue("DocPdf");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_DocID = dr.GetInt32("DocID"); catch (Exception ex)
_LibTitle = dr.GetString("LibTitle"); {
_DocContent = (byte[])dr.GetValue("DocContent"); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex);
_DocAscii = dr.GetString("DocAscii"); _ErrorMessage = ex.Message;
_Config = dr.GetString("Config"); throw new DbCslaException("DocumentAuditInfo.ReadData", ex);
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); }
_FileExtension = dr.GetString("FileExtension"); private void DataPortal_Fetch(PKCriteria criteria)
_DocPdf = (byte[])dr.GetValue("DocPdf"); {
_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()); 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 = "getDocumentAudit"; }
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("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

File diff suppressed because it is too large Load Diff

View File

@@ -19,445 +19,436 @@ 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
{ {
CanReadProperty("DROUsageID", true); return _DROUsageID;
return _DROUsageID; }
} }
} private int _DocID;
private int _DocID; 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 {
{ if (_MyDocument != null) _DocID = _MyDocument.DocID;
CanReadProperty("DocID", true); return _DocID;
if (_MyDocument != null) _DocID = _MyDocument.DocID; }
return _DocID; }
} private DocumentInfo _MyDocument;
} public DocumentInfo MyDocument
private DocumentInfo _MyDocument; {
public DocumentInfo MyDocument [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID);
{ return _MyDocument;
CanReadProperty("MyDocument", true); }
if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID); }
return _MyDocument; private string _ROID = string.Empty;
} public string ROID
} {
private string _ROID = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string ROID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _ROID;
get }
{ }
CanReadProperty("ROID", true); private string _Config = string.Empty;
return _ROID; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _Config = string.Empty; get
public string Config {
{ return _Config;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private DateTime _DTS = new DateTime();
CanReadProperty("Config", true); public DateTime DTS
return _Config; {
} [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)] private int _RODbID;
get public int RODbID
{ {
CanReadProperty("UserID", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _UserID; get
} {
} if (_MyRODb != null) _RODbID = _MyRODb.RODbID;
private int _RODbID; return _RODbID;
public int RODbID }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private RODbInfo _MyRODb;
get public RODbInfo MyRODb
{ {
CanReadProperty("RODbID", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
if (_MyRODb != null) _RODbID = _MyRODb.RODbID; get
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
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Overrides Base ToString
{ /// </summary>
CanReadProperty("MyRODb", true); /// <returns>A string representation of current DROUsageInfo</returns>
if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID); //public override string ToString()
return _MyRODb; //{
} // return base.ToString();
} //}
// CSLATODO: Replace base DROUsageInfo.ToString function as necessary // CSLATODO: Check DROUsageInfo.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 DROUsageInfo</returns> /// <returns>A Unique ID for the current DROUsageInfo</returns>
//public override string ToString() protected override object GetIdValue()
//{ {
// return base.ToString(); return MyDROUsageInfoUnique; // Absolutely Unique ID
//} }
// CSLATODO: Check DROUsageInfo.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 _DROUsageInfoUnique = 0;
/// </summary> private static int DROUsageInfoUnique
/// <returns>A Unique ID for the current DROUsageInfo</returns> { get { return ++_DROUsageInfoUnique; } }
protected override object GetIdValue() private int _MyDROUsageInfoUnique = DROUsageInfoUnique;
{ public int MyDROUsageInfoUnique // Absolutely Unique ID - Info
return MyDROUsageInfoUnique; // Absolutely Unique ID { get { return _MyDROUsageInfoUnique; } }
} protected DROUsageInfo()
#endregion {/* require use of factory methods */
#region Factory Methods AddToCache(this);
private static int _DROUsageInfoUnique = 0; }
private static int DROUsageInfoUnique private bool _Disposed = false;
{ get { return ++_DROUsageInfoUnique; } } private static int _CountCreated = 0;
private int _MyDROUsageInfoUnique = DROUsageInfoUnique; private static int _CountDisposed = 0;
public int MyDROUsageInfoUnique // Absolutely Unique ID - Info private static int _CountFinalized = 0;
{ get { return _MyDROUsageInfoUnique; } } private static int IncrementCountCreated
protected DROUsageInfo() { 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 ~DROUsageInfo()
{ 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;
~DROUsageInfo() RemoveFromCache(this);
{ if (!_CacheByPrimaryKey.ContainsKey(DROUsageID.ToString())) return;
_CountFinalized++; List<DROUsageInfo> listDROUsageInfo = _CacheByPrimaryKey[DROUsageID.ToString()]; // Get the list of items
} while (listDROUsageInfo.Contains(this)) listDROUsageInfo.Remove(this); // Remove the item from the list
public void Dispose() if (listDROUsageInfo.Count == 0) // If there are no items left in the list
{ _CacheByPrimaryKey.Remove(DROUsageID.ToString()); // remove the list
if (_Disposed) return; }
_CountDisposed++; public virtual DROUsage Get()
_Disposed = true; {
RemoveFromCache(this); return _Editable = DROUsage.Get(_DROUsageID);
if (!_CacheByPrimaryKey.ContainsKey(DROUsageID.ToString())) return; }
List<DROUsageInfo> listDROUsageInfo = _CacheByPrimaryKey[DROUsageID.ToString()]; // Get the list of items public static void Refresh(DROUsage tmp)
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 string key = tmp.DROUsageID.ToString();
_CacheByPrimaryKey.Remove(DROUsageID.ToString()); // remove the list ConvertListToDictionary();
} if (_CacheByPrimaryKey.ContainsKey(key))
public virtual DROUsage Get() foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
{ 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(); {
ConvertListToDictionary(); if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value
if (_CacheByPrimaryKey.ContainsKey(key)) _DocID = tmp.DocID; // Update the value
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); _MyDocument = null; // Reset list so that the next line gets a new list
} if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value
protected virtual void RefreshFields(DROUsage tmp) _ROID = tmp.ROID;
{ _Config = tmp.Config;
if (_DocID != tmp.DocID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value if (_RODbID != tmp.RODbID)
_DocID = tmp.DocID; // Update the value {
} if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value
_MyDocument = null; // Reset list so that the next line gets a new list _RODbID = tmp.RODbID; // Update the value
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value }
_ROID = tmp.ROID; _MyRODb = null; // Reset list so that the next line gets a new list
_Config = tmp.Config; if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value
_DTS = tmp.DTS; _DROUsageInfoExtension.Refresh(this);
_UserID = tmp.UserID; OnChange();// raise an event
if (_RODbID != tmp.RODbID) }
{ public static void Refresh(DocumentDROUsage tmp)
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value {
_RODbID = tmp.RODbID; // Update the value string key = tmp.DROUsageID.ToString();
} ConvertListToDictionary();
_MyRODb = null; // Reset list so that the next line gets a new list if (_CacheByPrimaryKey.ContainsKey(key))
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
_DROUsageInfoExtension.Refresh(this); tmpInfo.RefreshFields(tmp);
OnChange();// raise an event }
} protected virtual void RefreshFields(DocumentDROUsage tmp)
public static void Refresh(DocumentDROUsage tmp) {
{ _ROID = tmp.ROID;
string key = tmp.DROUsageID.ToString(); _Config = tmp.Config;
ConvertListToDictionary(); _DTS = tmp.DTS;
if (_CacheByPrimaryKey.ContainsKey(key)) _UserID = tmp.UserID;
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) if (_RODbID != tmp.RODbID)
tmpInfo.RefreshFields(tmp); {
} if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value
protected virtual void RefreshFields(DocumentDROUsage tmp) _RODbID = tmp.RODbID; // Update the value
{ }
_ROID = tmp.ROID; _MyRODb = null; // Reset list so that the next line gets a new list
_Config = tmp.Config; if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value
_DTS = tmp.DTS; _DROUsageInfoExtension.Refresh(this);
_UserID = tmp.UserID; OnChange();// raise an event
if (_RODbID != tmp.RODbID) }
{ public static void Refresh(RODbDROUsage tmp)
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for old value {
_RODbID = tmp.RODbID; // Update the value string key = tmp.DROUsageID.ToString();
} ConvertListToDictionary();
_MyRODb = null; // Reset list so that the next line gets a new list if (_CacheByPrimaryKey.ContainsKey(key))
if (MyRODb != null) MyRODb.RefreshRODbDROUsages(); // Update List for new value foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key])
_DROUsageInfoExtension.Refresh(this); tmpInfo.RefreshFields(tmp);
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(); {
ConvertListToDictionary(); if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value
if (_CacheByPrimaryKey.ContainsKey(key)) _DocID = tmp.DocID; // Update the value
foreach (DROUsageInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); _MyDocument = null; // Reset list so that the next line gets a new list
} if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value
protected virtual void RefreshFields(RODbDROUsage tmp) _ROID = tmp.ROID;
{ _Config = tmp.Config;
if (_DocID != tmp.DocID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for old value _DROUsageInfoExtension.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 DROUsageInfo Get(int dROUsageID)
if (MyDocument != null) MyDocument.RefreshDocumentDROUsages(); // Update List for new value {
_ROID = tmp.ROID; //if (!CanGetObject())
_Config = tmp.Config; // throw new System.Security.SecurityException("User not authorized to view a DROUsage");
_DTS = tmp.DTS; try
_UserID = tmp.UserID; {
_DROUsageInfoExtension.Refresh(this); DROUsageInfo tmp = GetCachedByPrimaryKey(dROUsageID);
OnChange();// raise an event if (tmp == null)
} {
public static DROUsageInfo Get(int dROUsageID) tmp = DataPortal.Fetch<DROUsageInfo>(new PKCriteria(dROUsageID));
{ AddToCache(tmp);
//if (!CanGetObject()) }
// throw new System.Security.SecurityException("User not authorized to view a DROUsage"); if (tmp.ErrorMessage == "No Record Found")
try {
{ tmp.Dispose(); // Clean-up DROUsageInfo
DROUsageInfo tmp = GetCachedByPrimaryKey(dROUsageID); tmp = null;
if (tmp == null) }
{ return tmp;
tmp = DataPortal.Fetch<DROUsageInfo>(new PKCriteria(dROUsageID)); }
AddToCache(tmp); catch (Exception ex)
} {
if (tmp.ErrorMessage == "No Record Found") throw new DbCslaException("Error on DROUsageInfo.Get", ex);
{ }
tmp.Dispose(); // Clean-up DROUsageInfo }
tmp = null; #endregion
} #region Data Access Portal
return tmp; internal DROUsageInfo(SafeDataReader dr)
} {
catch (Exception ex) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.Constructor", GetHashCode());
{ try
throw new DbCslaException("Error on DROUsageInfo.Get", ex); {
} ReadData(dr);
} }
#endregion catch (Exception ex)
#region Data Access Portal {
internal DROUsageInfo(SafeDataReader dr) if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.Constructor", ex);
{ throw new DbCslaException("DROUsageInfo.Constructor", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.Constructor", GetHashCode()); }
try }
{ [Serializable()]
ReadData(dr); protected class PKCriteria
} {
catch (Exception ex) private int _DROUsageID;
{ public int DROUsageID
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.Constructor", ex); { get { return _DROUsageID; } }
throw new DbCslaException("DROUsageInfo.Constructor", ex); public PKCriteria(int dROUsageID)
} {
} _DROUsageID = dROUsageID;
[Serializable()] }
protected class PKCriteria }
{ private void ReadData(SafeDataReader dr)
private int _DROUsageID; {
public int DROUsageID if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.ReadData", GetHashCode());
{ get { return _DROUsageID; } } try
public PKCriteria(int dROUsageID) {
{ _DROUsageID = dr.GetInt32("DROUsageID");
_DROUsageID = dROUsageID; _DocID = dr.GetInt32("DocID");
} _ROID = dr.GetString("ROID");
} _Config = dr.GetString("Config");
private void ReadData(SafeDataReader dr) _DTS = dr.GetDateTime("DTS");
{ _UserID = dr.GetString("UserID");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.ReadData", GetHashCode()); _RODbID = dr.GetInt32("RODbID");
try }
{ catch (Exception ex)
_DROUsageID = dr.GetInt32("DROUsageID"); {
_DocID = dr.GetInt32("DocID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.ReadData", ex);
_ROID = dr.GetString("ROID"); _ErrorMessage = ex.Message;
_Config = dr.GetString("Config"); throw new DbCslaException("DROUsageInfo.ReadData", ex);
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); }
_RODbID = dr.GetInt32("RODbID"); private void DataPortal_Fetch(PKCriteria criteria)
} {
catch (Exception ex) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.DataPortal_Fetch", GetHashCode());
{ try
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.ReadData", ex); {
_ErrorMessage = ex.Message; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
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;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfo.DataPortal_Fetch", GetHashCode()); cm.CommandText = "getDROUsage";
try cm.Parameters.AddWithValue("@DROUsageID", criteria.DROUsageID);
{ 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 = "getDROUsage"; }
cm.Parameters.AddWithValue("@DROUsageID", criteria.DROUsageID); 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("DROUsageInfo.DataPortal_Fetch", ex);
} _ErrorMessage = ex.Message;
// removing of item only needed for local data portal throw new DbCslaException("DROUsageInfo.DataPortal_Fetch", ex);
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) }
ApplicationContext.LocalContext.Remove("cn"); }
} #endregion
} // Standard Refresh
catch (Exception ex) #region extension
{ DROUsageInfoExtension _DROUsageInfoExtension = new DROUsageInfoExtension();
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfo.DataPortal_Fetch", ex); [Serializable()]
_ErrorMessage = ex.Message; partial class DROUsageInfoExtension : extensionBase { }
throw new DbCslaException("DROUsageInfo.DataPortal_Fetch", ex); [Serializable()]
} class extensionBase
} {
#endregion // Default Refresh
// Standard Refresh public virtual void Refresh(DROUsageInfo tmp) { }
#region extension }
DROUsageInfoExtension _DROUsageInfoExtension = new DROUsageInfoExtension(); #endregion
[Serializable()] } // Class
partial class DROUsageInfoExtension : extensionBase { } #region Converter
[Serializable()] internal class DROUsageInfoConverter : ExpandableObjectConverter
class extensionBase {
{ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
// Default Refresh {
public virtual void Refresh(DROUsageInfo tmp) { } if (destType == typeof(string) && value is DROUsageInfo)
} {
#endregion // Return the ToString value
} // Class return ((DROUsageInfo)value).ToString();
#region Converter }
internal class DROUsageInfoConverter : 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 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,397 +19,389 @@ 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
{ {
CanReadProperty("DetailID", true); return _DetailID;
return _DetailID; }
} }
} private int _ContentID;
private int _ContentID; 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;
} public ContentInfo MyContent
private ContentInfo _MyContent; {
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 _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 }
{ }
CanReadProperty("ItemType", true); private string _Text = string.Empty;
return _ItemType; 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 string _Config = string.Empty;
CanReadProperty("Text", true); public string Config
return _Text; {
} [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 }
{ // CSLATODO: Replace base DetailInfo.ToString function as necessary
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Overrides Base ToString
{ /// </summary>
CanReadProperty("UserID", true); /// <returns>A string representation of current DetailInfo</returns>
return _UserID; //public override string ToString()
} //{
} // return base.ToString();
// CSLATODO: Replace base DetailInfo.ToString function as necessary //}
/// <summary> // CSLATODO: Check DetailInfo.GetIdValue to assure that the ID returned is unique
/// Overrides Base ToString /// <summary>
/// </summary> /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// <returns>A string representation of current DetailInfo</returns> /// </summary>
//public override string ToString() /// <returns>A Unique ID for the current DetailInfo</returns>
//{ protected override object GetIdValue()
// return base.ToString(); {
//} return MyDetailInfoUnique; // Absolutely Unique ID
// CSLATODO: Check DetailInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> #endregion
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality #region Factory Methods
/// </summary> private static int _DetailInfoUnique = 0;
/// <returns>A Unique ID for the current DetailInfo</returns> private static int DetailInfoUnique
protected override object GetIdValue() { get { return ++_DetailInfoUnique; } }
{ private int _MyDetailInfoUnique = DetailInfoUnique;
return MyDetailInfoUnique; // Absolutely Unique ID public int MyDetailInfoUnique // Absolutely Unique ID - Info
} { get { return _MyDetailInfoUnique; } }
#endregion protected DetailInfo()
#region Factory Methods {/* require use of factory methods */
private static int _DetailInfoUnique = 0; AddToCache(this);
private static int DetailInfoUnique }
{ get { return ++_DetailInfoUnique; } } private bool _Disposed = false;
private int _MyDetailInfoUnique = DetailInfoUnique; private static int _CountCreated = 0;
public int MyDetailInfoUnique // Absolutely Unique ID - Info private static int _CountDisposed = 0;
{ get { return _MyDetailInfoUnique; } } private static int _CountFinalized = 0;
protected DetailInfo() private static int IncrementCountCreated
{/* require use of factory methods */ { get { return ++_CountCreated; } }
AddToCache(this); private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
private bool _Disposed = false; { get { return _CountCreated; } }
private static int _CountCreated = 0; public static int CountNotDisposed
private static int _CountDisposed = 0; { get { return _CountCreated - _CountDisposed; } }
private static int _CountFinalized = 0; public static int CountNotFinalized
private static int IncrementCountCreated { get { return _CountCreated - _CountFinalized; } }
{ get { return ++_CountCreated; } } ~DetailInfo()
private int _CountWhenCreated = IncrementCountCreated; {
public static int CountCreated _CountFinalized++;
{ get { return _CountCreated; } } }
public static int CountNotDisposed public void Dispose()
{ get { return _CountCreated - _CountDisposed; } } {
public static int CountNotFinalized if (_Disposed) return;
{ get { return _CountCreated - _CountFinalized; } } _CountDisposed++;
~DetailInfo() _Disposed = true;
{ RemoveFromCache(this);
_CountFinalized++; if (!_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) return;
} List<DetailInfo> listDetailInfo = _CacheByPrimaryKey[DetailID.ToString()]; // Get the list of items
public void Dispose() 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
if (_Disposed) return; _CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list
_CountDisposed++; }
_Disposed = true; public virtual Detail Get()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) return; return _Editable = Detail.Get(_DetailID);
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 static void Refresh(Detail tmp)
if (listDetailInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list string key = tmp.DetailID.ToString();
} ConvertListToDictionary();
public virtual Detail Get() if (_CacheByPrimaryKey.ContainsKey(key))
{ foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key])
return _Editable = Detail.Get(_DetailID); tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(Detail tmp) protected virtual void RefreshFields(Detail tmp)
{ {
string key = tmp.DetailID.ToString(); if (_ContentID != tmp.ContentID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for old value
foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) _ContentID = tmp.ContentID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyContent = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(Detail tmp) if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for new value
{ _ItemType = tmp.ItemType;
if (_ContentID != tmp.ContentID) _Text = tmp.Text;
{ _Config = tmp.Config;
if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for old value _DTS = tmp.DTS;
_ContentID = tmp.ContentID; // Update the value _UserID = tmp.UserID;
} _DetailInfoExtension.Refresh(this);
_MyContent = null; // Reset list so that the next line gets a new list OnChange();// raise an event
if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for new value }
_ItemType = tmp.ItemType; public static void Refresh(ContentDetail tmp)
_Text = tmp.Text; {
_Config = tmp.Config; string key = tmp.DetailID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_DetailInfoExtension.Refresh(this); foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(ContentDetail tmp) protected virtual void RefreshFields(ContentDetail tmp)
{ {
string key = tmp.DetailID.ToString(); _ItemType = tmp.ItemType;
ConvertListToDictionary(); _Text = tmp.Text;
if (_CacheByPrimaryKey.ContainsKey(key)) _Config = tmp.Config;
foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) _DTS = tmp.DTS;
tmpInfo.RefreshFields(tmp); _UserID = tmp.UserID;
} _DetailInfoExtension.Refresh(this);
protected virtual void RefreshFields(ContentDetail tmp) OnChange();// raise an event
{ }
_ItemType = tmp.ItemType; public static DetailInfo Get(int detailID)
_Text = tmp.Text; {
_Config = tmp.Config; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a Detail");
_UserID = tmp.UserID; try
_DetailInfoExtension.Refresh(this); {
OnChange();// raise an event DetailInfo tmp = GetCachedByPrimaryKey(detailID);
} if (tmp == null)
public static DetailInfo Get(int detailID) {
{ tmp = DataPortal.Fetch<DetailInfo>(new PKCriteria(detailID));
//if (!CanGetObject()) AddToCache(tmp);
// throw new System.Security.SecurityException("User not authorized to view a Detail"); }
try if (tmp.ErrorMessage == "No Record Found")
{ {
DetailInfo tmp = GetCachedByPrimaryKey(detailID); tmp.Dispose(); // Clean-up DetailInfo
if (tmp == null) tmp = null;
{ }
tmp = DataPortal.Fetch<DetailInfo>(new PKCriteria(detailID)); return tmp;
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
return tmp; #region Data Access Portal
} internal DetailInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.Constructor", GetHashCode());
throw new DbCslaException("Error on DetailInfo.Get", ex); try
} {
} ReadData(dr);
#endregion }
#region Data Access Portal catch (Exception ex)
internal DetailInfo(SafeDataReader dr) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.Constructor", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.Constructor", GetHashCode()); throw new DbCslaException("DetailInfo.Constructor", ex);
try }
{ }
ReadData(dr); [Serializable()]
} protected class PKCriteria
catch (Exception ex) {
{ private int _DetailID;
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.Constructor", ex); public int DetailID
throw new DbCslaException("DetailInfo.Constructor", ex); { get { return _DetailID; } }
} public PKCriteria(int detailID)
} {
[Serializable()] _DetailID = detailID;
protected class PKCriteria }
{ }
private int _DetailID; private void ReadData(SafeDataReader dr)
public int DetailID {
{ get { return _DetailID; } } if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.ReadData", GetHashCode());
public PKCriteria(int detailID) try
{ {
_DetailID = detailID; _DetailID = dr.GetInt32("DetailID");
} _ContentID = dr.GetInt32("ContentID");
} _ItemType = dr.GetInt32("ItemType");
private void ReadData(SafeDataReader dr) _Text = dr.GetString("Text");
{ _Config = dr.GetString("Config");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.ReadData", GetHashCode()); _DTS = dr.GetDateTime("DTS");
try _UserID = dr.GetString("UserID");
{ }
_DetailID = dr.GetInt32("DetailID"); catch (Exception ex)
_ContentID = dr.GetInt32("ContentID"); {
_ItemType = dr.GetInt32("ItemType"); if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.ReadData", ex);
_Text = dr.GetString("Text"); _ErrorMessage = ex.Message;
_Config = dr.GetString("Config"); throw new DbCslaException("DetailInfo.ReadData", ex);
_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());
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.ReadData", ex); try
_ErrorMessage = ex.Message; {
throw new DbCslaException("DetailInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
} {
} ApplicationContext.LocalContext["cn"] = cn;
private void DataPortal_Fetch(PKCriteria criteria) using (SqlCommand cm = cn.CreateCommand())
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.DataPortal_Fetch", GetHashCode()); cm.CommandType = CommandType.StoredProcedure;
try cm.CommandText = "getDetail";
{ cm.Parameters.AddWithValue("@DetailID", criteria.DetailID);
using (SqlConnection cn = Database.VEPROMS_SqlConnection) cm.CommandTimeout = Database.DefaultTimeout;
{ using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
ApplicationContext.LocalContext["cn"] = cn; {
using (SqlCommand cm = cn.CreateCommand()) if (!dr.Read())
{ {
cm.CommandType = CommandType.StoredProcedure; _ErrorMessage = "No Record Found";
cm.CommandText = "getDetail"; return;
cm.Parameters.AddWithValue("@DetailID", criteria.DetailID); }
cm.CommandTimeout = Database.DefaultTimeout; ReadData(dr);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) }
{ }
if (!dr.Read()) // removing of item only needed for local data portal
{ if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
_ErrorMessage = "No Record Found"; ApplicationContext.LocalContext.Remove("cn");
return; }
} }
ReadData(dr); catch (Exception ex)
} {
} if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.DataPortal_Fetch", ex);
// removing of item only needed for local data portal _ErrorMessage = ex.Message;
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) throw new DbCslaException("DetailInfo.DataPortal_Fetch", ex);
ApplicationContext.LocalContext.Remove("cn"); }
} }
} #endregion
catch (Exception ex) // Standard Refresh
{ #region extension
if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.DataPortal_Fetch", ex); DetailInfoExtension _DetailInfoExtension = new DetailInfoExtension();
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("DetailInfo.DataPortal_Fetch", ex); partial class DetailInfoExtension : extensionBase { }
} [Serializable()]
} class extensionBase
#endregion {
// Standard Refresh // Default Refresh
#region extension public virtual void Refresh(DetailInfo tmp) { }
DetailInfoExtension _DetailInfoExtension = new DetailInfoExtension(); }
[Serializable()] #endregion
partial class DetailInfoExtension : extensionBase { } } // Class
[Serializable()] #region Converter
class extensionBase internal class DetailInfoConverter : ExpandableObjectConverter
{ {
// Default Refresh public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
public virtual void Refresh(DetailInfo tmp) { } {
} if (destType == typeof(string) && value is DetailInfo)
#endregion {
} // Class // Return the ToString value
#region Converter return ((DetailInfo)value).ToString();
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) }
{ }
if (destType == typeof(string) && value is DetailInfo) #endregion
{
// 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,397 +19,387 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _DocID;
private int _DocID; 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;
} public byte[] DocContent
} {
private byte[] _DocContent; [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; public string DocAscii
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _DocAscii = string.Empty; 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 _DeleteStatus;
{ public int DeleteStatus
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
CanReadProperty("FileExtension", true); {
return _FileExtension; return _DeleteStatus;
} }
} }
private int _DeleteStatus; // CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary
public int DeleteStatus /// <summary>
{ /// Overrides Base ToString
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// </summary>
get /// <returns>A string representation of current DocumentAuditInfo</returns>
{ //public override string ToString()
CanReadProperty("DeleteStatus", true); //{
return _DeleteStatus; // return base.ToString();
} //}
} // CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique
// CSLATODO: Replace base DocumentAuditInfo.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 DocumentAuditInfo</returns>
/// <returns>A string representation of current DocumentAuditInfo</returns> protected override object GetIdValue()
//public override string ToString() {
//{ return MyDocumentAuditInfoUnique; // Absolutely Unique ID
// return base.ToString(); }
//} #endregion
// CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique #region Factory Methods
/// <summary> private static int _DocumentAuditInfoUnique = 0;
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality private static int DocumentAuditInfoUnique
/// </summary> { get { return ++_DocumentAuditInfoUnique; } }
/// <returns>A Unique ID for the current DocumentAuditInfo</returns> private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique;
protected override object GetIdValue() public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info
{ { get { return _MyDocumentAuditInfoUnique; } }
return MyDocumentAuditInfoUnique; // Absolutely Unique ID protected DocumentAuditInfo()
} {/* require use of factory methods */
#endregion AddToCache(this);
#region Factory Methods }
private static int _DocumentAuditInfoUnique = 0; private bool _Disposed = false;
private static int DocumentAuditInfoUnique private static int _CountCreated = 0;
{ get { return ++_DocumentAuditInfoUnique; } } private static int _CountDisposed = 0;
private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique; private static int _CountFinalized = 0;
public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info private static int IncrementCountCreated
{ get { return _MyDocumentAuditInfoUnique; } } { get { return ++_CountCreated; } }
protected DocumentAuditInfo() 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; ~DocumentAuditInfo()
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);
~DocumentAuditInfo() if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
_CountFinalized++; while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list
} if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list
public void Dispose() _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
{ }
if (_Disposed) return; public virtual DocumentAudit Get()
_CountDisposed++; {
_Disposed = true; return _Editable = DocumentAudit.Get(_AuditID);
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public static void Refresh(DocumentAudit tmp)
List<DocumentAuditInfo> listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list string key = tmp.AuditID.ToString();
if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list ConvertListToDictionary();
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key])
public virtual DocumentAudit Get() tmpInfo.RefreshFields(tmp);
{ }
return _Editable = DocumentAudit.Get(_AuditID); protected virtual void RefreshFields(DocumentAudit tmp)
} {
public static void Refresh(DocumentAudit tmp) _DocID = tmp.DocID;
{ _LibTitle = tmp.LibTitle;
string key = tmp.AuditID.ToString(); _DocContent = tmp.DocContent;
ConvertListToDictionary(); _DocAscii = tmp.DocAscii;
if (_CacheByPrimaryKey.ContainsKey(key)) _Config = tmp.Config;
foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _DTS = tmp.DTS;
tmpInfo.RefreshFields(tmp); _UserID = tmp.UserID;
} _FileExtension = tmp.FileExtension;
protected virtual void RefreshFields(DocumentAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _DocumentAuditInfoExtension.Refresh(this);
_DocID = tmp.DocID; OnChange();// raise an event
_LibTitle = tmp.LibTitle; }
_DocContent = tmp.DocContent; public static DocumentAuditInfo Get(long auditID)
_DocAscii = tmp.DocAscii; {
_Config = tmp.Config; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a DocumentAudit");
_UserID = tmp.UserID; try
_FileExtension = tmp.FileExtension; {
_DeleteStatus = tmp.DeleteStatus; DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID);
_DocumentAuditInfoExtension.Refresh(this); if (tmp == null)
OnChange();// raise an event {
} tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID));
public static DocumentAuditInfo Get(long auditID) AddToCache(tmp);
{ }
//if (!CanGetObject()) if (tmp.ErrorMessage == "No Record Found")
// throw new System.Security.SecurityException("User not authorized to view a DocumentAudit"); {
try tmp.Dispose(); // Clean-up DocumentAuditInfo
{ tmp = null;
DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID); }
if (tmp == null) return tmp;
{ }
tmp = DataPortal.Fetch<DocumentAuditInfo>(new PKCriteria(auditID)); catch (Exception ex)
AddToCache(tmp); {
} throw new DbCslaException("Error on DocumentAuditInfo.Get", ex);
if (tmp.ErrorMessage == "No Record Found") }
{ }
tmp.Dispose(); // Clean-up DocumentAuditInfo #endregion
tmp = null; #region Data Access Portal
} internal DocumentAuditInfo(SafeDataReader dr)
return tmp; {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode());
catch (Exception ex) try
{ {
throw new DbCslaException("Error on DocumentAuditInfo.Get", ex); ReadData(dr);
} }
} catch (Exception ex)
#endregion {
#region Data Access Portal if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex);
internal DocumentAuditInfo(SafeDataReader dr) throw new DbCslaException("DocumentAuditInfo.Constructor", ex);
{ }
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode()); }
try [Serializable()]
{ protected class PKCriteria
ReadData(dr); {
} private long _AuditID;
catch (Exception ex) public long AuditID
{ { get { return _AuditID; } }
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex); public PKCriteria(long auditID)
throw new DbCslaException("DocumentAuditInfo.Constructor", ex); {
} _AuditID = auditID;
} }
[Serializable()] }
protected class PKCriteria private void ReadData(SafeDataReader dr)
{ {
private long _AuditID; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode());
public long AuditID try
{ get { return _AuditID; } } {
public PKCriteria(long auditID) _AuditID = dr.GetInt64("AuditID");
{ _DocID = dr.GetInt32("DocID");
_AuditID = auditID; _LibTitle = dr.GetString("LibTitle");
} _DocContent = (byte[])dr.GetValue("DocContent");
} _DocAscii = dr.GetString("DocAscii");
private void ReadData(SafeDataReader dr) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode()); _UserID = dr.GetString("UserID");
try _FileExtension = dr.GetString("FileExtension");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_DocID = dr.GetInt32("DocID"); catch (Exception ex)
_LibTitle = dr.GetString("LibTitle"); {
_DocContent = (byte[])dr.GetValue("DocContent"); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex);
_DocAscii = dr.GetString("DocAscii"); _ErrorMessage = ex.Message;
_Config = dr.GetString("Config"); throw new DbCslaException("DocumentAuditInfo.ReadData", ex);
_DTS = dr.GetDateTime("DTS"); }
_UserID = dr.GetString("UserID"); }
_FileExtension = dr.GetString("FileExtension"); private void DataPortal_Fetch(PKCriteria criteria)
_DeleteStatus = dr.GetInt32("DeleteStatus"); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode());
catch (Exception ex) try
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
_ErrorMessage = ex.Message; {
throw new DbCslaException("DocumentAuditInfo.ReadData", ex); ApplicationContext.LocalContext["cn"] = cn;
} using (SqlCommand cm = cn.CreateCommand())
} {
private void DataPortal_Fetch(PKCriteria criteria) cm.CommandType = CommandType.StoredProcedure;
{ cm.CommandText = "getDocumentAudit";
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode()); cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
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 = "getDocumentAudit"; ReadData(dr);
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); }
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("DocumentAuditInfo.DataPortal_Fetch", ex);
} _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) }
ApplicationContext.LocalContext.Remove("cn"); #endregion
} // Standard Refresh
} #region extension
catch (Exception ex) DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension();
{ [Serializable()]
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex); partial class DocumentAuditInfoExtension : extensionBase { }
_ErrorMessage = ex.Message; [Serializable()]
throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex); class extensionBase
} {
} // Default Refresh
#endregion public virtual void Refresh(DocumentAuditInfo tmp) { }
// Standard Refresh }
#region extension #endregion
DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension(); } // Class
[Serializable()] #region Converter
partial class DocumentAuditInfoExtension : extensionBase { } internal class DocumentAuditInfoConverter : 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 DocumentAuditInfo)
public virtual void Refresh(DocumentAuditInfo tmp) { } {
} // Return the ToString value
#endregion return ((DocumentAuditInfo)value).ToString();
} // Class }
#region Converter return base.ConvertTo(context, culture, value, destType);
internal class DocumentAuditInfoConverter : ExpandableObjectConverter }
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) #endregion
{
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,458 +20,445 @@ 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
{ {
CanReadProperty("ContentID", true); if (_MyEntry != null) _ContentID = _MyEntry.ContentID;
if (_MyEntry != null) _ContentID = _MyEntry.ContentID; return _ContentID;
return _ContentID; }
} }
} private Entry _MyEntry;
private Entry _MyEntry; [System.ComponentModel.DataObjectField(true, true)]
[System.ComponentModel.DataObjectField(true, true)] public Entry MyEntry
public Entry MyEntry {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyEntry == null && _ContentID != 0) _MyEntry = Entry.Get(_ContentID);
CanReadProperty("MyEntry", true); return _MyEntry;
if (_MyEntry == null && _ContentID != 0) _MyEntry = Entry.Get(_ContentID); }
return _MyEntry; }
} private DateTime _DTS = new DateTime();
} public DateTime DTS
private DateTime _DTS = new DateTime(); {
public DateTime DTS [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _DTS;
{ }
CanReadProperty("DTS", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _DTS; set
} {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_DTS != value)
set {
{ _DTS = value;
CanWriteProperty("DTS", true); PropertyHasChanged();
if (_DTS != value) }
{ }
_DTS = value; }
PropertyHasChanged(); private string _UserID = string.Empty;
} public string UserID
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _UserID = string.Empty; get
public string UserID {
{ return _UserID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
CanReadProperty("UserID", true); {
return _UserID; if (value == null) value = string.Empty;
} if (_UserID != value)
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
set _UserID = value;
{ PropertyHasChanged();
CanWriteProperty("UserID", true); }
if (value == null) value = string.Empty; }
if (_UserID != value) }
{ private byte[] _LastChanged = new byte[8];//timestamp
_UserID = value; private string _Content_Number = string.Empty;
PropertyHasChanged(); /// <summary>
} /// Increased from 30 to 256 to support RTF symbols
} /// </summary>
} public string Content_Number
private byte[] _LastChanged = new byte[8];//timestamp {
private string _Content_Number = string.Empty; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// <summary> get
/// Increased from 30 to 256 to support RTF symbols {
/// </summary> return _Content_Number;
public string Content_Number }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private string _Content_Text = string.Empty;
get public string Content_Text
{ {
CanReadProperty("Content_Number", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _Content_Number; get
} {
} return _Content_Text;
private string _Content_Text = string.Empty; }
public string Content_Text }
{ private int? _Content_Type;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// 0 - Procedure, 10000 - Section, 20000 Step
{ /// </summary>
CanReadProperty("Content_Text", true); public int? Content_Type
return _Content_Text; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int? _Content_Type; {
/// <summary> return _Content_Type;
/// 0 - Procedure, 10000 - Section, 20000 Step }
/// </summary> }
public int? Content_Type private int? _Content_FormatID;
{ public int? Content_FormatID
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
CanReadProperty("Content_Type", true); {
return _Content_Type; return _Content_FormatID;
} }
} }
private int? _Content_FormatID; private string _Content_Config = string.Empty;
public int? Content_FormatID public string Content_Config
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("Content_FormatID", true); return _Content_Config;
return _Content_FormatID; }
} }
} private DateTime _Content_DTS = new DateTime();
private string _Content_Config = string.Empty; public DateTime Content_DTS
public string Content_Config {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
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(); {
public DateTime Content_DTS [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _Content_UserID;
{ }
CanReadProperty("Content_DTS", true); }
return _Content_DTS; // CSLATODO: Check DocumentEntry.GetIdValue to assure that the ID returned is unique
} /// <summary>
} /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
private string _Content_UserID = string.Empty; /// </summary>
public string Content_UserID /// <returns>A Unique ID for the current DocumentEntry</returns>
{ protected override object GetIdValue()
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return MyDocumentEntryUnique; // Absolutely Unique ID
{ }
CanReadProperty("Content_UserID", true); // CSLATODO: Replace base DocumentEntry.ToString function as necessary
return _Content_UserID; /// <summary>
} /// Overrides Base ToString
} /// </summary>
// CSLATODO: Check DocumentEntry.GetIdValue to assure that the ID returned is unique /// <returns>A string representation of current DocumentEntry</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 DocumentEntry</returns> //}
protected override object GetIdValue() public override bool IsDirty
{ {
return MyDocumentEntryUnique; // Absolutely Unique ID get { return base.IsDirty; }
} }
// CSLATODO: Replace base DocumentEntry.ToString function as necessary public bool IsDirtyList(List<object> list)
/// <summary> {
/// Overrides Base ToString return base.IsDirty;
/// </summary> }
/// <returns>A string representation of current DocumentEntry</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, "UserID");
public BrokenRulesCollection BrokenRules ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringMaxLength,
get new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
{ // CSLATODO: Add other validation rules
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; }
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; // Sample data comparison validation rule
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
} //{
} // if (_started > _ended)
protected override void AddBusinessRules() // {
{ // 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(ContentID, "<Role(s)>");
// { //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
// e.Description = "Start date can't be after end date"; //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
// return false; //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
// } //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
// else }
// return true; public static bool CanAddObject()
//} {
#endregion // CSLATODO: Can Add Authorization
#region Authorization Rules //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
protected override void AddAuthorizationRules() return true;
{ }
//CSLATODO: Who can read/write which fields public static bool CanGetObject()
//AuthorizationRules.AllowRead(ContentID, "<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 _DocumentEntryUnique = 0;
return true; private static int DocumentEntryUnique
} { get { return ++_DocumentEntryUnique; } }
public static bool CanEditObject() private int _MyDocumentEntryUnique = DocumentEntryUnique;
{ public int MyDocumentEntryUnique // Absolutely Unique ID - Editable FK
// CSLATODO: CanEdit Authorization { get { return _MyDocumentEntryUnique; } }
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); internal static DocumentEntry New(Entry myEntry)
return true; {
} return new DocumentEntry(myEntry);
#endregion }
#region Factory Methods internal static DocumentEntry Get(SafeDataReader dr)
public int CurrentEditLevel {
{ get { return EditLevel; } } return new DocumentEntry(dr);
private static int _DocumentEntryUnique = 0; }
private static int DocumentEntryUnique public DocumentEntry()
{ get { return ++_DocumentEntryUnique; } } {
private int _MyDocumentEntryUnique = DocumentEntryUnique; MarkAsChild();
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,496 +19,482 @@ 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
{ {
CanReadProperty("DocID", true); return _DocID;
return _DocID; }
} }
} private string _LibTitle = string.Empty;
private string _LibTitle = string.Empty; public string LibTitle
public string LibTitle {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ return _LibTitle;
CanReadProperty("LibTitle", true); }
return _LibTitle; }
} private byte[] _DocContent;
} /// <summary>
private byte[] _DocContent; /// Actual content of a Word Document (RTF, DOC or XML Format)
/// <summary> /// </summary>
/// Actual content of a Word Document (RTF, DOC or XML Format) public byte[] DocContent
/// </summary> {
public byte[] DocContent [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _DocContent;
{ }
CanReadProperty("DocContent", true); }
return _DocContent; private string _DocAscii = string.Empty;
} /// <summary>
} /// Used for searching
private string _DocAscii = string.Empty; /// </summary>
/// <summary> public string DocAscii
/// Used for searching {
/// </summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public string DocAscii get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _DocAscii;
get }
{ }
CanReadProperty("DocAscii", true); private string _Config = string.Empty;
return _DocAscii; public string Config
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _Config = string.Empty; get
public string Config {
{ return _Config;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private DateTime _DTS = new DateTime();
CanReadProperty("Config", true); public DateTime DTS
return _Config; {
} [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)] private string _FileExtension = string.Empty;
get public string FileExtension
{ {
CanReadProperty("UserID", true); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
return _UserID; get
} {
} return _FileExtension;
private string _FileExtension = string.Empty; }
public string FileExtension }
{ private int _DocumentDROUsageCount = 0;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Count of DocumentDROUsages for this Document
{ /// </summary>
CanReadProperty("FileExtension", true); public int DocumentDROUsageCount
return _FileExtension; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int _DocumentDROUsageCount = 0; {
/// <summary> if (_DocumentDROUsageCount < 0)
/// Count of DocumentDROUsages for this Document _DocumentDROUsageCount = DocumentDROUsages.Count;
/// </summary> return _DocumentDROUsageCount;
public int DocumentDROUsageCount }
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private DROUsageInfoList _DocumentDROUsages = null;
get [TypeConverter(typeof(DROUsageInfoListConverter))]
{ public DROUsageInfoList DocumentDROUsages
CanReadProperty("DocumentDROUsageCount", true); {
if (_DocumentDROUsageCount < 0) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_DocumentDROUsageCount = DocumentDROUsages.Count; get
return _DocumentDROUsageCount; {
} if (_DocumentDROUsageCount < 0 || (_DocumentDROUsageCount > 0 && _DocumentDROUsages == null))
} _DocumentDROUsages = DROUsageInfoList.GetByDocID(_DocID);
private DROUsageInfoList _DocumentDROUsages = null; if (_DocumentDROUsageCount < 0)
[TypeConverter(typeof(DROUsageInfoListConverter))] _DocumentDROUsageCount = _DocumentDROUsages.Count;
public DROUsageInfoList DocumentDROUsages return _DocumentDROUsages;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get public void RefreshDocumentDROUsages()
{ {
CanReadProperty("DocumentDROUsages", true); _DocumentDROUsageCount = -1;
if (_DocumentDROUsageCount < 0 || (_DocumentDROUsageCount > 0 && _DocumentDROUsages == null)) ConvertListToDictionary();
_DocumentDROUsages = DROUsageInfoList.GetByDocID(_DocID); if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
if (_DocumentDROUsageCount < 0) foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
_DocumentDROUsageCount = _DocumentDROUsages.Count; tmp._DocumentDROUsageCount = -1; // This will cause the data to be requeried
return _DocumentDROUsages; }
} private int _DocumentEntryCount = 0;
} /// <summary>
public void RefreshDocumentDROUsages() /// Count of DocumentEntries for this Document
{ /// </summary>
_DocumentDROUsageCount = -1; public int DocumentEntryCount
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) get
tmp._DocumentDROUsageCount = -1; // This will cause the data to be requeried {
} if (_DocumentEntryCount < 0)
private int _DocumentEntryCount = 0; _DocumentEntryCount = DocumentEntries.Count;
/// <summary> return _DocumentEntryCount;
/// Count of DocumentEntries for this Document }
/// </summary> }
public int DocumentEntryCount private EntryInfoList _DocumentEntries = null;
{ [TypeConverter(typeof(EntryInfoListConverter))]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] public EntryInfoList DocumentEntries
get {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
CanReadProperty("DocumentEntryCount", true); get
if (_DocumentEntryCount < 0) {
_DocumentEntryCount = DocumentEntries.Count; if (_DocumentEntryCount < 0 || (_DocumentEntryCount > 0 && _DocumentEntries == null))
return _DocumentEntryCount; _DocumentEntries = EntryInfoList.GetByDocID(_DocID);
} if (_DocumentEntryCount < 0)
} _DocumentEntryCount = _DocumentEntries.Count;
private EntryInfoList _DocumentEntries = null; return _DocumentEntries;
[TypeConverter(typeof(EntryInfoListConverter))] }
public EntryInfoList DocumentEntries }
{ public void RefreshDocumentEntries()
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get _DocumentEntryCount = -1;
{ ConvertListToDictionary();
CanReadProperty("DocumentEntries", true); if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
if (_DocumentEntryCount < 0 || (_DocumentEntryCount > 0 && _DocumentEntries == null)) foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
_DocumentEntries = EntryInfoList.GetByDocID(_DocID); tmp._DocumentEntryCount = -1; // This will cause the data to be requeried
if (_DocumentEntryCount < 0) }
_DocumentEntryCount = _DocumentEntries.Count; private int _DocumentPdfCount = 0;
return _DocumentEntries; /// <summary>
} /// Count of DocumentPdfs for this Document
} /// </summary>
public void RefreshDocumentEntries() public int DocumentPdfCount
{ {
_DocumentEntryCount = -1; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
ConvertListToDictionary(); get
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) {
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) if (_DocumentPdfCount < 0)
tmp._DocumentEntryCount = -1; // This will cause the data to be requeried _DocumentPdfCount = DocumentPdfs.Count;
} return _DocumentPdfCount;
private int _DocumentPdfCount = 0; }
/// <summary> }
/// Count of DocumentPdfs for this Document private PdfInfoList _DocumentPdfs = null;
/// </summary> [TypeConverter(typeof(PdfInfoListConverter))]
public int DocumentPdfCount public PdfInfoList DocumentPdfs
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get get
{ {
CanReadProperty("DocumentPdfCount", true); if (_DocumentPdfCount < 0 || (_DocumentPdfCount > 0 && _DocumentPdfs == null))
if (_DocumentPdfCount < 0) _DocumentPdfs = PdfInfoList.GetByDocID(_DocID);
_DocumentPdfCount = DocumentPdfs.Count; if (_DocumentPdfCount < 0)
return _DocumentPdfCount; _DocumentPdfCount = _DocumentPdfs.Count;
} return _DocumentPdfs;
} }
private PdfInfoList _DocumentPdfs = null; }
[TypeConverter(typeof(PdfInfoListConverter))] public void RefreshDocumentPdfs()
public PdfInfoList DocumentPdfs {
{ _DocumentPdfCount = -1;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] ConvertListToDictionary();
get if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString()))
{ foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()])
CanReadProperty("DocumentPdfs", true); tmp._DocumentPdfCount = -1; // This will cause the data to be requeried
if (_DocumentPdfCount < 0 || (_DocumentPdfCount > 0 && _DocumentPdfs == null)) }
_DocumentPdfs = PdfInfoList.GetByDocID(_DocID); // CSLATODO: Replace base DocumentInfo.ToString function as necessary
if (_DocumentPdfCount < 0) /// <summary>
_DocumentPdfCount = _DocumentPdfs.Count; /// Overrides Base ToString
return _DocumentPdfs; /// </summary>
} /// <returns>A string representation of current DocumentInfo</returns>
} //public override string ToString()
public void RefreshDocumentPdfs() //{
{ // return base.ToString();
_DocumentPdfCount = -1; //}
ConvertListToDictionary(); // CSLATODO: Check DocumentInfo.GetIdValue to assure that the ID returned is unique
if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) /// <summary>
foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
tmp._DocumentPdfCount = -1; // This will cause the data to be requeried /// </summary>
} /// <returns>A Unique ID for the current DocumentInfo</returns>
// CSLATODO: Replace base DocumentInfo.ToString function as necessary protected override object GetIdValue()
/// <summary> {
/// Overrides Base ToString return MyDocumentInfoUnique; // Absolutely Unique ID
/// </summary> }
/// <returns>A string representation of current DocumentInfo</returns> #endregion
//public override string ToString() #region Factory Methods
//{ private static int _DocumentInfoUnique = 0;
// return base.ToString(); private static int DocumentInfoUnique
//} { get { return ++_DocumentInfoUnique; } }
// CSLATODO: Check DocumentInfo.GetIdValue to assure that the ID returned is unique private int _MyDocumentInfoUnique = DocumentInfoUnique;
/// <summary> public int MyDocumentInfoUnique // Absolutely Unique ID - Info
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality { get { return _MyDocumentInfoUnique; } }
/// </summary> protected DocumentInfo()
/// <returns>A Unique ID for the current DocumentInfo</returns> {/* require use of factory methods */
protected override object GetIdValue() AddToCache(this);
{ }
return MyDocumentInfoUnique; // Absolutely Unique ID private bool _Disposed = false;
} private static int _CountCreated = 0;
#endregion private static int _CountDisposed = 0;
#region Factory Methods private static int _CountFinalized = 0;
private static int _DocumentInfoUnique = 0; private static int IncrementCountCreated
private static int DocumentInfoUnique { get { return ++_CountCreated; } }
{ get { return ++_DocumentInfoUnique; } } private int _CountWhenCreated = IncrementCountCreated;
private int _MyDocumentInfoUnique = DocumentInfoUnique; public static int CountCreated
public int MyDocumentInfoUnique // Absolutely Unique ID - Info { get { return _CountCreated; } }
{ get { return _MyDocumentInfoUnique; } } public static int CountNotDisposed
protected DocumentInfo() { get { return _CountCreated - _CountDisposed; } }
{/* require use of factory methods */ public static int CountNotFinalized
AddToCache(this); { get { return _CountCreated - _CountFinalized; } }
} ~DocumentInfo()
private bool _Disposed = false; {
private static int _CountCreated = 0; _CountFinalized++;
private static int _CountDisposed = 0; }
private static int _CountFinalized = 0; public void Dispose()
private static int IncrementCountCreated {
{ get { return ++_CountCreated; } } if (_Disposed) return;
private int _CountWhenCreated = IncrementCountCreated; _CountDisposed++;
public static int CountCreated _Disposed = true;
{ get { return _CountCreated; } } RemoveFromCache(this);
public static int CountNotDisposed if (!_CacheByPrimaryKey.ContainsKey(DocID.ToString())) return;
{ get { return _CountCreated - _CountDisposed; } } List<DocumentInfo> listDocumentInfo = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items
public static int CountNotFinalized while (listDocumentInfo.Contains(this)) listDocumentInfo.Remove(this); // Remove the item from the list
{ get { return _CountCreated - _CountFinalized; } } if (listDocumentInfo.Count == 0) // If there are no items left in the list
~DocumentInfo() _CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list
{ }
_CountFinalized++; public virtual Document Get()
} {
public void Dispose() return _Editable = Document.Get(_DocID);
{ }
if (_Disposed) return; public static void Refresh(Document tmp)
_CountDisposed++; {
_Disposed = true; string key = tmp.DocID.ToString();
RemoveFromCache(this); ConvertListToDictionary();
if (!_CacheByPrimaryKey.ContainsKey(DocID.ToString())) return; if (_CacheByPrimaryKey.ContainsKey(key))
List<DocumentInfo> listDocumentInfo = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items foreach (DocumentInfo tmpInfo in _CacheByPrimaryKey[key])
while (listDocumentInfo.Contains(this)) listDocumentInfo.Remove(this); // Remove the item from the list tmpInfo.RefreshFields(tmp);
if (listDocumentInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list protected virtual void RefreshFields(Document tmp)
} {
public virtual Document Get() _LibTitle = tmp.LibTitle;
{ _DocContent = tmp.DocContent;
return _Editable = Document.Get(_DocID); _DocAscii = tmp.DocAscii;
} _Config = tmp.Config;
public static void Refresh(Document tmp) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
string key = tmp.DocID.ToString(); _FileExtension = tmp.FileExtension;
ConvertListToDictionary(); _DocumentInfoExtension.Refresh(this);
if (_CacheByPrimaryKey.ContainsKey(key)) OnChange();// raise an event
foreach (DocumentInfo tmpInfo in _CacheByPrimaryKey[key]) }
tmpInfo.RefreshFields(tmp); public static DocumentInfo Get(int docID)
} {
protected virtual void RefreshFields(Document tmp) //if (!CanGetObject())
{ // throw new System.Security.SecurityException("User not authorized to view a Document");
_LibTitle = tmp.LibTitle; try
_DocContent = tmp.DocContent; {
_DocAscii = tmp.DocAscii; DocumentInfo tmp = GetCachedByPrimaryKey(docID);
_Config = tmp.Config; if (tmp == null)
_DTS = tmp.DTS; {
_UserID = tmp.UserID; tmp = DataPortal.Fetch<DocumentInfo>(new PKCriteria(docID));
_FileExtension = tmp.FileExtension; AddToCache(tmp);
_DocumentInfoExtension.Refresh(this); }
OnChange();// raise an event if (tmp.ErrorMessage == "No Record Found")
} {
public static DocumentInfo Get(int docID) tmp.Dispose(); // Clean-up DocumentInfo
{ tmp = null;
//if (!CanGetObject()) }
// throw new System.Security.SecurityException("User not authorized to view a Document"); return tmp;
try }
{ catch (Exception ex)
DocumentInfo tmp = GetCachedByPrimaryKey(docID); {
if (tmp == null) throw new DbCslaException("Error on DocumentInfo.Get", ex);
{ }
tmp = DataPortal.Fetch<DocumentInfo>(new PKCriteria(docID)); }
AddToCache(tmp); #endregion
} #region Data Access Portal
if (tmp.ErrorMessage == "No Record Found") internal DocumentInfo(SafeDataReader dr)
{ {
tmp.Dispose(); // Clean-up DocumentInfo if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.Constructor", GetHashCode());
tmp = null; try
} {
return tmp; ReadData(dr);
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new DbCslaException("Error on DocumentInfo.Get", ex); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.Constructor", ex);
} throw new DbCslaException("DocumentInfo.Constructor", ex);
} }
#endregion }
#region Data Access Portal [Serializable()]
internal DocumentInfo(SafeDataReader dr) protected class PKCriteria
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.Constructor", GetHashCode()); private int _DocID;
try public int DocID
{ { get { return _DocID; } }
ReadData(dr); public PKCriteria(int docID)
} {
catch (Exception ex) _DocID = docID;
{ }
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.Constructor", ex); }
throw new DbCslaException("DocumentInfo.Constructor", ex); private void ReadData(SafeDataReader dr)
} {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.ReadData", GetHashCode());
[Serializable()] try
protected class PKCriteria {
{ _DocID = dr.GetInt32("DocID");
private int _DocID; _LibTitle = dr.GetString("LibTitle");
public int DocID _DocContent = (byte[])dr.GetValue("DocContent");
{ get { return _DocID; } } _DocAscii = dr.GetString("DocAscii");
public PKCriteria(int docID) _Config = dr.GetString("Config");
{ _DTS = dr.GetDateTime("DTS");
_DocID = docID; _UserID = dr.GetString("UserID");
} _FileExtension = dr.GetString("FileExtension");
} _DocumentDROUsageCount = dr.GetInt32("DROUsageCount");
private void ReadData(SafeDataReader dr) _DocumentEntryCount = dr.GetInt32("EntryCount");
{ _DocumentPdfCount = dr.GetInt32("PdfCount");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.ReadData", GetHashCode()); }
try catch (Exception ex)
{ {
_DocID = dr.GetInt32("DocID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.ReadData", ex);
_LibTitle = dr.GetString("LibTitle"); _ErrorMessage = ex.Message;
_DocContent = (byte[])dr.GetValue("DocContent"); throw new DbCslaException("DocumentInfo.ReadData", ex);
_DocAscii = dr.GetString("DocAscii"); }
_Config = dr.GetString("Config"); }
_DTS = dr.GetDateTime("DTS"); private void DataPortal_Fetch(PKCriteria criteria)
_UserID = dr.GetString("UserID"); {
_FileExtension = dr.GetString("FileExtension"); if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode());
_DocumentDROUsageCount = dr.GetInt32("DROUsageCount"); try
_DocumentEntryCount = dr.GetInt32("EntryCount"); {
_DocumentPdfCount = dr.GetInt32("PdfCount"); using (SqlConnection cn = Database.VEPROMS_SqlConnection)
} {
catch (Exception ex) ApplicationContext.LocalContext["cn"] = cn;
{ using (SqlCommand cm = cn.CreateCommand())
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.ReadData", ex); {
_ErrorMessage = ex.Message; cm.CommandType = CommandType.StoredProcedure;
throw new DbCslaException("DocumentInfo.ReadData", ex); cm.CommandText = "getDocument";
} cm.Parameters.AddWithValue("@DocID", criteria.DocID);
} cm.CommandTimeout = Database.DefaultTimeout;
private void DataPortal_Fetch(PKCriteria criteria) using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{ {
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode()); if (!dr.Read())
try {
{ _ErrorMessage = "No Record Found";
using (SqlConnection cn = Database.VEPROMS_SqlConnection) return;
{ }
ApplicationContext.LocalContext["cn"] = cn; ReadData(dr);
using (SqlCommand cm = cn.CreateCommand()) }
{ }
cm.CommandType = CommandType.StoredProcedure; // removing of item only needed for local data portal
cm.CommandText = "getDocument"; if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
cm.Parameters.AddWithValue("@DocID", criteria.DocID); ApplicationContext.LocalContext.Remove("cn");
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 = "No Record Found"; _ErrorMessage = ex.Message;
return; throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex);
} }
ReadData(dr); }
} #endregion
} // Standard Refresh
// removing of item only needed for local data portal #region extension
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) DocumentInfoExtension _DocumentInfoExtension = new DocumentInfoExtension();
ApplicationContext.LocalContext.Remove("cn"); [Serializable()]
} partial class DocumentInfoExtension : extensionBase { }
} [Serializable()]
catch (Exception ex) class extensionBase
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.DataPortal_Fetch", ex); // Default Refresh
_ErrorMessage = ex.Message; public virtual void Refresh(DocumentInfo tmp) { }
throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex); }
} #endregion
} } // Class
#endregion #region Converter
// Standard Refresh internal class DocumentInfoConverter : ExpandableObjectConverter
#region extension {
DocumentInfoExtension _DocumentInfoExtension = new DocumentInfoExtension(); public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
[Serializable()] {
partial class DocumentInfoExtension : extensionBase { } if (destType == typeof(string) && value is DocumentInfo)
[Serializable()] {
class extensionBase // Return the ToString value
{ return ((DocumentInfo)value).ToString();
// Default Refresh }
public virtual void Refresh(DocumentInfo tmp) { } return base.ConvertTo(context, culture, value, destType);
} }
#endregion }
} // Class #endregion
#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,471 +20,458 @@ 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
{ {
CanReadProperty("DebugStatus", true); return _DebugStatus;
return _DebugStatus; }
} }
} private int _TopRow;
private int _TopRow; [System.ComponentModel.DataObjectField(true, true)]
[System.ComponentModel.DataObjectField(true, true)] public int TopRow
public int TopRow {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ return _TopRow;
CanReadProperty("TopRow", true); }
return _TopRow; }
} private int _PageLength;
} [System.ComponentModel.DataObjectField(true, true)]
private int _PageLength; public int PageLength
[System.ComponentModel.DataObjectField(true, true)] {
public int PageLength [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get return _PageLength;
{ }
CanReadProperty("PageLength", true); }
return _PageLength; private int _LeftMargin;
} [System.ComponentModel.DataObjectField(true, true)]
} public int LeftMargin
private int _LeftMargin; {
[System.ComponentModel.DataObjectField(true, true)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int LeftMargin get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _LeftMargin;
get }
{ }
CanReadProperty("LeftMargin", true); private int _PageWidth;
return _LeftMargin; [System.ComponentModel.DataObjectField(true, true)]
} public int PageWidth
} {
private int _PageWidth; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.ComponentModel.DataObjectField(true, true)] get
public int PageWidth {
{ return _PageWidth;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private double _PageCount;
CanReadProperty("PageWidth", true); /// <summary>
return _PageWidth; /// Count of whole and partial pages
} /// </summary>
} public double PageCount
private double _PageCount; {
/// <summary> [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
/// Count of whole and partial pages get
/// </summary> {
public double PageCount return _PageCount;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get set
{ {
CanReadProperty("PageCount", true); if (_PageCount != value)
return _PageCount; {
} _PageCount = value;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] PropertyHasChanged();
set }
{ }
CanWriteProperty("PageCount", true); }
if (_PageCount != value) private byte[] _DocPdf;
{ public byte[] DocPdf
_PageCount = value; {
PropertyHasChanged(); [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
} {
} return _DocPdf;
private byte[] _DocPdf; }
public byte[] DocPdf [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ set
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_DocPdf != value)
{ {
CanReadProperty("DocPdf", true); _DocPdf = value;
return _DocPdf; PropertyHasChanged();
} }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
set }
{ private DateTime _DTS = new DateTime();
CanWriteProperty("DocPdf", true); public DateTime DTS
if (_DocPdf != value) {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
_DocPdf = 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 DocumentPdf.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 DocumentPdf</returns>
if (_UserID != value) protected override object GetIdValue()
{ {
_UserID = value; return MyDocumentPdfUnique; // Absolutely Unique ID
PropertyHasChanged(); }
} // CSLATODO: Replace base DocumentPdf.ToString function as necessary
} /// <summary>
} /// Overrides Base ToString
private byte[] _LastChanged = new byte[8];//timestamp /// </summary>
// CSLATODO: Check DocumentPdf.GetIdValue to assure that the ID returned is unique /// <returns>A string representation of current DocumentPdf</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 DocumentPdf</returns> //}
protected override object GetIdValue() public override bool IsDirty
{ {
return MyDocumentPdfUnique; // Absolutely Unique ID get { return base.IsDirty; }
} }
// CSLATODO: Replace base DocumentPdf.ToString function as necessary public bool IsDirtyList(List<object> list)
/// <summary> {
/// Overrides Base ToString return base.IsDirty;
/// </summary> }
/// <returns>A string representation of current DocumentPdf</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, "UserID");
public BrokenRulesCollection BrokenRules ValidationRules.AddRule(
{ Csla.Validation.CommonRules.StringMaxLength,
get new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100));
{ // CSLATODO: Add other validation rules
IVEHasBrokenRules hasBrokenRules = HasBrokenRules; }
if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; // Sample data comparison validation rule
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e)
} //{
} // if (_started > _ended)
protected override void AddBusinessRules() // {
{ // 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(DebugStatus, "<Role(s)>");
// { //AuthorizationRules.AllowRead(TopRow, "<Role(s)>");
// e.Description = "Start date can't be after end date"; //AuthorizationRules.AllowRead(PageLength, "<Role(s)>");
// return false; //AuthorizationRules.AllowRead(LeftMargin, "<Role(s)>");
// } //AuthorizationRules.AllowRead(PageWidth, "<Role(s)>");
// else //AuthorizationRules.AllowRead(PageCount, "<Role(s)>");
// return true; //AuthorizationRules.AllowWrite(PageCount, "<Role(s)>");
//} //AuthorizationRules.AllowRead(DocPdf, "<Role(s)>");
#endregion //AuthorizationRules.AllowWrite(DocPdf, "<Role(s)>");
#region Authorization Rules //AuthorizationRules.AllowRead(DTS, "<Role(s)>");
protected override void AddAuthorizationRules() //AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
{ //AuthorizationRules.AllowRead(UserID, "<Role(s)>");
//CSLATODO: Who can read/write which fields //AuthorizationRules.AllowWrite(UserID, "<Role(s)>");
//AuthorizationRules.AllowRead(DebugStatus, "<Role(s)>"); }
//AuthorizationRules.AllowRead(TopRow, "<Role(s)>"); public static bool CanAddObject()
//AuthorizationRules.AllowRead(PageLength, "<Role(s)>"); {
//AuthorizationRules.AllowRead(LeftMargin, "<Role(s)>"); // CSLATODO: Can Add Authorization
//AuthorizationRules.AllowRead(PageWidth, "<Role(s)>"); //return Csla.ApplicationContext.User.IsInRole("ProjectManager");
//AuthorizationRules.AllowRead(PageCount, "<Role(s)>"); return true;
//AuthorizationRules.AllowWrite(PageCount, "<Role(s)>"); }
//AuthorizationRules.AllowRead(DocPdf, "<Role(s)>"); public static bool CanGetObject()
//AuthorizationRules.AllowWrite(DocPdf, "<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 _DocumentPdfUnique = 0;
return true; private static int DocumentPdfUnique
} { get { return ++_DocumentPdfUnique; } }
public static bool CanEditObject() private int _MyDocumentPdfUnique = DocumentPdfUnique;
{ public int MyDocumentPdfUnique // Absolutely Unique ID - Editable FK
// CSLATODO: CanEdit Authorization { get { return _MyDocumentPdfUnique; } }
//return Csla.ApplicationContext.User.IsInRole("ProjectManager"); internal static DocumentPdf New(int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount)
return true; {
} return new DocumentPdf(debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount);
#endregion }
#region Factory Methods internal static DocumentPdf Get(SafeDataReader dr)
public int CurrentEditLevel {
{ get { return EditLevel; } } return new DocumentPdf(dr);
private static int _DocumentPdfUnique = 0; }
private static int DocumentPdfUnique public DocumentPdf()
{ get { return ++_DocumentPdfUnique; } } {
private int _MyDocumentPdfUnique = DocumentPdfUnique; MarkAsChild();
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,349 +19,343 @@ 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
{ {
CanReadProperty("AuditID", true); return _AuditID;
return _AuditID; }
} }
} private int _ContentID;
private int _ContentID; 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 {
{ return _ContentID;
CanReadProperty("ContentID", true); }
return _ContentID; }
} 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 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 }
{ }
CanReadProperty("DTS", true); private string _UserID = string.Empty;
return _DTS; public string UserID
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private string _UserID = string.Empty; get
public string UserID {
{ return _UserID;
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get }
{ private int _DeleteStatus;
CanReadProperty("UserID", true); public int DeleteStatus
return _UserID; {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
} get
private int _DeleteStatus; {
public int DeleteStatus return _DeleteStatus;
{ }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] }
get // CSLATODO: Replace base EntryAuditInfo.ToString function as necessary
{ /// <summary>
CanReadProperty("DeleteStatus", true); /// Overrides Base ToString
return _DeleteStatus; /// </summary>
} /// <returns>A string representation of current EntryAuditInfo</returns>
} //public override string ToString()
// CSLATODO: Replace base EntryAuditInfo.ToString function as necessary //{
/// <summary> // return base.ToString();
/// Overrides Base ToString //}
/// </summary> // CSLATODO: Check EntryAuditInfo.GetIdValue to assure that the ID returned is unique
/// <returns>A string representation of current EntryAuditInfo</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 EntryAuditInfo</returns>
//} protected override object GetIdValue()
// CSLATODO: Check EntryAuditInfo.GetIdValue to assure that the ID returned is unique {
/// <summary> return MyEntryAuditInfoUnique; // Absolutely Unique ID
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality }
/// </summary> #endregion
/// <returns>A Unique ID for the current EntryAuditInfo</returns> #region Factory Methods
protected override object GetIdValue() private static int _EntryAuditInfoUnique = 0;
{ private static int EntryAuditInfoUnique
return MyEntryAuditInfoUnique; // Absolutely Unique ID { get { return ++_EntryAuditInfoUnique; } }
} private int _MyEntryAuditInfoUnique = EntryAuditInfoUnique;
#endregion public int MyEntryAuditInfoUnique // Absolutely Unique ID - Info
#region Factory Methods { get { return _MyEntryAuditInfoUnique; } }
private static int _EntryAuditInfoUnique = 0; protected EntryAuditInfo()
private static int EntryAuditInfoUnique {/* require use of factory methods */
{ get { return ++_EntryAuditInfoUnique; } } AddToCache(this);
private int _MyEntryAuditInfoUnique = EntryAuditInfoUnique; }
public int MyEntryAuditInfoUnique // Absolutely Unique ID - Info private bool _Disposed = false;
{ get { return _MyEntryAuditInfoUnique; } } private static int _CountCreated = 0;
protected EntryAuditInfo() private static int _CountDisposed = 0;
{/* require use of factory methods */ private static int _CountFinalized = 0;
AddToCache(this); private static int IncrementCountCreated
} { get { return ++_CountCreated; } }
private bool _Disposed = false; private int _CountWhenCreated = IncrementCountCreated;
private static int _CountCreated = 0; public static int CountCreated
private static int _CountDisposed = 0; { get { return _CountCreated; } }
private static int _CountFinalized = 0; public static int CountNotDisposed
private static int IncrementCountCreated { get { return _CountCreated - _CountDisposed; } }
{ get { return ++_CountCreated; } } public static int CountNotFinalized
private int _CountWhenCreated = IncrementCountCreated; { get { return _CountCreated - _CountFinalized; } }
public static int CountCreated ~EntryAuditInfo()
{ get { return _CountCreated; } } {
public static int CountNotDisposed _CountFinalized++;
{ get { return _CountCreated - _CountDisposed; } } }
public static int CountNotFinalized public void Dispose()
{ get { return _CountCreated - _CountFinalized; } } {
~EntryAuditInfo() if (_Disposed) return;
{ _CountDisposed++;
_CountFinalized++; _Disposed = true;
} RemoveFromCache(this);
public void Dispose() if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return;
{ List<EntryAuditInfo> listEntryAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items
if (_Disposed) return; while (listEntryAuditInfo.Contains(this)) listEntryAuditInfo.Remove(this); // Remove the item from the list
_CountDisposed++; if (listEntryAuditInfo.Count == 0) // If there are no items left in the list
_Disposed = true; _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; public virtual EntryAudit Get()
List<EntryAuditInfo> listEntryAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items {
while (listEntryAuditInfo.Contains(this)) listEntryAuditInfo.Remove(this); // Remove the item from the list return _Editable = EntryAudit.Get(_AuditID);
if (listEntryAuditInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list public static void Refresh(EntryAudit tmp)
} {
public virtual EntryAudit Get() string key = tmp.AuditID.ToString();
{ ConvertListToDictionary();
return _Editable = EntryAudit.Get(_AuditID); if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (EntryAuditInfo tmpInfo in _CacheByPrimaryKey[key])
public static void Refresh(EntryAudit tmp) tmpInfo.RefreshFields(tmp);
{ }
string key = tmp.AuditID.ToString(); protected virtual void RefreshFields(EntryAudit tmp)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) _ContentID = tmp.ContentID;
foreach (EntryAuditInfo tmpInfo in _CacheByPrimaryKey[key]) _DocID = tmp.DocID;
tmpInfo.RefreshFields(tmp); _DTS = tmp.DTS;
} _UserID = tmp.UserID;
protected virtual void RefreshFields(EntryAudit tmp) _DeleteStatus = tmp.DeleteStatus;
{ _EntryAuditInfoExtension.Refresh(this);
_ContentID = tmp.ContentID; OnChange();// raise an event
_DocID = tmp.DocID; }
_DTS = tmp.DTS; public static EntryAuditInfo Get(long auditID)
_UserID = tmp.UserID; {
_DeleteStatus = tmp.DeleteStatus; //if (!CanGetObject())
_EntryAuditInfoExtension.Refresh(this); // throw new System.Security.SecurityException("User not authorized to view a EntryAudit");
OnChange();// raise an event try
} {
public static EntryAuditInfo Get(long auditID) EntryAuditInfo tmp = GetCachedByPrimaryKey(auditID);
{ if (tmp == null)
//if (!CanGetObject()) {
// throw new System.Security.SecurityException("User not authorized to view a EntryAudit"); tmp = DataPortal.Fetch<EntryAuditInfo>(new PKCriteria(auditID));
try AddToCache(tmp);
{ }
EntryAuditInfo tmp = GetCachedByPrimaryKey(auditID); if (tmp.ErrorMessage == "No Record Found")
if (tmp == null) {
{ tmp.Dispose(); // Clean-up EntryAuditInfo
tmp = DataPortal.Fetch<EntryAuditInfo>(new PKCriteria(auditID)); tmp = null;
AddToCache(tmp); }
} return tmp;
if (tmp.ErrorMessage == "No Record Found") }
{ catch (Exception ex)
tmp.Dispose(); // Clean-up EntryAuditInfo {
tmp = null; throw new DbCslaException("Error on EntryAuditInfo.Get", ex);
} }
return tmp; }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal EntryAuditInfo(SafeDataReader dr)
throw new DbCslaException("Error on EntryAuditInfo.Get", ex); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.Constructor", GetHashCode());
} try
#endregion {
#region Data Access Portal ReadData(dr);
internal EntryAuditInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.Constructor", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.Constructor", ex);
{ throw new DbCslaException("EntryAuditInfo.Constructor", ex);
ReadData(dr); }
} }
catch (Exception ex) [Serializable()]
{ protected class PKCriteria
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.Constructor", ex); {
throw new DbCslaException("EntryAuditInfo.Constructor", ex); private long _AuditID;
} public long AuditID
} { get { return _AuditID; } }
[Serializable()] public PKCriteria(long auditID)
protected class PKCriteria {
{ _AuditID = auditID;
private long _AuditID; }
public long AuditID }
{ get { return _AuditID; } } private void ReadData(SafeDataReader dr)
public PKCriteria(long auditID) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.ReadData", GetHashCode());
_AuditID = auditID; try
} {
} _AuditID = dr.GetInt64("AuditID");
private void ReadData(SafeDataReader dr) _ContentID = dr.GetInt32("ContentID");
{ _DocID = dr.GetInt32("DocID");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.ReadData", GetHashCode()); _DTS = dr.GetDateTime("DTS");
try _UserID = dr.GetString("UserID");
{ _DeleteStatus = dr.GetInt32("DeleteStatus");
_AuditID = dr.GetInt64("AuditID"); }
_ContentID = dr.GetInt32("ContentID"); catch (Exception ex)
_DocID = dr.GetInt32("DocID"); {
_DTS = dr.GetDateTime("DTS"); if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.ReadData", ex);
_UserID = dr.GetString("UserID"); _ErrorMessage = ex.Message;
_DeleteStatus = dr.GetInt32("DeleteStatus"); throw new DbCslaException("EntryAuditInfo.ReadData", ex);
} }
catch (Exception ex) }
{ private void DataPortal_Fetch(PKCriteria criteria)
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.ReadData", ex); {
_ErrorMessage = ex.Message; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.DataPortal_Fetch", GetHashCode());
throw new DbCslaException("EntryAuditInfo.ReadData", ex); try
} {
} using (SqlConnection cn = Database.VEPROMS_SqlConnection)
private void DataPortal_Fetch(PKCriteria criteria) {
{ ApplicationContext.LocalContext["cn"] = cn;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfo.DataPortal_Fetch", GetHashCode()); using (SqlCommand cm = cn.CreateCommand())
try {
{ cm.CommandType = CommandType.StoredProcedure;
using (SqlConnection cn = Database.VEPROMS_SqlConnection) cm.CommandText = "getEntryAudit";
{ cm.Parameters.AddWithValue("@AuditID", criteria.AuditID);
ApplicationContext.LocalContext["cn"] = cn; cm.CommandTimeout = Database.DefaultTimeout;
using (SqlCommand cm = cn.CreateCommand()) using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{ {
cm.CommandType = CommandType.StoredProcedure; if (!dr.Read())
cm.CommandText = "getEntryAudit"; {
cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); _ErrorMessage = "No Record Found";
cm.CommandTimeout = Database.DefaultTimeout; return;
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) }
{ ReadData(dr);
if (!dr.Read()) }
{ }
_ErrorMessage = "No Record Found"; // removing of item only needed for local data portal
return; if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
ReadData(dr); }
} }
} catch (Exception ex)
// removing of item only needed for local data portal {
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.DataPortal_Fetch", ex);
ApplicationContext.LocalContext.Remove("cn"); _ErrorMessage = ex.Message;
} throw new DbCslaException("EntryAuditInfo.DataPortal_Fetch", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfo.DataPortal_Fetch", ex); // Standard Refresh
_ErrorMessage = ex.Message; #region extension
throw new DbCslaException("EntryAuditInfo.DataPortal_Fetch", ex); EntryAuditInfoExtension _EntryAuditInfoExtension = new EntryAuditInfoExtension();
} [Serializable()]
} partial class EntryAuditInfoExtension : extensionBase { }
#endregion [Serializable()]
// Standard Refresh class extensionBase
#region extension {
EntryAuditInfoExtension _EntryAuditInfoExtension = new EntryAuditInfoExtension(); // Default Refresh
[Serializable()] public virtual void Refresh(EntryAuditInfo tmp) { }
partial class EntryAuditInfoExtension : extensionBase { } }
[Serializable()] #endregion
class extensionBase } // Class
{ #region Converter
// Default Refresh internal class EntryAuditInfoConverter : ExpandableObjectConverter
public virtual void Refresh(EntryAuditInfo tmp) { } {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
#endregion {
} // Class if (destType == typeof(string) && value is EntryAuditInfo)
#region Converter {
internal class EntryAuditInfoConverter : ExpandableObjectConverter // Return the ToString value
{ 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) }
{ }
// Return the ToString value #endregion
return ((EntryAuditInfo)value).ToString();
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace } // Namespace

View File

@@ -19,371 +19,365 @@ 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
{ {
CanReadProperty("ContentID", true); if (_MyContent != null) _ContentID = _MyContent.ContentID;
if (_MyContent != null) _ContentID = _MyContent.ContentID; return _ContentID;
return _ContentID; }
} }
} private ContentInfo _MyContent;
private ContentInfo _MyContent; [System.ComponentModel.DataObjectField(true, true)]
[System.ComponentModel.DataObjectField(true, true)] public ContentInfo MyContent
public ContentInfo MyContent {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID);
CanReadProperty("MyContent", true); return _MyContent;
if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); }
return _MyContent; }
} 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 DateTime _DTS = new DateTime();
return _MyDocument; 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 // CSLATODO: Replace base EntryInfo.ToString function as necessary
{ /// <summary>
CanReadProperty("UserID", true); /// Overrides Base ToString
return _UserID; /// </summary>
} /// <returns>A string representation of current EntryInfo</returns>
} //public override string ToString()
// CSLATODO: Replace base EntryInfo.ToString function as necessary //{
/// <summary> // return base.ToString();
/// Overrides Base ToString //}
/// </summary> // CSLATODO: Check EntryInfo.GetIdValue to assure that the ID returned is unique
/// <returns>A string representation of current EntryInfo</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 EntryInfo</returns>
//} protected override object GetIdValue()
// CSLATODO: Check EntryInfo.GetIdValue to assure that the ID returned is unique {
/// <summary> return MyEntryInfoUnique; // Absolutely Unique ID
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality }
/// </summary> #endregion
/// <returns>A Unique ID for the current EntryInfo</returns> #region Factory Methods
protected override object GetIdValue() private static int _EntryInfoUnique = 0;
{ private static int EntryInfoUnique
return MyEntryInfoUnique; // Absolutely Unique ID { get { return ++_EntryInfoUnique; } }
} private int _MyEntryInfoUnique = EntryInfoUnique;
#endregion public int MyEntryInfoUnique // Absolutely Unique ID - Info
#region Factory Methods { get { return _MyEntryInfoUnique; } }
private static int _EntryInfoUnique = 0; protected EntryInfo()
private static int EntryInfoUnique {/* require use of factory methods */
{ get { return ++_EntryInfoUnique; } } AddToCache(this);
private int _MyEntryInfoUnique = EntryInfoUnique; }
public int MyEntryInfoUnique // Absolutely Unique ID - Info private bool _Disposed = false;
{ get { return _MyEntryInfoUnique; } } private static int _CountCreated = 0;
protected EntryInfo() private static int _CountDisposed = 0;
{/* require use of factory methods */ private static int _CountFinalized = 0;
AddToCache(this); private static int IncrementCountCreated
} { get { return ++_CountCreated; } }
private bool _Disposed = false; private int _CountWhenCreated = IncrementCountCreated;
private static int _CountCreated = 0; public static int CountCreated
private static int _CountDisposed = 0; { get { return _CountCreated; } }
private static int _CountFinalized = 0; public static int CountNotDisposed
private static int IncrementCountCreated { get { return _CountCreated - _CountDisposed; } }
{ get { return ++_CountCreated; } } public static int CountNotFinalized
private int _CountWhenCreated = IncrementCountCreated; { get { return _CountCreated - _CountFinalized; } }
public static int CountCreated ~EntryInfo()
{ get { return _CountCreated; } } {
public static int CountNotDisposed _CountFinalized++;
{ get { return _CountCreated - _CountDisposed; } } }
public static int CountNotFinalized public void Dispose()
{ get { return _CountCreated - _CountFinalized; } } {
~EntryInfo() if (_Disposed) return;
{ _CountDisposed++;
_CountFinalized++; _Disposed = true;
} RemoveFromCache(this);
public void Dispose() if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return;
{ List<EntryInfo> listEntryInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items
if (_Disposed) return; while (listEntryInfo.Contains(this)) listEntryInfo.Remove(this); // Remove the item from the list
_CountDisposed++; if (listEntryInfo.Count == 0) // If there are no items left in the list
_Disposed = true; _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list
RemoveFromCache(this); }
if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return; public virtual Entry Get()
List<EntryInfo> listEntryInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items {
while (listEntryInfo.Contains(this)) listEntryInfo.Remove(this); // Remove the item from the list return _Editable = Entry.Get(_ContentID);
if (listEntryInfo.Count == 0) // If there are no items left in the list }
_CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list public static void Refresh(Entry tmp)
} {
public virtual Entry Get() string key = tmp.ContentID.ToString();
{ ConvertListToDictionary();
return _Editable = Entry.Get(_ContentID); if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key])
public static void Refresh(Entry tmp) tmpInfo.RefreshFields(tmp);
{ }
string key = tmp.ContentID.ToString(); protected virtual void RefreshFields(Entry tmp)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (_DocID != tmp.DocID)
foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) {
tmpInfo.RefreshFields(tmp); if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for old value
} _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 (_DocID != tmp.DocID) if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for new value
{ _DTS = tmp.DTS;
if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for old value _UserID = tmp.UserID;
_DocID = tmp.DocID; // Update the value _EntryInfoExtension.Refresh(this);
} OnChange();// raise an event
_MyDocument = null; // Reset list so that the next line gets a new list }
if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for new value public static void Refresh(DocumentEntry tmp)
_DTS = tmp.DTS; {
_UserID = tmp.UserID; string key = tmp.ContentID.ToString();
_EntryInfoExtension.Refresh(this); ConvertListToDictionary();
OnChange();// raise an event if (_CacheByPrimaryKey.ContainsKey(key))
} foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key])
public static void Refresh(DocumentEntry tmp) tmpInfo.RefreshFields(tmp);
{ }
string key = tmp.ContentID.ToString(); protected virtual void RefreshFields(DocumentEntry tmp)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) _DTS = tmp.DTS;
foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) _UserID = tmp.UserID;
tmpInfo.RefreshFields(tmp); _EntryInfoExtension.Refresh(this);
} OnChange();// raise an event
protected virtual void RefreshFields(DocumentEntry tmp) }
{ public static EntryInfo Get(int contentID)
_DTS = tmp.DTS; {
_UserID = tmp.UserID; //if (!CanGetObject())
_EntryInfoExtension.Refresh(this); // throw new System.Security.SecurityException("User not authorized to view a Entry");
OnChange();// raise an event try
} {
public static EntryInfo Get(int contentID) EntryInfo tmp = GetCachedByPrimaryKey(contentID);
{ if (tmp == null)
//if (!CanGetObject()) {
// throw new System.Security.SecurityException("User not authorized to view a Entry"); tmp = DataPortal.Fetch<EntryInfo>(new PKCriteria(contentID));
try AddToCache(tmp);
{ }
EntryInfo tmp = GetCachedByPrimaryKey(contentID); if (tmp.ErrorMessage == "No Record Found")
if (tmp == null) {
{ tmp.Dispose(); // Clean-up EntryInfo
tmp = DataPortal.Fetch<EntryInfo>(new PKCriteria(contentID)); tmp = null;
AddToCache(tmp); }
} return tmp;
if (tmp.ErrorMessage == "No Record Found") }
{ catch (Exception ex)
tmp.Dispose(); // Clean-up EntryInfo {
tmp = null; throw new DbCslaException("Error on EntryInfo.Get", ex);
} }
return tmp; }
} #endregion
catch (Exception ex) #region Data Access Portal
{ internal EntryInfo(SafeDataReader dr)
throw new DbCslaException("Error on EntryInfo.Get", ex); {
} if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.Constructor", GetHashCode());
} try
#endregion {
#region Data Access Portal ReadData(dr);
internal EntryInfo(SafeDataReader dr) }
{ catch (Exception ex)
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.Constructor", GetHashCode()); {
try if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.Constructor", ex);
{ throw new DbCslaException("EntryInfo.Constructor", ex);
ReadData(dr); }
} }
catch (Exception ex) [Serializable()]
{ protected class PKCriteria
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.Constructor", ex); {
throw new DbCslaException("EntryInfo.Constructor", ex); private int _ContentID;
} public int ContentID
} { get { return _ContentID; } }
[Serializable()] public PKCriteria(int contentID)
protected class PKCriteria {
{ _ContentID = contentID;
private int _ContentID; }
public int ContentID }
{ get { return _ContentID; } } private void ReadData(SafeDataReader dr)
public PKCriteria(int contentID) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.ReadData", GetHashCode());
_ContentID = contentID; try
} {
} _ContentID = dr.GetInt32("ContentID");
private void ReadData(SafeDataReader dr) _DocID = dr.GetInt32("DocID");
{ _DTS = dr.GetDateTime("DTS");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.ReadData", GetHashCode()); _UserID = dr.GetString("UserID");
try }
{ catch (Exception ex)
_ContentID = dr.GetInt32("ContentID"); {
_DocID = dr.GetInt32("DocID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.ReadData", ex);
_DTS = dr.GetDateTime("DTS"); _ErrorMessage = ex.Message;
_UserID = dr.GetString("UserID"); throw new DbCslaException("EntryInfo.ReadData", ex);
} }
catch (Exception ex) }
{ private void DataPortal_Fetch(PKCriteria criteria)
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.ReadData", ex); {
_ErrorMessage = ex.Message; if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.DataPortal_Fetch", GetHashCode());
throw new DbCslaException("EntryInfo.ReadData", ex); try
} {
} using (SqlConnection cn = Database.VEPROMS_SqlConnection)
private void DataPortal_Fetch(PKCriteria criteria) {
{ ApplicationContext.LocalContext["cn"] = cn;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.DataPortal_Fetch", GetHashCode()); using (SqlCommand cm = cn.CreateCommand())
try {
{ cm.CommandType = CommandType.StoredProcedure;
using (SqlConnection cn = Database.VEPROMS_SqlConnection) cm.CommandText = "getEntry";
{ cm.Parameters.AddWithValue("@ContentID", criteria.ContentID);
ApplicationContext.LocalContext["cn"] = cn; cm.CommandTimeout = Database.DefaultTimeout;
using (SqlCommand cm = cn.CreateCommand()) using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{ {
cm.CommandType = CommandType.StoredProcedure; if (!dr.Read())
cm.CommandText = "getEntry"; {
cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); _ErrorMessage = "No Record Found";
cm.CommandTimeout = Database.DefaultTimeout; return;
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) }
{ ReadData(dr);
if (!dr.Read()) }
{ }
_ErrorMessage = "No Record Found"; // removing of item only needed for local data portal
return; if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client)
} ApplicationContext.LocalContext.Remove("cn");
ReadData(dr); }
} }
} catch (Exception ex)
// removing of item only needed for local data portal {
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.DataPortal_Fetch", ex);
ApplicationContext.LocalContext.Remove("cn"); _ErrorMessage = ex.Message;
} throw new DbCslaException("EntryInfo.DataPortal_Fetch", ex);
} }
catch (Exception ex) }
{ #endregion
if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.DataPortal_Fetch", ex); // Standard Refresh
_ErrorMessage = ex.Message; #region extension
throw new DbCslaException("EntryInfo.DataPortal_Fetch", ex); EntryInfoExtension _EntryInfoExtension = new EntryInfoExtension();
} [Serializable()]
} partial class EntryInfoExtension : extensionBase { }
#endregion [Serializable()]
// Standard Refresh class extensionBase
#region extension {
EntryInfoExtension _EntryInfoExtension = new EntryInfoExtension(); // Default Refresh
[Serializable()] public virtual void Refresh(EntryInfo tmp) { }
partial class EntryInfoExtension : extensionBase { } }
[Serializable()] #endregion
class extensionBase } // Class
{ #region Converter
// Default Refresh internal class EntryInfoConverter : ExpandableObjectConverter
public virtual void Refresh(EntryInfo tmp) { } {
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
#endregion {
} // Class if (destType == typeof(string) && value is EntryInfo)
#region Converter {
internal class EntryInfoConverter : ExpandableObjectConverter // Return the ToString value
{ 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) }
{ }
// Return the ToString value #endregion
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,446 +19,437 @@ 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
{ {
CanReadProperty("FigureID", true); return _FigureID;
return _FigureID; }
} }
} private int _ROFstID;
private int _ROFstID; public int ROFstID
public int ROFstID {
{ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] get
get {
{ if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID;
CanReadProperty("ROFstID", true); return _ROFstID;
if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; }
return _ROFstID; }
} private ROFstInfo _MyROFst;
} public ROFstInfo MyROFst
private ROFstInfo _MyROFst; {
public ROFstInfo MyROFst [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] {
get if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
{ return _MyROFst;
CanReadProperty("MyROFst", true); }
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); }
return _MyROFst; private int _ImageID;
} public int ImageID
} {
private int _ImageID; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public int ImageID get
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyROImage != null) _ImageID = _MyROImage.ImageID;
get return _ImageID;
{ }
CanReadProperty("ImageID", true); }
if (_MyROImage != null) _ImageID = _MyROImage.ImageID; private ROImageInfo _MyROImage;
return _ImageID; public ROImageInfo MyROImage
} {
} [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private ROImageInfo _MyROImage; get
public ROImageInfo MyROImage {
{ if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImageInfo.Get(_ImageID);
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] return _MyROImage;
get }
{ }
CanReadProperty("MyROImage", true); private string _Config = string.Empty;
if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImageInfo.Get(_ImageID); public string Config
return _MyROImage; {
} [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 }
{ // CSLATODO: Replace base FigureInfo.ToString function as necessary
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] /// <summary>
get /// Overrides Base ToString
{ /// </summary>
CanReadProperty("UserID", true); /// <returns>A string representation of current FigureInfo</returns>
return _UserID; //public override string ToString()
} //{
} // return base.ToString();
// CSLATODO: Replace base FigureInfo.ToString function as necessary //}
/// <summary> // CSLATODO: Check FigureInfo.GetIdValue to assure that the ID returned is unique
/// Overrides Base ToString /// <summary>
/// </summary> /// Overrides Base GetIdValue - Used internally by CSLA to determine equality
/// <returns>A string representation of current FigureInfo</returns> /// </summary>
//public override string ToString() /// <returns>A Unique ID for the current FigureInfo</returns>
//{ protected override object GetIdValue()
// return base.ToString(); {
//} return MyFigureInfoUnique; // Absolutely Unique ID
// CSLATODO: Check FigureInfo.GetIdValue to assure that the ID returned is unique }
/// <summary> #endregion
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality #region Factory Methods
/// </summary> private static int _FigureInfoUnique = 0;
/// <returns>A Unique ID for the current FigureInfo</returns> private static int FigureInfoUnique
protected override object GetIdValue() { get { return ++_FigureInfoUnique; } }
{ private int _MyFigureInfoUnique = FigureInfoUnique;
return MyFigureInfoUnique; // Absolutely Unique ID public int MyFigureInfoUnique // Absolutely Unique ID - Info
} { get { return _MyFigureInfoUnique; } }
#endregion protected FigureInfo()
#region Factory Methods {/* require use of factory methods */
private static int _FigureInfoUnique = 0; AddToCache(this);
private static int FigureInfoUnique }
{ get { return ++_FigureInfoUnique; } } private bool _Disposed = false;
private int _MyFigureInfoUnique = FigureInfoUnique; private static int _CountCreated = 0;
public int MyFigureInfoUnique // Absolutely Unique ID - Info private static int _CountDisposed = 0;
{ get { return _MyFigureInfoUnique; } } private static int _CountFinalized = 0;
protected FigureInfo() private static int IncrementCountCreated
{/* require use of factory methods */ { get { return ++_CountCreated; } }
AddToCache(this); private int _CountWhenCreated = IncrementCountCreated;
} public static int CountCreated
private bool _Disposed = false; { get { return _CountCreated; } }
private static int _CountCreated = 0; public static int CountNotDisposed
private static int _CountDisposed = 0; { get { return _CountCreated - _CountDisposed; } }
private static int _CountFinalized = 0; public static int CountNotFinalized
private static int IncrementCountCreated { get { return _CountCreated - _CountFinalized; } }
{ get { return ++_CountCreated; } } ~FigureInfo()
private int _CountWhenCreated = IncrementCountCreated; {
public static int CountCreated _CountFinalized++;
{ get { return _CountCreated; } } }
public static int CountNotDisposed public void Dispose()
{ get { return _CountCreated - _CountDisposed; } } {
public static int CountNotFinalized if (_Disposed) return;
{ get { return _CountCreated - _CountFinalized; } } _CountDisposed++;
~FigureInfo() _Disposed = true;
{ RemoveFromCache(this);
_CountFinalized++; if (!_CacheByPrimaryKey.ContainsKey(FigureID.ToString())) return;
} List<FigureInfo> listFigureInfo = _CacheByPrimaryKey[FigureID.ToString()]; // Get the list of items
public void Dispose() 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
if (_Disposed) return; _CacheByPrimaryKey.Remove(FigureID.ToString()); // remove the list
_CountDisposed++; }
_Disposed = true; public virtual Figure Get()
RemoveFromCache(this); {
if (!_CacheByPrimaryKey.ContainsKey(FigureID.ToString())) return; return _Editable = Figure.Get(_FigureID);
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 static void Refresh(Figure tmp)
if (listFigureInfo.Count == 0) // If there are no items left in the list {
_CacheByPrimaryKey.Remove(FigureID.ToString()); // remove the list string key = tmp.FigureID.ToString();
} ConvertListToDictionary();
public virtual Figure Get() if (_CacheByPrimaryKey.ContainsKey(key))
{ foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
return _Editable = Figure.Get(_FigureID); tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(Figure tmp) protected virtual void RefreshFields(Figure tmp)
{ {
string key = tmp.FigureID.ToString(); if (_ROFstID != tmp.ROFstID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) _ROFstID = tmp.ROFstID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyROFst = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(Figure tmp) if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value
{ if (_ImageID != tmp.ImageID)
if (_ROFstID != tmp.ROFstID) {
{ if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value _ImageID = tmp.ImageID; // Update the value
_ROFstID = tmp.ROFstID; // Update the value }
} _MyROImage = null; // Reset list so that the next line gets a new list
_MyROFst = null; // Reset list so that the next line gets a new list if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value _Config = tmp.Config;
if (_ImageID != tmp.ImageID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value _FigureInfoExtension.Refresh(this);
_ImageID = tmp.ImageID; // Update the value OnChange();// raise an event
} }
_MyROImage = null; // Reset list so that the next line gets a new list public static void Refresh(ROFstFigure tmp)
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value {
_Config = tmp.Config; string key = tmp.FigureID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_FigureInfoExtension.Refresh(this); foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(ROFstFigure tmp) protected virtual void RefreshFields(ROFstFigure tmp)
{ {
string key = tmp.FigureID.ToString(); if (_ImageID != tmp.ImageID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) _ImageID = tmp.ImageID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyROImage = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(ROFstFigure tmp) if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value
{ _Config = tmp.Config;
if (_ImageID != tmp.ImageID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for old value _FigureInfoExtension.Refresh(this);
_ImageID = tmp.ImageID; // Update the value OnChange();// raise an event
} }
_MyROImage = null; // Reset list so that the next line gets a new list public static void Refresh(ROImageFigure tmp)
if (MyROImage != null) MyROImage.RefreshROImageFigures(); // Update List for new value {
_Config = tmp.Config; string key = tmp.FigureID.ToString();
_DTS = tmp.DTS; ConvertListToDictionary();
_UserID = tmp.UserID; if (_CacheByPrimaryKey.ContainsKey(key))
_FigureInfoExtension.Refresh(this); foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key])
OnChange();// raise an event tmpInfo.RefreshFields(tmp);
} }
public static void Refresh(ROImageFigure tmp) protected virtual void RefreshFields(ROImageFigure tmp)
{ {
string key = tmp.FigureID.ToString(); if (_ROFstID != tmp.ROFstID)
ConvertListToDictionary(); {
if (_CacheByPrimaryKey.ContainsKey(key)) if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value
foreach (FigureInfo tmpInfo in _CacheByPrimaryKey[key]) _ROFstID = tmp.ROFstID; // Update the value
tmpInfo.RefreshFields(tmp); }
} _MyROFst = null; // Reset list so that the next line gets a new list
protected virtual void RefreshFields(ROImageFigure tmp) if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value
{ _Config = tmp.Config;
if (_ROFstID != tmp.ROFstID) _DTS = tmp.DTS;
{ _UserID = tmp.UserID;
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for old value _FigureInfoExtension.Refresh(this);
_ROFstID = tmp.ROFstID; // Update the value OnChange();// raise an event
} }
_MyROFst = null; // Reset list so that the next line gets a new list public static FigureInfo Get(int figureID)
if (MyROFst != null) MyROFst.RefreshROFstFigures(); // Update List for new value {
_Config = tmp.Config; //if (!CanGetObject())
_DTS = tmp.DTS; // throw new System.Security.SecurityException("User not authorized to view a Figure");
_UserID = tmp.UserID; try
_FigureInfoExtension.Refresh(this); {
OnChange();// raise an event FigureInfo tmp = GetCachedByPrimaryKey(figureID);
} if (tmp == null)
public static FigureInfo Get(int figureID) {
{ tmp = DataPortal.Fetch<FigureInfo>(new PKCriteria(figureID));
//if (!CanGetObject()) AddToCache(tmp);
// throw new System.Security.SecurityException("User not authorized to view a Figure"); }
try if (tmp.ErrorMessage == "No Record Found")
{ {
FigureInfo tmp = GetCachedByPrimaryKey(figureID); tmp.Dispose(); // Clean-up FigureInfo
if (tmp == null) tmp = null;
{ }
tmp = DataPortal.Fetch<FigureInfo>(new PKCriteria(figureID)); return tmp;
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
return tmp; #region Data Access Portal
} internal FigureInfo(SafeDataReader dr)
catch (Exception ex) {
{ if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.Constructor", GetHashCode());
throw new DbCslaException("Error on FigureInfo.Get", ex); try
} {
} ReadData(dr);
#endregion }
#region Data Access Portal catch (Exception ex)
internal FigureInfo(SafeDataReader dr) {
{ if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.Constructor", ex);
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.Constructor", GetHashCode()); throw new DbCslaException("FigureInfo.Constructor", ex);
try }
{ }
ReadData(dr); [Serializable()]
} protected class PKCriteria
catch (Exception ex) {
{ private int _FigureID;
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.Constructor", ex); public int FigureID
throw new DbCslaException("FigureInfo.Constructor", ex); { get { return _FigureID; } }
} public PKCriteria(int figureID)
} {
[Serializable()] _FigureID = figureID;
protected class PKCriteria }
{ }
private int _FigureID; private string _ROImage_FileName = string.Empty;
public int FigureID public string ROImage_FileName
{ get { return _FigureID; } } {
public PKCriteria(int figureID) [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
{ get
_FigureID = figureID; {
} return _ROImage_FileName;
} }
private string _ROImage_FileName = string.Empty; }
public string ROImage_FileName private void ReadData(SafeDataReader dr)
{ {
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.ReadData", GetHashCode());
get try
{ {
CanReadProperty("ROImage_FileName", true); _FigureID = dr.GetInt32("FigureID");
return _ROImage_FileName; _ROFstID = dr.GetInt32("ROFstID");
} _ImageID = dr.GetInt32("ImageID");
} _Config = dr.GetString("Config");
private void ReadData(SafeDataReader dr) _DTS = dr.GetDateTime("DTS");
{ _UserID = dr.GetString("UserID");
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.ReadData", GetHashCode()); for (int i = 0; i < dr.FieldCount; i++)
try {
{ if (dr.GetName(i) == "ROImage_FileName")
_FigureID = dr.GetInt32("FigureID"); _ROImage_FileName = dr.GetString("ROImage_FileName");
_ROFstID = dr.GetInt32("ROFstID"); }
_ImageID = dr.GetInt32("ImageID"); }
_Config = dr.GetString("Config"); catch (Exception ex)
_DTS = dr.GetDateTime("DTS"); {
_UserID = dr.GetString("UserID"); if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.ReadData", ex);
for (int i = 0; i < dr.FieldCount; i++) _ErrorMessage = ex.Message;
{ throw new DbCslaException("FigureInfo.ReadData", ex);
if (dr.GetName(i) == "ROImage_FileName") }
_ROImage_FileName = dr.GetString("ROImage_FileName"); }
} private void DataPortal_Fetch(PKCriteria criteria)
} {
catch (Exception ex) if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.DataPortal_Fetch", GetHashCode());
{ try
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.ReadData", ex); {
_ErrorMessage = ex.Message; using (SqlConnection cn = Database.VEPROMS_SqlConnection)
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;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfo.DataPortal_Fetch", GetHashCode()); cm.CommandText = "getFigure";
try cm.Parameters.AddWithValue("@FigureID", criteria.FigureID);
{ 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 = "getFigure"; }
cm.Parameters.AddWithValue("@FigureID", criteria.FigureID); 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("FigureInfo.DataPortal_Fetch", ex);
} _ErrorMessage = ex.Message;
// removing of item only needed for local data portal throw new DbCslaException("FigureInfo.DataPortal_Fetch", ex);
if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) }
ApplicationContext.LocalContext.Remove("cn"); }
} #endregion
} // Standard Refresh
catch (Exception ex) #region extension
{ FigureInfoExtension _FigureInfoExtension = new FigureInfoExtension();
if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfo.DataPortal_Fetch", ex); [Serializable()]
_ErrorMessage = ex.Message; partial class FigureInfoExtension : extensionBase { }
throw new DbCslaException("FigureInfo.DataPortal_Fetch", ex); [Serializable()]
} class extensionBase
} {
#endregion // Default Refresh
// Standard Refresh public virtual void Refresh(FigureInfo tmp) { }
#region extension }
FigureInfoExtension _FigureInfoExtension = new FigureInfoExtension(); #endregion
[Serializable()] } // Class
partial class FigureInfoExtension : extensionBase { } #region Converter
[Serializable()] internal class FigureInfoConverter : ExpandableObjectConverter
class extensionBase {
{ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
// Default Refresh {
public virtual void Refresh(FigureInfo tmp) { } if (destType == typeof(string) && value is FigureInfo)
} {
#endregion // Return the ToString value
} // Class return ((FigureInfo)value).ToString();
#region Converter }
internal class FigureInfoConverter : 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 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

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