Update underlying data field when related object is updated.

If the selected Library Document is out-of-range throw a specific error
Don't fail if the user clicks on open space in the BookMark list
Added property to provide a right margin (RTBMargin) between the RichTextBox and the StepItem
This commit is contained in:
Rich 2010-12-16 20:42:44 +00:00
parent abd26062f6
commit 10f06a5e9c
42 changed files with 147 additions and 69 deletions

View File

@ -4449,6 +4449,11 @@ private void vlnDataPortalFetch(string sPrefix,IColumns cols,string sql,bool get
sCheck2=FormatColumn("\r\n\t\t\t\t\t{member} = (value == null ? null : ({ctype})value.{!column});",column); sCheck2=FormatColumn("\r\n\t\t\t\t\t{member} = (value == null ? null : ({ctype})value.{!column});",column);
sCheck3=FormatColumn("({!member} == null ? {member} : ({ctype}){!member}.{!column}) != (value == null ? null : ({ctype})value.{!column})",column); sCheck3=FormatColumn("({!member} == null ? {member} : ({ctype}){!member}.{!column}) != (value == null ? null : ({ctype})value.{!column})",column);
} }
else
{
sCheck2=FormatColumn("\r\n\t\t\t\t\t{member} = value.{!column};// Update underlying data field",column);
sCheck3=FormatColumn("{!member} != value",column);
}
vlnProperty(RelObjType( column ) + (bInfo?"Info":"") ,sMember vlnProperty(RelObjType( column ) + (bInfo?"Info":"") ,sMember
,sProp,";"+DebugLine("20070501.4"),"",bReadOnly,column.IsInPrimaryKey,false,null,sCheck,sCheck2,sCheck3); ,sProp,";"+DebugLine("20070501.4"),"",bReadOnly,column.IsInPrimaryKey,false,null,sCheck,sCheck2,sCheck3);
//if (sProp.StartsWith("My"))_refreshMine += string.Format("\t\t\t{0} = null;\r\n",sMember); //if (sProp.StartsWith("My"))_refreshMine += string.Format("\t\t\t{0} = null;\r\n",sMember);

View File

@ -465,7 +465,7 @@ namespace VEPROMS
{ {
// make new document with 'no' libtitle - use libtitle for the doc title. Then link this // make new document with 'no' libtitle - use libtitle for the doc title. Then link this
// to the item... // to the item...
Document doc = Document.MakeDocument(null, doclibinfo.DocContent,doclibinfo.DocAscii,doclibinfo.Config,doclibinfo.DocPdf); Document doc = Document.MakeDocument(null, doclibinfo.DocContent, doclibinfo.DocAscii, doclibinfo.Config, doclibinfo.DocPdf);
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = doc; _SectionConfig.MySection.MyContent.MyEntry.MyDocument = doc;
} }
ppCmbxLibDoc.Items.Clear(); ppCmbxLibDoc.Items.Clear();
@ -495,7 +495,7 @@ namespace VEPROMS
break; break;
} }
} }
if (docid==-1)return; if (docid == -1) return;
using (Document dc = Document.Get(docid)) using (Document dc = Document.Get(docid))
{ {
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = dc; _SectionConfig.MySection.MyContent.MyEntry.MyDocument = dc;
@ -555,9 +555,16 @@ namespace VEPROMS
{ {
// it already is a library document, just change usages... // it already is a library document, just change usages...
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true); DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
if (ppCmbxLibDoc.SelectedIndex >= 0 && ppCmbxLibDoc.SelectedIndex < LibDocList.Count)
{
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID); _SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID);
ppBtnCvrtToLibDoc.Enabled = true; ppBtnCvrtToLibDoc.Enabled = true;
} }
else
{
throw new Exception(string.Format("Index Out Of Range Index = {0}, Count = {1}", ppCmbxLibDoc.SelectedIndex, LibDocList.Count));
}
}
} }
#endregion #endregion

View File

