Compare commits

...

4 Commits

4 changed files with 71 additions and 14 deletions

View File

@ -57,7 +57,7 @@
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(165, 111); this.btnCancel.Location = new System.Drawing.Point(179, 111);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(64, 23); this.btnCancel.Size = new System.Drawing.Size(64, 23);
this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@ -88,7 +88,7 @@
this.dateTimeInput1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.dateTimeInput1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.dateTimeInput1.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; this.dateTimeInput1.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown;
this.dateTimeInput1.ButtonDropDown.Visible = true; this.dateTimeInput1.ButtonDropDown.Visible = true;
this.dateTimeInput1.CustomFormat = "MM/dd/yyyy"; this.dateTimeInput1.CustomFormat = "MM/dd/yyyy HH:mm:ss";
this.dateTimeInput1.DateTimeSelectorVisibility = DevComponents.Editors.DateTimeAdv.eDateTimeSelectorVisibility.DateSelector; this.dateTimeInput1.DateTimeSelectorVisibility = DevComponents.Editors.DateTimeAdv.eDateTimeSelectorVisibility.DateSelector;
this.dateTimeInput1.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; this.dateTimeInput1.Format = DevComponents.Editors.eDateTimePickerFormat.Custom;
this.dateTimeInput1.IsPopupCalendarOpen = false; this.dateTimeInput1.IsPopupCalendarOpen = false;
@ -122,7 +122,7 @@
this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.dateTimeInput1.MonthCalendar.TodayButtonVisible = true; this.dateTimeInput1.MonthCalendar.TodayButtonVisible = true;
this.dateTimeInput1.Name = "dateTimeInput1"; this.dateTimeInput1.Name = "dateTimeInput1";
this.dateTimeInput1.Size = new System.Drawing.Size(113, 20); this.dateTimeInput1.Size = new System.Drawing.Size(146, 20);
this.dateTimeInput1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.dateTimeInput1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.dateTimeInput1, new DevComponents.DotNetBar.SuperTooltipInfo("Change Bar Start Date", "", "Only the changes made after this date will have change bars.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(138, 67))); this.superTooltip1.SetSuperTooltip(this.dateTimeInput1, new DevComponents.DotNetBar.SuperTooltipInfo("Change Bar Start Date", "", "Only the changes made after this date will have change bars.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(138, 67)));
this.dateTimeInput1.TabIndex = 4; this.dateTimeInput1.TabIndex = 4;
@ -133,7 +133,7 @@
// //
this.btnNow.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnNow.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnNow.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnNow.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnNow.Location = new System.Drawing.Point(149, 51); this.btnNow.Location = new System.Drawing.Point(182, 51);
this.btnNow.Name = "btnNow"; this.btnNow.Name = "btnNow";
this.btnNow.Size = new System.Drawing.Size(49, 23); this.btnNow.Size = new System.Drawing.Size(49, 23);
this.btnNow.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnNow.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@ -146,7 +146,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(241, 144); this.ClientSize = new System.Drawing.Size(268, 144);
this.Controls.Add(this.btnNow); this.Controls.Add(this.btnNow);
this.Controls.Add(this.dateTimeInput1); this.Controls.Add(this.dateTimeInput1);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);

View File

