From 99d6f75735455b86b1f5e2eadc4bd30cf1d6d6cc Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 22 May 2014 00:37:25 +0000 Subject: [PATCH] Added ability to change a working draft to a multiunit working draft by creating applicabilities. --- .../frmVersionsProperties.cs | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs index e326aaaf..d7d60ba3 100644 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs +++ b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs @@ -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(); @@ -353,8 +353,14 @@ namespace VEPROMS } else { - btnApplicability.Visible = false; - tiApplicability.Visible = false; + 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; } ppTxtBxPDFLoc.TextChanged += new EventHandler(ppTxtBxPDFLoc_TextChanged); //end add new applicability stuff @@ -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(); _Apples.Add(cfg); bsApples.DataSource = null; bsApples.DataSource = _Apples;