This commit is contained in:
2010-11-16 17:22:12 +00:00
parent e20796dfbf
commit 48fd879622
2 changed files with 76 additions and 50 deletions

View File

@@ -60,7 +60,9 @@ namespace VEPROMS
rbStepSect.Enabled = rbWordSect.Enabled = !(ii.HasWordContent || ii.HasStepContent);
// if this has already been set to be a step section, i.e. HasStepContent, disable the libdoc tab
if (ii.HasStepContent) tcpLibDoc.Enabled = false;
// also disable if there is no word content yet - the user may want to change from step type to
// word type, as long as there is no content yet.
if (ii.HasStepContent || !ii.HasWordContent) tcpLibDoc.Enabled = false;
}
private void btnSectPropOK_Click(object sender, EventArgs e)
@@ -83,6 +85,7 @@ namespace VEPROMS
Document.Delete(_DocumentToDelete.DocID);
_DocumentToDelete = null;
}
ppSectNumberStpRTB.SaveText();
ppSectTitleStpRTB.SaveText();
mySection.Dispose();
@@ -241,18 +244,19 @@ namespace VEPROMS
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
lblLibraryDocument.Text = "Library Document";
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
}
else
{
ppBtnCvrtToLibDoc.Text = _SectionConfig.MySection.MyContent.MyEntry.MyDocument == null ? "Select Library Document" : "Convert this to a Library Document";
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
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
ppBtnCvrtToLibDoc.Visible = false;
else
{
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
lblLibraryDocument.Text = "Select Library Document";
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);
@@ -264,7 +268,7 @@ namespace VEPROMS
// see if this lib doc should be the selected index?
if (isLib && (LibDocList[i].DocID == _SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID)) selindx = i;
}
if (selindx>-1) ppCmbxLibDoc.SelectedIndex = selindx;
if (selindx > -1) ppCmbxLibDoc.SelectedIndex = selindx;
_Initializing = false;
}
@@ -469,6 +473,7 @@ namespace VEPROMS
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
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)));
return;
}
// If current section is not a library document, it is either a new section or the user selected the
// button to convert it to a library document. Check for this, if new, just attach to document.
@@ -507,6 +512,10 @@ namespace VEPROMS
ppCmbxLibDocFill();
ppCmbxLibDoc.Enabled = false;
}
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
lblLibraryDocument.Text = "Library Document";
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
}
private void ppCmbxLibDoc_SelectedIndexChanged(object sender, EventArgs e)
@@ -514,32 +523,40 @@ namespace VEPROMS
if (_Initializing) return;
// first check if this is a 'new' section - if so, then just return.
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) return;
if (_SectionConfig.MySection.MyContent.MyEntry == null) return;
// 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.
if (!(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != ""))
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument != null && !(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != ""))
{
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.New();
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 to this section. Do you want to continue?", "Link", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
_DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument;
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID);
ppBtnCvrtToLibDoc.Enabled = true;
}
else
{
ppCmbxLibDoc.SelectedIndex = -1;
ppBtnCvrtToLibDoc.Enabled = false;
}
}
}
else
{
//else if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
//{
// // was creating a new document & selected to connect it to a libdoc
// _DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument;
//}
else
{
// it already is a library document, just change usages...
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = Document.Get(LibDocList[ppCmbxLibDoc.SelectedIndex].DocID);
ppBtnCvrtToLibDoc.Enabled = true;
}
}
#endregion
@@ -684,6 +701,7 @@ namespace VEPROMS
{
SetupPpCmbxSectionType();
ShowAvailableOptionsForSectionType();
tcpLibDoc.Enabled = !_isStepSection;
}
}