@ -135,6 +135,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
_ItemID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -167,6 +168,7 @@ namespace VEPROMS.CSLA.Library
if (_MyAnnotationType != value) if (_MyAnnotationType != value)
{ {
_MyAnnotationType = value; _MyAnnotationType = value;
_TypeID = value.TypeID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
_ItemID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -136,6 +136,7 @@ namespace VEPROMS.CSLA.Library
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
_GID = value.GID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -168,6 +169,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRole != value) if (_MyRole != value)
{ {
_MyRole = value; _MyRole = value;
_RID = value.RID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -200,6 +202,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -145,6 +145,7 @@ namespace VEPROMS.CSLA.Library
if (_MyDocVersion != value) if (_MyDocVersion != value)
{ {
_MyDocVersion = value; _MyDocVersion = value;
_VersionID = value.VersionID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -177,6 +178,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROFst != value) if (_MyROFst != value)
{ {
_MyROFst = value; _MyROFst = value;
_ROFstID = value.ROFstID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyParent != value) if (_MyParent != value)
{ {
_MyParent = value; _MyParent = value;
_ParentID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -75,6 +75,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
_ItemID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -172,6 +172,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRODb != value) if (_MyRODb != value)
{ {
_MyRODb = value; _MyRODb = value;
_RODbID = value.RODbID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -91,6 +91,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemToID != value) if (_MyItemToID != value)
{ {
_MyItemToID = value; _MyItemToID = value;
_ToID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -123,6 +124,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemRangeID != value) if (_MyItemRangeID != value)
{ {
_MyItemRangeID = value; _MyItemRangeID = value;
_RangeID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -134,6 +134,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_ContentID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -149,6 +149,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROFst != value) if (_MyROFst != value)
{ {
_MyROFst = value; _MyROFst = value;
_ROFstID = value.ROFstID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -142,6 +142,7 @@ namespace VEPROMS.CSLA.Library
if (_MyDocument != value) if (_MyDocument != value)
{ {
_MyDocument = value; _MyDocument = value;
_DocID = value.DocID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -145,6 +145,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROFst != value) if (_MyROFst != value)
{ {
_MyROFst = value; _MyROFst = value;
_ROFstID = value.ROFstID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -177,6 +178,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROImage != value) if (_MyROImage != value)
{ {
_MyROImage = value; _MyROImage = value;
_ImageID = value.ImageID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -178,6 +178,7 @@ namespace VEPROMS.CSLA.Library
if (_MyParent != value) if (_MyParent != value)
{ {
_MyParent = value; _MyParent = value;
_ParentID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -210,6 +211,7 @@ namespace VEPROMS.CSLA.Library
if (_MyConnection != value) if (_MyConnection != value)
{ {
_MyConnection = value; _MyConnection = value;
_DBID = value.DBID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
_GID = value.GID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -120,6 +121,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRole != value) if (_MyRole != value)
{ {
_MyRole = value; _MyRole = value;
_RID = value.RID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -189,6 +189,7 @@ namespace VEPROMS.CSLA.Library
if (_MyParent != value) if (_MyParent != value)
{ {
_MyParent = value; _MyParent = value;
_ParentID = value.FormatID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyParent != value) if (_MyParent != value)
{ {
_MyParent = value; _MyParent = value;
_ParentID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -120,6 +121,7 @@ namespace VEPROMS.CSLA.Library
if (_MyConnection != value) if (_MyConnection != value)
{ {
_MyConnection = value; _MyConnection = value;
_DBID = value.DBID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRole != value) if (_MyRole != value)
{ {
_MyRole = value; _MyRole = value;
_RID = value.RID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -120,6 +121,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyUser != value) if (_MyUser != value)
{ {
_MyUser = value; _MyUser = value;
_UID = value.UID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -239,6 +239,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_ContentID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyAnnotationType != value) if (_MyAnnotationType != value)
{ {
_MyAnnotationType = value; _MyAnnotationType = value;
_TypeID = value.TypeID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_FromID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -123,6 +124,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemToID != value) if (_MyItemToID != value)
{ {
_MyItemToID = value; _MyItemToID = value;
_ToID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_FromID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -120,6 +121,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemRangeID != value) if (_MyItemRangeID != value)
{ {
_MyItemRangeID = value; _MyItemRangeID = value;
_RangeID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -135,6 +135,7 @@ namespace VEPROMS.CSLA.Library
if (_MyUser != value) if (_MyUser != value)
{ {
_MyUser = value; _MyUser = value;
_UID = value.UID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -167,6 +168,7 @@ namespace VEPROMS.CSLA.Library
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
_GID = value.GID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -154,6 +154,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItem != value) if (_MyItem != value)
{ {
_MyItem = value; _MyItem = value;
_ItemID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -134,6 +134,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRole != value) if (_MyRole != value)
{ {
_MyRole = value; _MyRole = value;
_RID = value.RID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_ContentID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -170,6 +170,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRODb != value) if (_MyRODb != value)
{ {
_MyRODb = value; _MyRODb = value;
_RODbID = value.RODbID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyDocVersion != value) if (_MyDocVersion != value)
{ {
_MyDocVersion = value; _MyDocVersion = value;
_VersionID = value.VersionID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROImage != value) if (_MyROImage != value)
{ {
_MyROImage = value; _MyROImage = value;
_ImageID = value.ImageID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -157,6 +157,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRODb != value) if (_MyRODb != value)
{ {
_MyRODb = value; _MyRODb = value;
_RODbID = value.RODbID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyROFst != value) if (_MyROFst != value)
{ {
_MyROFst = value; _MyROFst = value;
_ROFstID = value.ROFstID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -135,6 +135,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_ContentID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -251,6 +252,7 @@ namespace VEPROMS.CSLA.Library
if (_MyRODb != value) if (_MyRODb != value)
{ {
_MyRODb = value; _MyRODb = value;
_RODbID = value.RODbID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
_GID = value.GID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -120,6 +121,7 @@ namespace VEPROMS.CSLA.Library
if (_MyFolder != value) if (_MyFolder != value)
{ {
_MyFolder = value; _MyFolder = value;
_FolderID = value.FolderID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -136,6 +136,7 @@ namespace VEPROMS.CSLA.Library
if (_MyContent != value) if (_MyContent != value)
{ {
_MyContent = value; _MyContent = value;
_FromID = value.ContentID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -171,6 +172,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemToID != value) if (_MyItemToID != value)
{ {
_MyItemToID = value; _MyItemToID = value;
_ToID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }
@ -203,6 +205,7 @@ namespace VEPROMS.CSLA.Library
if (_MyItemRangeID != value) if (_MyItemRangeID != value)
{ {
_MyItemRangeID = value; _MyItemRangeID = value;
_RangeID = value.ItemID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -88,6 +88,7 @@ namespace VEPROMS.CSLA.Library
if (_MyGroup != value) if (_MyGroup != value)
{ {
_MyGroup = value; _MyGroup = value;
_GID = value.GID;// Update underlying data field
PropertyHasChanged(); PropertyHasChanged();
} }
} }

View File

@ -113,6 +113,7 @@ namespace Volian.Controls.Library
private void lbxBookMarks_Click(object sender, EventArgs e) private void lbxBookMarks_Click(object sender, EventArgs e)
{ {
MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem; MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem;
if(itm != null)
MyDisplayTabControl.OpenItem(itm.MyItemInfo); MyDisplayTabControl.OpenItem(itm.MyItemInfo);
} }
#endregion #endregion

View File

@ -372,6 +372,16 @@ namespace Volian.Controls.Library
get { return new Point(Location.X + lblTab.Left, Location.Y); } get { return new Point(Location.X + lblTab.Left, Location.Y); }
set { Location = new Point(value.X - lblTab.Left, value.Y); } set { Location = new Point(value.X - lblTab.Left, value.Y); }
} }
private int _RTBMargin = 3;
/// <summary>
/// Margin between the StepItem and the StepRTB. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the StepItem.
/// </summary>
public int RTBMargin
{
get { return _RTBMargin; }
set { _RTBMargin = value; }
}
/// <summary> /// <summary>
/// Width of the Tab and RTB /// Width of the Tab and RTB
/// </summary> /// </summary>
@ -380,7 +390,7 @@ namespace Volian.Controls.Library
get { return Width - lblTab.Left; } get { return Width - lblTab.Left; }
set set
{ {
Width = value + lblTab.Left; Width = RTBMargin + value + lblTab.Left;
} }
} }
/// <summary> /// <summary>
@ -430,7 +440,7 @@ namespace Volian.Controls.Library
lblTab.Width = tabString.Length * 8 * MyStepPanel.DPI / 96;// Adjust width for DPI lblTab.Width = tabString.Length * 8 * MyStepPanel.DPI / 96;// Adjust width for DPI
Invalidate(); Invalidate();
_MyStepRTB.Left = lblTab.Left + lblTab.Width;// +2; _MyStepRTB.Left = lblTab.Left + lblTab.Width;// +2;
_MyStepRTB.Width = Width - _MyStepRTB.Left; _MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin;
_TabFormat = value; // tabString; _TabFormat = value; // tabString;
} }
} }