Added ability to change a working draft to a multiunit working draft by creating applicabilities.

This commit is contained in:
Rich 2014-05-22 00:37:25 +00:00
parent 821103fc87
commit 99d6f75735

View File

@ -102,7 +102,7 @@ namespace VEPROMS
}
private void btnVersionsPropOK_Click(object sender, EventArgs e)
{
if (_DocVersionConfig.Unit_Count > 1)
if (_DocVersionConfig.Unit_Count > 0 || (_Apples != null && _Apples.Count > 0))
{
if (_DeletedApples != null && _DeletedApples.Count > 0)
{
@ -332,7 +332,7 @@ namespace VEPROMS
ppBtnDeftDisAutoDuplx.Visible = false;
}
//add new applicability stuff
if (_DocVersionConfig.Unit_Count > 1)
if (_DocVersionConfig.Unit_Count > 0)
{
int k = _DocVersionConfig.SelectedSlave;
_Apples = new List<MiniConfig>();
@ -353,6 +353,12 @@ namespace VEPROMS
}
else
{
Button btnPC = new Button();
btnPC.Text = "Add Applicability to Working Draft";
btnPC.Width = 250;
btnPC.Location = new Point(25, 271);
btnPC.Parent = tcpGeneral;
btnPC.Click += new EventHandler(btnPC_Click);
btnApplicability.Visible = false;
tiApplicability.Visible = false;
}
@ -364,6 +370,18 @@ namespace VEPROMS
// the phone list button is only visible if the format has the print/phonelist format flag.
btnPhoneList.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList;
}
void btnPC_Click(object sender, EventArgs e)
{
if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes)
{
btnApplicability.Visible = true;
tiApplicability.Visible = true;
Button btnPC = (Button)sender;
btnPC.Visible = false;
btnApplicability_Click(sender, e);
}
}
// The following code was added to fix Bug B2013-117
void ppTxtBxPDFLoc_TextChanged(object sender, EventArgs e)
{
@ -1049,6 +1067,8 @@ namespace VEPROMS
{
MiniConfig cfg = new MiniConfig();
cfg.Name = "New Applicability";
if (_Apples == null)
_Apples = new List<MiniConfig>();
_Apples.Add(cfg);
bsApples.DataSource = null;
bsApples.DataSource = _Apples;