C2024-049-Add-the-ability-for-PROMS-to-remember-the-procedure-tabs-that-were-open-when-you-closed-PROMS
This commit is contained in:
		| @@ -8004,6 +8004,171 @@ namespace VEPROMS.CSLA.Library | ||||
| 			MyContent.Config = _ProcedureConfig.ToString(); | ||||
| 		} | ||||
| 		#endregion | ||||
| 		public class DisplayTabs | ||||
| 		{ | ||||
| 			private int _ItemID; | ||||
| 			public int ItemID | ||||
| 			{ | ||||
| 				get { return _ItemID; } | ||||
| 				set { _ItemID = value; } | ||||
|  | ||||
| 			} | ||||
| 			private string _DisplayTabID; | ||||
| 			public string DisplayTabID | ||||
| 			{ | ||||
| 				get { return _DisplayTabID; } | ||||
| 				set { _DisplayTabID = value; } | ||||
| 			} | ||||
| 			private string _DisplayTabName; | ||||
| 			public string DisplayTabName | ||||
| 			{ | ||||
| 				get { return _DisplayTabName; } | ||||
| 				set { _DisplayTabName = value; } | ||||
| 			} | ||||
|  | ||||
| 			public SafeDataReader Dr { get; } | ||||
|  | ||||
| 			public DisplayTabs() | ||||
| 			{ | ||||
|  | ||||
| 			} | ||||
|  | ||||
| 			public DisplayTabs(int itemID, String displayTabID, String displayTabName) | ||||
| 			{ | ||||
| 				_ItemID = itemID; | ||||
| 				_DisplayTabID = displayTabID; | ||||
| 				_DisplayTabName = displayTabName; | ||||
| 			} | ||||
|  | ||||
| 			public DisplayTabs(SafeDataReader dr) | ||||
| 			{ | ||||
| 				Dr = dr; | ||||
| 			} | ||||
| 		} | ||||
| 		public static DataTable GetDisplayTabs(int itemID) //, string displayTabID, string displayTabName) | ||||
| 		{ | ||||
| 			try | ||||
| 			{ | ||||
| 				DataTable tmp = DataPortal.Fetch<DataTable>(new DisplayTabs(itemID, "", "")); //, displayTabID, displayTabName)); | ||||
| 																								  //ItemInfo.AddList(tmp); | ||||
| 																								  //tmp.AddEvents(); | ||||
| 				return tmp; | ||||
| 			} | ||||
| 			catch (Exception ex) | ||||
| 			{ | ||||
| 				throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); | ||||
| 			} | ||||
| 		} | ||||
| 		private DataTable dt = new DataTable(); | ||||
| 		private DataTable DataPortal_Fetch(DisplayTabs criteria) | ||||
| 		{ | ||||
| 			 | ||||
| 			using (SqlConnection cn = Database.VEPROMS_SqlConnection) | ||||
| 			{ | ||||
| 				using (SqlCommand cm = cn.CreateCommand()) | ||||
| 				{ | ||||
| 					try | ||||
| 					{ | ||||
| 						cm.CommandType = CommandType.StoredProcedure; | ||||
| 						cm.CommandText = "GetDisplayTabData"; | ||||
| 						cm.CommandTimeout = Database.DefaultTimeout; | ||||
| 						SqlDataAdapter da = new SqlDataAdapter(cm); | ||||
| 						da.Fill(dt); | ||||
| 						cn.Close(); | ||||
| 						da.Dispose(); | ||||
| 						return dt; | ||||
| 					} | ||||
| 					catch (Exception ex) | ||||
| 					{ | ||||
| 						//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex); | ||||
| 						throw new DbCslaException("ItemExt.DataPortal_Fetch", ex); | ||||
| 					} | ||||
|  | ||||
| 				}			 | ||||
| 			} | ||||
|  | ||||
| 		} | ||||
| 		//public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName) | ||||
| 		//{ | ||||
| 		//	try | ||||
| 		//	{ | ||||
| 		//		//DisplayTabs tmp =  | ||||
| 		//		DataPortal.Fetch<DisplayTabs>(new DisplayTabs(itemID, displayTabID, displayTabName)); //, displayTabID, displayTabName)); | ||||
| 		//																											  //ItemInfo.AddList(tmp); | ||||
| 		//																											  //tmp.AddEvents(); | ||||
| 		//		//return tmp; | ||||
| 		//	} | ||||
| 		//	catch (Exception ex) | ||||
| 		//	{ | ||||
| 		//		throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); | ||||
| 		//	} | ||||
| 		//} | ||||
| 		//private DataTable dt = new DataTable(); | ||||
| 		//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName) | ||||
| 		//{ | ||||
|  | ||||
| 		//	using (SqlConnection cn = Database.VEPROMS_SqlConnection) | ||||
| 		//	{ | ||||
| 		//		using (SqlCommand cm = cn.CreateCommand()) | ||||
| 		//		{ | ||||
| 		//			try | ||||
| 		//			{ | ||||
| 		//				cm.CommandType = CommandType.StoredProcedure; | ||||
| 		//				cm.CommandText = "AddDisplayTabState"; | ||||
| 		//				cm.CommandTimeout = Database.DefaultTimeout; | ||||
| 		//				cm.Parameters.AddWithValue("@ItemID", ItemID); | ||||
| 		//				cm.Parameters.AddWithValue("@displayTabID", displayTabID); | ||||
| 		//				cm.Parameters.AddWithValue("@displayTabName", displayTabName); | ||||
| 		//				cm.ExecuteNonQuery(); | ||||
| 		//				//SqlDataAdapter da = new SqlDataAdapter(cm); | ||||
| 		//				//da.Fill(dt); | ||||
| 		//				//cn.Close(); | ||||
| 		//				//da.Dispose(); | ||||
| 		//				//return dt; // fix | ||||
| 		//			} | ||||
| 		//			catch (Exception ex) | ||||
| 		//			{ | ||||
| 		//				//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex); | ||||
| 		//				throw new DbCslaException("ItemExt.DataPortal_Fetch", ex); | ||||
| 		//			} | ||||
|  | ||||
| 		//		} | ||||
| 		//	} | ||||
|  | ||||
| 		//} | ||||
| 		public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName) | ||||
| 		//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName) | ||||
| 		{ | ||||
|  | ||||
| 			using (SqlConnection cn = Database.VEPROMS_SqlConnection) | ||||
| 			{ | ||||
| 				using (SqlCommand cm = cn.CreateCommand()) | ||||
| 				{ | ||||
| 					try | ||||
| 					{ | ||||
| 						cm.CommandType = CommandType.StoredProcedure; | ||||
| 						cm.CommandText = "AddDisplayTabState"; | ||||
| 						cm.CommandTimeout = Database.DefaultTimeout; | ||||
| 						cm.Parameters.AddWithValue("@ItemID", itemID); | ||||
| 						cm.Parameters.AddWithValue("@displayTabID", displayTabID); | ||||
| 						cm.Parameters.AddWithValue("@displayTabName", displayTabName); | ||||
| 						cm.ExecuteNonQuery(); | ||||
| 						//SqlDataAdapter da = new SqlDataAdapter(cm); | ||||
| 						//da.Fill(dt); | ||||
| 						//cn.Close(); | ||||
| 						//da.Dispose(); | ||||
| 						//return dt; // fix | ||||
| 					} | ||||
| 					catch (Exception ex) | ||||
| 					{ | ||||
| 						//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex); | ||||
| 						throw new DbCslaException("ItemExt.AddDisplayTabsState", ex); | ||||
| 					} | ||||
|  | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 		} | ||||
| 	} | ||||
| 	#endregion | ||||
| 	#region SectionInfo | ||||
|   | ||||
		Reference in New Issue
	
	Block a user