Added Edit/Initialized config to the Documents
Check to see if MSWord changes should be saved if PROMS is closing
This commit is contained in:
		@@ -270,7 +270,9 @@ namespace DataLoader
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		private int SaveWordDoc(string temppath, string stype, string sectName)
 | 
							private int SaveWordDoc(string temppath, string stype, string sectName)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			return SaveWordDoc(temppath, String.Empty, stype, null, sectName);
 | 
								ConfigInfo ci = new ConfigInfo(null);
 | 
				
			||||||
 | 
								ci.AddItem("Edit", "Initialized", "true");
 | 
				
			||||||
 | 
								return SaveWordDoc(temppath, String.Empty, stype, ci, sectName);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii)
 | 
							private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,6 +70,7 @@ namespace DataLoader
 | 
				
			|||||||
			ConfigInfo ci = new ConfigInfo(null);
 | 
								ConfigInfo ci = new ConfigInfo(null);
 | 
				
			||||||
			string title = null;   // for docname, remove the '.lib', i.e. substring(0,8)
 | 
								string title = null;   // for docname, remove the '.lib', i.e. substring(0,8)
 | 
				
			||||||
			DateTime dts = DateTime.Now;
 | 
								DateTime dts = DateTime.Now;
 | 
				
			||||||
 | 
								ci.AddItem("Edit", "Initialized", "true");
 | 
				
			||||||
			string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
 | 
								string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
 | 
				
			||||||
			int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty);
 | 
								int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty);
 | 
				
			||||||
			File.Delete(tmpRtfFileName);
 | 
								File.Delete(tmpRtfFileName);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,6 +67,24 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
				OnPropertyChanged("LibDoc_Comment");
 | 
									OnPropertyChanged("LibDoc_Comment");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							[Category("Edit")]
 | 
				
			||||||
 | 
							[DisplayName("Initialized")]
 | 
				
			||||||
 | 
							[Description("Initialized")]
 | 
				
			||||||
 | 
							public bool Edit_Initialized
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								get
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									string s = _Xp["Edit", "Initialized"];
 | 
				
			||||||
 | 
									if (s == string.Empty) // If there is no value, then default to false
 | 
				
			||||||
 | 
										s = "false"; // default
 | 
				
			||||||
 | 
									return bool.Parse(s);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								set
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
										_Xp["Edit", "Initialized"] = value.ToString();
 | 
				
			||||||
 | 
										OnPropertyChanged("Edit_Initialized");
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		// RHM 20110415 - These are now stored in the PDF table.
 | 
							// RHM 20110415 - These are now stored in the PDF table.
 | 
				
			||||||
		//[Category("Printing")]
 | 
							//[Category("Printing")]
 | 
				
			||||||
		//[DisplayName("Length")]
 | 
							//[DisplayName("Length")]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -330,6 +330,7 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
			doc.DocAscii = ascii;
 | 
								doc.DocAscii = ascii;
 | 
				
			||||||
			//doc.UpdateDocAscii(_MyFile.FullName);
 | 
								//doc.UpdateDocAscii(_MyFile.FullName);
 | 
				
			||||||
			DocumentConfig cfg = new DocumentConfig(doc);
 | 
								DocumentConfig cfg = new DocumentConfig(doc);
 | 
				
			||||||
 | 
								cfg.Edit_Initialized = true;
 | 
				
			||||||
			doc.Config = cfg.ToString();
 | 
								doc.Config = cfg.ToString();
 | 
				
			||||||
			doc.UserID = Volian.Base.Library.VlnSettings.UserID;
 | 
								doc.UserID = Volian.Base.Library.VlnSettings.UserID;
 | 
				
			||||||
			doc.DTS = _MyFile.LastWriteTime;
 | 
								doc.DTS = _MyFile.LastWriteTime;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -350,6 +350,8 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			try
 | 
								try
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
 | 
									if (!IsBeingDeleted)
 | 
				
			||||||
 | 
										SaveDirty();
 | 
				
			||||||
				this.Enter -= new EventHandler(DSOTabPanel_Enter);
 | 
									this.Enter -= new EventHandler(DSOTabPanel_Enter);
 | 
				
			||||||
				// this.Leave -= new EventHandler(DSOTabPanel_Leave);
 | 
									// this.Leave -= new EventHandler(DSOTabPanel_Leave);
 | 
				
			||||||
				// SaveDirty();   // SaveDirty happens in CloseDSO(bool)
 | 
									// SaveDirty();   // SaveDirty happens in CloseDSO(bool)
 | 
				
			||||||
@@ -415,6 +417,7 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
			try
 | 
								try
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				_MyDSOFramer.Save();
 | 
									_MyDSOFramer.Save();
 | 
				
			||||||
 | 
									_MyDSOFramer_OnSaveCompleted(this, null);
 | 
				
			||||||
				// These are handled in the method above
 | 
									// These are handled in the method above
 | 
				
			||||||
				//LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
 | 
									//LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
 | 
				
			||||||
				//MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName");
 | 
									//MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName");
 | 
				
			||||||
@@ -476,8 +479,6 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
			{
 | 
								{
 | 
				
			||||||
				if (_MyDSOFramer != null)
 | 
									if (_MyDSOFramer != null)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					if(!IsBeingDeleted)
 | 
					 | 
				
			||||||
						SaveDirty();
 | 
					 | 
				
			||||||
					_MyDSOFramer.Close();
 | 
										_MyDSOFramer.Close();
 | 
				
			||||||
					Controls.Remove(_MyDSOFramer);
 | 
										Controls.Remove(_MyDSOFramer);
 | 
				
			||||||
					components.Remove(_MyDSOFramer);
 | 
										components.Remove(_MyDSOFramer);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user