Beispiel #1
0
		///<summary>
		/// Method Invocation of wrapper classes
		///<summary>
		protected static FR_DO_GDDfDID_0823_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString,P_DO_GDDfDID_0823 Parameter,CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
		{
			bool cleanupConnection = Connection == null;
			bool cleanupTransaction = Transaction == null;

			FR_DO_GDDfDID_0823_Array functionReturn = new FR_DO_GDDfDID_0823_Array();
			try
			{

				if (cleanupConnection == true) 
				{
					Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
					Connection.Open();
				}
				if (cleanupTransaction == true)
				{
					Transaction = Connection.BeginTransaction();
				}

				functionReturn = Execute(Connection, Transaction,Parameter,securityTicket);

				#region Cleanup Connection/Transaction
				//Commit the transaction 
				if (cleanupTransaction == true)
				{
					Transaction.Commit();
				}
				//Close the connection
				if (cleanupConnection == true)
				{
					Connection.Close();
				}
				#endregion
			}
			catch (Exception ex)
			{
				try
				{
					if (cleanupTransaction == true && Transaction!=null)
					{
						Transaction.Rollback();
					}
				}
				catch { }

				try
				{
					if (cleanupConnection == true && Connection != null)
					{
						Connection.Close();
					}
				}
				catch { }

				throw new Exception("Exception occured in method cls_Get_Doctor_Details_for_DoctorID",ex);
			}
			return functionReturn;
		}
Beispiel #2
0
		protected static FR_DO_GDDfDID_0823_Array Execute(DbConnection Connection,DbTransaction Transaction,P_DO_GDDfDID_0823 Parameter,CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null){
			var returnStatus = new FR_DO_GDDfDID_0823_Array();

			DbCommand command = Connection.CreateCommand();
			command.Connection = Connection;
			command.Transaction = Transaction;
			var commandLocation = "MMDocConnectDBMethods.Doctor.Atomic.Retrieval.SQL.cls_Get_Doctor_Details_for_DoctorID.sql";
			command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
			CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command,"ticket", securityTicket);
			command.CommandTimeout = QueryTimeout;

			CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command,"DoctorID", Parameter.DoctorID);



			List<DO_GDDfDID_0823_raw> results = new List<DO_GDDfDID_0823_raw>();
			var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection,Transaction);
			var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
			try
			{
				reader.SetOrdinals(new string[] { "doctor_account_id","id","doctor_bpt_id","fax","town","address","lanr","name","first_name","last_name","title","IBAN","BankName","BICCode","OwnerText","practice_id","practice","BSNR","sign_in_email","ZIP","city","salutation","Content","Type","CMN_PER_CommunicationContact_TypeID" });
				while(reader.Read())
				{
					DO_GDDfDID_0823_raw resultItem = new DO_GDDfDID_0823_raw();
					//0:Parameter doctor_account_id of type Guid
					resultItem.doctor_account_id = reader.GetGuid(0);
					//1:Parameter id of type Guid
					resultItem.id = reader.GetGuid(1);
					//2:Parameter doctor_bpt_id of type Guid
					resultItem.doctor_bpt_id = reader.GetGuid(2);
					//3:Parameter fax of type String
					resultItem.fax = reader.GetString(3);
					//4:Parameter town of type String
					resultItem.town = reader.GetString(4);
					//5:Parameter address of type String
					resultItem.address = reader.GetString(5);
					//6:Parameter lanr of type String
					resultItem.lanr = reader.GetString(6);
					//7:Parameter name of type String
					resultItem.name = reader.GetString(7);
					//8:Parameter first_name of type String
					resultItem.first_name = reader.GetString(8);
					//9:Parameter last_name of type String
					resultItem.last_name = reader.GetString(9);
					//10:Parameter title of type String
					resultItem.title = reader.GetString(10);
					//11:Parameter IBAN of type String
					resultItem.IBAN = reader.GetString(11);
					//12:Parameter BankName of type String
					resultItem.BankName = reader.GetString(12);
					//13:Parameter BICCode of type String
					resultItem.BICCode = reader.GetString(13);
					//14:Parameter OwnerText of type String
					resultItem.OwnerText = reader.GetString(14);
					//15:Parameter practice_id of type Guid
					resultItem.practice_id = reader.GetGuid(15);
					//16:Parameter practice of type String
					resultItem.practice = reader.GetString(16);
					//17:Parameter BSNR of type String
					resultItem.BSNR = reader.GetString(17);
					//18:Parameter sign_in_email of type String
					resultItem.sign_in_email = reader.GetString(18);
					//19:Parameter ZIP of type String
					resultItem.ZIP = reader.GetString(19);
					//20:Parameter city of type String
					resultItem.city = reader.GetString(20);
					//21:Parameter salutation of type String
					resultItem.salutation = reader.GetString(21);
					//22:Parameter Content of type String
					resultItem.Content = reader.GetString(22);
					//23:Parameter Type of type String
					resultItem.Type = reader.GetString(23);
					//24:Parameter CMN_PER_CommunicationContact_TypeID of type Guid
					resultItem.CMN_PER_CommunicationContact_TypeID = reader.GetGuid(24);

					results.Add(resultItem);
				}


			} 
			catch(Exception ex)
			{
				reader.Close();
				throw new Exception("Exception occured durng data retrieval in method cls_Get_Doctor_Details_for_DoctorID",ex);
			}
			reader.Close();
			//Load all the dictionaries from the datatables
			loader.Load();

			returnStatus.Result = DO_GDDfDID_0823_raw.Convert(results).ToArray();
			return returnStatus;
		}