From 4ed39bda9753a9d26196b4307b3d33bbcdb956f7 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 5 Nov 2012 18:58:13 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20problem=20using=20a=20dash=20character?= =?UTF-8?q?=20in=20the=20Title=20field.=20=20Bug=20Fix=20:=20B2012-292,=20?= =?UTF-8?q?fix=20the=20saving=20of=20the=20Title=20field=20when=20creating?= =?UTF-8?q?=20a=20new=20Word=20section=20Added=20a=20check=20for=20the=20e?= =?UTF-8?q?xistence=20of=20a=20temporary=20word=20file=20before=20trying?= =?UTF-8?q?=20to=20create=20it=20Part=20two=20of=20fix=20for=20bug=20B2012?= =?UTF-8?q?-292,=20don=E2=80=99t=20delete=20word=20section=20if=20user=20d?= =?UTF-8?q?eletes=20the=20Title=20text=20in=20the=20step=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS User Interface/frmSectionProperties.cs | 7 ++++--- PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs | 4 ++++ PROMS/Volian.Controls.Library/StepPanel.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 9f3450dc..2b367606 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -40,6 +40,7 @@ namespace VEPROMS this.Text = string.Format("{0} {1} Properties", ii.DisplayNumber, ii.DisplayText); else this.Text = string.Format("{0} Properties", ii.DisplayText); + ppSectTitleStpRTB.Font = ppSectTitleStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); ppSectTitleStpRTB.FieldToEdit = E_FieldToEdit.Text; ppSectTitleStpRTB.BorderStyle = BorderStyle.Fixed3D; ppSectTitleStpRTB.MyItemInfo = ii; @@ -96,15 +97,15 @@ namespace VEPROMS _SectionConfig.MySection.MyContent.DTS = DateTime.Now; _SectionConfig.MySection.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; Section mySection = _SectionConfig.MySection.Save(); - FinishSectionSave(mySection); + SaveText(ppSectNumberStpRTB); // save the section number + SaveText(ppSectTitleStpRTB); // save the section title + FinishSectionSave(mySection); // this will also create an empty Word Doc if this is a word section // if there was a document to delete, do it. if (_DocumentToDelete != null) { Document.Delete(_DocumentToDelete.DocID); _DocumentToDelete = null; } - SaveText(ppSectNumberStpRTB); - SaveText(ppSectTitleStpRTB); mySection.Dispose(); this.DialogResult = DialogResult.OK; this.Close(); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 40c90ff9..98cd1602 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -332,6 +332,10 @@ namespace VEPROMS.CSLA.Library if (_MyDocument != null) { _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); + while (_MyFile.Exists) + { + _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); + } FileStream fs = _MyFile.Create(); if (MyDocument.DocContent != null) fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length); fs.Close(); diff --git a/PROMS/Volian.Controls.Library/StepPanel.cs b/PROMS/Volian.Controls.Library/StepPanel.cs index 86f3a18c..5fd9ab3f 100644 --- a/PROMS/Volian.Controls.Library/StepPanel.cs +++ b/PROMS/Volian.Controls.Library/StepPanel.cs @@ -397,7 +397,7 @@ namespace Volian.Controls.Library if (lastEI != null && lastEI.BeingDisposed == false) { - bool shouldDelete = !lastEI.BeingRemoved && lastEI.Empty; + bool shouldDelete = !lastEI.BeingRemoved && lastEI.Empty && (lastEI.MyItemInfo.MyContent.ContentEntryCount <= 0); if (shouldDelete) { if (lastEI.HasChildren)