@ -32,13 +32,46 @@ namespace VEPROMS
{ {
string cbdt = MyProcConfig.Print_ChangeBarDate; string cbdt = MyProcConfig.Print_ChangeBarDate;
string[] tmp = cbdt.Split(' '); string[] tmp = cbdt.Split(' ');
cbdt = tmp[0] + " 00:00:00";
dateTimeInput1.Value = (cbdt == null || cbdt == "") ? DateTime.Now : DateTime.Parse(cbdt); if (tmp[0] == null || tmp[0] == "") // First time date set.
{
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss");
dateTimeInput1.Value = DateTime.Parse(cbdt);
return;
}
else
{
DateTime tmpdt = DateTime.Parse(cbdt);
if (tmpdt.Date == DateTime.Today) // Date has before been set.
{
TimeSpan start = TimeSpan.Parse("00:00:00");
var time = tmpdt.TimeOfDay;
if (start < time) // If time is greater than 12:00:00 AM
{
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + tmpdt.TimeOfDay.ToString();
dateTimeInput1.Value = DateTime.Parse(cbdt);
return;
}
else // if time is 12:00:00 AM
{
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + " 00:00:00";
dateTimeInput1.Value = DateTime.Parse(cbdt);
return;
}
}
else
{
cbdt = tmpdt.ToString();
dateTimeInput1.Value = DateTime.Parse(cbdt);
return;
}
}
} }
private void btnOK_Click(object sender, EventArgs e) private void btnOK_Click(object sender, EventArgs e)
{ {
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy 00:00:00");// ("MM/dd/yyyy HH:mm:ss"); MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
} }

View File

@ -112,12 +112,12 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
</root> </root>

View File

@ -1322,7 +1322,7 @@ namespace Volian.Controls.Library
{ {
MenuItem miri = mir.MenuItems.Add("Create Procedure to Import"); MenuItem miri = mir.MenuItems.Add("Create Procedure to Import");
miri.Tag = ri.RevisionID; miri.Tag = ri.RevisionID;
miri.Click += new EventHandler(ImportProcedure_Click); miri.Click += new EventHandler(MultiUnitImportProcedure_Click); //B2024-024 Parent Child Create Approved Import file
} }
//end added jcb 20111031 //end added jcb 20111031
@ -1420,8 +1420,8 @@ namespace Volian.Controls.Library
void ImportProcedure_Click(object sender, EventArgs e) void ImportProcedure_Click(object sender, EventArgs e)
{ {
//RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo; //B2024-024 restored the line below from prior change - didn't work for non parent/childs sets - created a new click event method (below) for parent/child sets.
RevisionInfo ri = RevisionInfo.Get(int.Parse((sender as MenuItem).Tag.ToString())); RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo;
RevisionConfig rc = ri.MyConfig as RevisionConfig; RevisionConfig rc = ri.MyConfig as RevisionConfig;
// bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures.
int applIdx = rc.Applicability_Index; int applIdx = rc.Applicability_Index;
@ -1440,6 +1440,30 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
//B2024-024 create import file for parent/child procedure set
void MultiUnitImportProcedure_Click(object sender, EventArgs e)
{
//RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo;
RevisionInfo ri = RevisionInfo.Get(int.Parse((sender as MenuItem).Tag.ToString()));
RevisionConfig rc = ri.MyConfig as RevisionConfig;
// bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures.
int applIdx = rc.Applicability_Index;
string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml(ri.LatestVersion.ApprovedXML);
string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database;
DirectoryInfo di = new DirectoryInfo(PEIPath);
if (!di.Exists) di.Create();
// B2022-048: Crash when creating Procedure to Import from versions. Couldn't handle '/' in proc number.
string fNametmp = xd.SelectSingleNode("procedure/content/@number").InnerText.Replace(" ", "_").Replace(@"\u8209?", "-").Replace(@"\u9586?", "_").Replace("/", "-") + ".pxml";
// B2022-112: If applicability, need to resolve the '<' and '>' characters. Just use the UnitNames, i.e. str, from above.
if (applIdx > 0) fNametmp = Regex.Replace(fNametmp, @"\<U-ID\>", str, RegexOptions.IgnoreCase);
string fileName = PEIPath + "\\" + str + "Approved_Rev_" + ri.RevisionNumber.Replace(" ", "_").Replace("\\", "-").Replace("/", "-") + "_" + fNametmp;
xd.Save(fileName);
FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
void ApprovedRevision_Click(object sender, EventArgs e) void ApprovedRevision_Click(object sender, EventArgs e)
{ {
bool superceded = false; bool superceded = false;