This commit is contained in:
parent
93a5453618
commit
16f3af2b37
@ -139,7 +139,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
bool isLib = false;
|
bool isLib = false;
|
||||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument!=null && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != null) && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != "")) isLib = true;
|
if (_SectionConfig.MySection.MyContent.MyEntry!=null && _SectionConfig.MySection.MyContent.MyEntry.MyDocument!=null && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != null) && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != "")) isLib = true;
|
||||||
if (isLib)
|
if (isLib)
|
||||||
{
|
{
|
||||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||||
@ -149,19 +149,26 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
|
ppBtnCvrtToLibDoc.Text = _SectionConfig.MySection.MyContent.MyEntry.MyDocument == null ? "Select Library Document" : "Convert this to a Library Document";
|
||||||
lblLibraryDocument.Text = "Select Library Document to Link";
|
lblLibraryDocument.Text = "Select Library Document to Link";
|
||||||
|
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument==null)
|
||||||
|
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Select Library Document button", "", "This button will attach the current section to a library document, allowing it t" +
|
||||||
|
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||||
|
else
|
||||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||||
}
|
}
|
||||||
|
|
||||||
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
|
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
|
||||||
|
int selindx = -1;
|
||||||
|
ppCmbxLibDoc.Items.Clear();
|
||||||
for (int i = 0; i < LibDocList.Count; i++)
|
for (int i = 0; i < LibDocList.Count; i++)
|
||||||
{
|
{
|
||||||
ppCmbxLibDoc.Items.Add(LibDocList[i].DocumentTitle);
|
ppCmbxLibDoc.Items.Add(LibDocList[i].DocumentTitle);
|
||||||
// see if this lib doc should be the selected index?
|
// see if this lib doc should be the selected index?
|
||||||
if (isLib && (LibDocList[i].DocID == _SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID)) ppCmbxLibDoc.SelectedIndex = i;
|
if (isLib && (LibDocList[i].DocID == _SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID)) selindx = i;
|
||||||
}
|
}
|
||||||
|
if (selindx>-1) ppCmbxLibDoc.SelectedIndex = selindx;
|
||||||
_Initializing = false;
|
_Initializing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,12 +241,8 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
ppCmbxStyleSectionType.DataSource = locDocStyles;
|
ppCmbxStyleSectionType.DataSource = locDocStyles;
|
||||||
ppCmbxStyleSectionType.SelectedIndex = selindx;
|
ppCmbxStyleSectionType.SelectedIndex = selindx;
|
||||||
//if (_SectionConfig.SectionType < pf.DocStyles.DocStyleList.Count)
|
|
||||||
//{
|
if (!cbIsStepSection.Checked) ppCmbxLibDocFill();
|
||||||
// //Volian.Controls.Library.vlnStackTrace.ShowStack("Before - SelectedValue {0} SectionType {1}", ppCmbxStyleSectionType.SelectedValue, _SectionConfig.SectionType);
|
|
||||||
// ppCmbxStyleSectionType.SelectedValue = (int)_SectionConfig.SectionType;
|
|
||||||
// //Volian.Controls.Library.vlnStackTrace.ShowStack("After - SelectedValue {0} SectionType {1}", ppCmbxStyleSectionType.SelectedValue, _SectionConfig.SectionType);
|
|
||||||
//}
|
|
||||||
_Initializing = myInit;
|
_Initializing = myInit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +291,8 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// Double Check that this is not a step section, if so just return.
|
||||||
|
if (cbIsStepSection.Checked) return;
|
||||||
// If current section is library document, user selected to convert to non-library document. If
|
// If current section is library document, user selected to convert to non-library document. If
|
||||||
// this is the case, data from lib doc must be copied to new document and the section must point
|
// this is the case, data from lib doc must be copied to new document and the section must point
|
||||||
// to id.
|
// to id.
|
||||||
@ -313,16 +318,41 @@ namespace VEPROMS
|
|||||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||||
}
|
}
|
||||||
// If current section is not a library document, the user selected the button to convert it to a
|
// If current section is not a library document, it is either a new section or the user selected the
|
||||||
// library document, to do this, just put 'text' into the 'LibTitle' property (that's what flags
|
// button to convert it to a library document. Check for this, if new, just attach to document.
|
||||||
// it to be a library document.
|
else if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||||
|
{
|
||||||
|
// if nothing was selected, give message & return
|
||||||
|
if (ppCmbxLibDoc.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Must select a library document");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int docid = -1;
|
||||||
|
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
|
||||||
|
for (int i = 0; i < LibDocList.Count; i++)
|
||||||
|
{
|
||||||
|
if (LibDocList[i].LibTitle == (string)ppCmbxLibDoc.Items[ppCmbxLibDoc.SelectedIndex])
|
||||||
|
{
|
||||||
|
docid = LibDocList[i].DocID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (docid==-1)return;
|
||||||
|
using (Document dc = Document.Get(docid))
|
||||||
|
{
|
||||||
|
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = dc;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
// if converting to library document, just put 'text' into the 'LibTitle' property (that's what flags
|
||||||
|
// it to be a library document.
|
||||||
{
|
{
|
||||||
_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle = _SectionConfig.MySection.MyContent.Text;
|
_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle = _SectionConfig.MySection.MyContent.Text;
|
||||||
// TODO: Kbr/Rhm - CSLA was not saving document (libtitle change) on higher level save. Delete following
|
// Save now so that it shows up in the library document list in the ppcmbxlibdoc (combo box
|
||||||
// line after this is fixed.
|
// listing lib docs that is regenerated in ppCmbxLibDocFill)
|
||||||
_SectionConfig.MySection.MyContent.MyEntry.MyDocument.Save();
|
_SectionConfig.MySection.MyContent.MyEntry.MyDocument.Save();
|
||||||
// ppCmbxLibDocFill();
|
ppCmbxLibDocFill();
|
||||||
ppCmbxLibDoc.Enabled = false;
|
ppCmbxLibDoc.Enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,10 +360,14 @@ namespace VEPROMS
|
|||||||
private void ppCmbxLibDoc_SelectedIndexChanged(object sender, EventArgs e)
|
private void ppCmbxLibDoc_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
|
|
||||||
|
// first check if this is a 'new' section - if so, then just return.
|
||||||
|
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) return;
|
||||||
// see if this was NOT a library document. If it is not a library document, ask the user if
|
// see if this was NOT a library document. If it is not a library document, ask the user if
|
||||||
// it should be linked, thus losing the original text/data.
|
// it should be linked, thus losing the original text/data.
|
||||||
if (!(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != ""))
|
if (!(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != ""))
|
||||||
{
|
{
|
||||||
|
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.New();
|
||||||
if (ppCmbxLibDoc.SelectedIndex > -1)
|
if (ppCmbxLibDoc.SelectedIndex > -1)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show("Linking to this library document will cause loss of data. Do you want to continue?", "Link", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
if (MessageBox.Show("Linking to this library document will cause loss of data. Do you want to continue?", "Link", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||||
|
@ -141,7 +141,6 @@ namespace VEPROMS
|
|||||||
private MostRecentItemList _MyBookMarks;
|
private MostRecentItemList _MyBookMarks;
|
||||||
private void SetupBookMarks()
|
private void SetupBookMarks()
|
||||||
{
|
{
|
||||||
// TODO: load previously set bookmarks
|
|
||||||
lbxBookMarks.SelectedValueChanged += new EventHandler(lbxBookMarks_SelectedValueChanged);
|
lbxBookMarks.SelectedValueChanged += new EventHandler(lbxBookMarks_SelectedValueChanged);
|
||||||
RefreshBookMarkData();
|
RefreshBookMarkData();
|
||||||
btnPrevPos.Enabled = false;
|
btnPrevPos.Enabled = false;
|
||||||
@ -990,10 +989,9 @@ namespace VEPROMS
|
|||||||
if (SelectedStepTabPanel == null) return;
|
if (SelectedStepTabPanel == null) return;
|
||||||
displayRO.MyROFST = SelectedROFst;
|
displayRO.MyROFST = SelectedROFst;
|
||||||
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedStepItem.MyStepRTB;
|
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedStepItem.MyStepRTB;
|
||||||
displayRO.CurROLink = args.MyLinkText.RoUsageid; // TODO: this is wrong - use for now.
|
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
|
||||||
displayRO.Mydvi = SelectedDVI;
|
displayRO.Mydvi = SelectedDVI;
|
||||||
displayRO.ProgressBar = bottomProgBar;
|
displayRO.ProgressBar = bottomProgBar;
|
||||||
displayRO.CurROLink = args.MyLinkText.RoUsageid; // this is wrong - use for now.
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region VButton_New
|
#region VButton_New
|
||||||
|
Loading…
x
Reference in New Issue
Block a user