B2013-002 fixed the logic that uses RevDate.

Added logic to  only show the revision date field if the RevDate flag was set to true in the current format.
This commit is contained in:
John Jenko 2013-01-09 19:09:59 +00:00
parent e8cfca25c6
commit e95c0aa52d
2 changed files with 19 additions and 5 deletions

View File

@ -37,6 +37,18 @@ namespace VEPROMS
get { return txbRevNum.Text; } get { return txbRevNum.Text; }
set { txbRevNum.Text = value; } set { txbRevNum.Text = value; }
} }
public string RevNumAndDate
{
get
{
if (txbRevDate.Text == "")
return RevNum;
if (MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash)
return RevNum + "\\" + RevDate;
else
return RevNum + "/" + RevDate;
}
}
public string ProcNum public string ProcNum
{ {
get { return MyProcedure.DisplayNumber; } get { return MyProcedure.DisplayNumber; }
@ -285,12 +297,14 @@ namespace VEPROMS
ppTxbxChangeBarUserMsgTwo.Text = _DocVersionConfig.Print_UserCBMess2; ppTxbxChangeBarUserMsgTwo.Text = _DocVersionConfig.Print_UserCBMess2;
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef; ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
bool hasReviewDate = _MyProcedure.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}"); bool hasReviewDate = _MyProcedure.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}");
bool usesRevDate = _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate;
if (_MyProcedure.Sections != null) if (_MyProcedure.Sections != null)
{ {
foreach (SectionInfo mysection in _MyProcedure.Sections) foreach (SectionInfo mysection in _MyProcedure.Sections)
hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}"); hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}");
} }
lblReviewDate.Visible = txbReviewDate.Visible = !_AllProcedures && hasReviewDate; lblReviewDate.Visible = txbReviewDate.Visible = !_AllProcedures && hasReviewDate;
lblRevDate.Visible = txbRevDate.Visible = !_AllProcedures && usesRevDate;
} }
private void btnCancel_Click(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e)
@ -449,7 +463,7 @@ namespace VEPROMS
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
GetMultiunitPDFPath(); GetMultiunitPDFPath();
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum,pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50)); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate,pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50));
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -468,7 +482,7 @@ namespace VEPROMS
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); // this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50)); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -484,7 +498,7 @@ namespace VEPROMS
pbPDFsStatus.Value = i; pbPDFsStatus.Value = i;
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); // this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50)); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -542,7 +556,7 @@ namespace VEPROMS
if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0) if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50)); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.ShowDialog(); frmStatus.ShowDialog();
this.Close(); this.Close();
ShowDebugFiles(); ShowDebugFiles();

View File

@ -1250,7 +1250,7 @@ namespace Volian.Print.Library
if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/")) if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/"))
|| (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\"))) || (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\")))
{ {
int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate?'/':'\\'); int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
if (match.Value == "{REV}") return Rev.Substring(0,indx); if (match.Value == "{REV}") return Rev.Substring(0,indx);
return Rev.Substring(indx+1); return Rev.Substring(indx+1);
} }