protected static FR_L5AI_GPOHfA_1434_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AI_GPOHfA_1434 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AI_GPOHfA_1434_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOAdmin_ArticlesInfo.Atomic.Retrieval.SQL.cls_Get_ProcurementOrder_History_for_ArticleID.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, "ArticleID", Parameter.ArticleID); List <L5AI_GPOHfA_1434> results = new List <L5AI_GPOHfA_1434>(); 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[] { "ProcurementOrder_Number", "Position_ValuePerUnit", "Position_Quantity", "Supplier", "Creator", "Position_RequestedDateOfDelivery", "ExpectedDeliveryDate", "TakenIntoStock_AtDate", "IsTakenIntoStock" }); while (reader.Read()) { L5AI_GPOHfA_1434 resultItem = new L5AI_GPOHfA_1434(); //0:Parameter ProcurementOrder_Number of type String resultItem.ProcurementOrder_Number = reader.GetString(0); //1:Parameter Position_ValuePerUnit of type decimal resultItem.Position_ValuePerUnit = reader.GetDecimal(1); //2:Parameter Position_Quantity of type String resultItem.Position_Quantity = reader.GetString(2); //3:Parameter Supplier of type String resultItem.Supplier = reader.GetString(3); //4:Parameter Creator of type String resultItem.Creator = reader.GetString(4); //5:Parameter Position_RequestedDateOfDelivery of type DateTime resultItem.Position_RequestedDateOfDelivery = reader.GetDate(5); //6:Parameter ExpectedDeliveryDate of type DateTime resultItem.ExpectedDeliveryDate = reader.GetDate(6); //7:Parameter TakenIntoStock_AtDate of type DateTime resultItem.TakenIntoStock_AtDate = reader.GetDate(7); //8:Parameter IsTakenIntoStock of type bool resultItem.IsTakenIntoStock = reader.GetBoolean(8); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_ProcurementOrder_History_for_ArticleID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L5IN_GIPfIJ_1449_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5IN_GIPfIJ_1449 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5IN_GIPfIJ_1449_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOLogistic_Inventory.Atomic.Retrieval.SQL.cls_Get_InvetoryProcess_for_InvetoryJobID.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, "InvetoryJobID", Parameter.InvetoryJobID); List <L5IN_GIPfIJ_1449_raw> results = new List <L5IN_GIPfIJ_1449_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[] { "LOG_WRH_INJ_InventoryJob_ProcessID", "ProcessSequenceNumber", "LOG_WRH_INJ_InventoryJob_CountingRunID", "IsCounting_Started", "IsCounting_Completed", "IsCountingListPrinted", "IsDifferenceFound", "SequenceNumber", "LOG_WRH_INJ_InventoryJob_Process_ShelfID", "LOG_WRH_Shelf_RefID" }); while (reader.Read()) { L5IN_GIPfIJ_1449_raw resultItem = new L5IN_GIPfIJ_1449_raw(); //0:Parameter LOG_WRH_INJ_InventoryJob_ProcessID of type Guid resultItem.LOG_WRH_INJ_InventoryJob_ProcessID = reader.GetGuid(0); //1:Parameter ProcessSequenceNumber of type int resultItem.ProcessSequenceNumber = reader.GetInteger(1); //2:Parameter LOG_WRH_INJ_InventoryJob_CountingRunID of type Guid resultItem.LOG_WRH_INJ_InventoryJob_CountingRunID = reader.GetGuid(2); //3:Parameter IsCounting_Started of type bool resultItem.IsCounting_Started = reader.GetBoolean(3); //4:Parameter IsCounting_Completed of type bool resultItem.IsCounting_Completed = reader.GetBoolean(4); //5:Parameter IsCountingListPrinted of type bool resultItem.IsCountingListPrinted = reader.GetBoolean(5); //6:Parameter IsDifferenceFound of type bool resultItem.IsDifferenceFound = reader.GetBoolean(6); //7:Parameter SequenceNumber of type int resultItem.SequenceNumber = reader.GetInteger(7); //8:Parameter LOG_WRH_INJ_InventoryJob_Process_ShelfID of type Guid resultItem.LOG_WRH_INJ_InventoryJob_Process_ShelfID = reader.GetGuid(8); //9:Parameter LOG_WRH_Shelf_RefID of type Guid resultItem.LOG_WRH_Shelf_RefID = reader.GetGuid(9); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_InvetoryProcess_for_InvetoryJobID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5IN_GIPfIJ_1449_raw.Convert(results).ToArray(); return(returnStatus); }
protected static FR_DO_GPDFR_0840 Execute(DbConnection Connection, DbTransaction Transaction, P_DO_GPDFR_0840 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_DO_GPDFR_0840(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "MMDocConnectDBMethods.Doctor.Atomic.Retrieval.SQL.cls_Get_Practice_Details_for_Report.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, "PracticeID", Parameter.PracticeID); List <DO_GPDFR_0840> results = new List <DO_GPDFR_0840>(); 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[] { "AccountID", "BankAccountID", "Name", "City", "BSNR", "ZIP", "Street_Number", "Street_Name", "Contact_Telephone", "Contact_Email", "BankName", "BICCode", "IBAN", "AccountHolder", "IsSurgeryPractice" }); while (reader.Read()) { DO_GPDFR_0840 resultItem = new DO_GPDFR_0840(); //0:Parameter AccountID of type Guid resultItem.AccountID = reader.GetGuid(0); //1:Parameter BankAccountID of type Guid resultItem.BankAccountID = reader.GetGuid(1); //2:Parameter Name of type String resultItem.Name = reader.GetString(2); //3:Parameter City of type String resultItem.City = reader.GetString(3); //4:Parameter BSNR of type String resultItem.BSNR = reader.GetString(4); //5:Parameter ZIP of type String resultItem.ZIP = reader.GetString(5); //6:Parameter Street_Number of type String resultItem.Street_Number = reader.GetString(6); //7:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(7); //8:Parameter Contact_Telephone of type String resultItem.Contact_Telephone = reader.GetString(8); //9:Parameter Contact_Email of type String resultItem.Contact_Email = reader.GetString(9); //10:Parameter BankName of type String resultItem.BankName = reader.GetString(10); //11:Parameter BICCode of type String resultItem.BICCode = reader.GetString(11); //12:Parameter IBAN of type String resultItem.IBAN = reader.GetString(12); //13:Parameter AccountHolder of type String resultItem.AccountHolder = reader.GetString(13); //14:Parameter IsSurgeryPractice of type bool resultItem.IsSurgeryPractice = reader.GetBoolean(14); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Practice_Details_for_Report", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.FirstOrDefault(); return(returnStatus); }
private static List <ORM_ORD_CUO_CustomerOrder_Note> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_ORD_CUO_CustomerOrder_Note> items; try { managedConnection.set(connectionString, connection, transaction); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction()); DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName)); query.SetParameters(command); items = new List <ORM_ORD_CUO_CustomerOrder_Note>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "ORD_CUO_CustomerOrder_NoteID", "CustomerOrder_Header_RefID", "CustomerOrder_Position_RefID", "CMN_BPT_CTM_OrganizationalUnit_RefID", "CreatedBy_BusinessParticipant_RefID", "Title", "Comment", "NotePublishDate", "SequenceOrderNumber", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { ORM_ORD_CUO_CustomerOrder_Note item = new ORM_ORD_CUO_CustomerOrder_Note(); //0:Parameter ORD_CUO_CustomerOrder_NoteID of type Guid item.ORD_CUO_CustomerOrder_NoteID = reader.GetGuid(0); //1:Parameter CustomerOrder_Header_RefID of type Guid item.CustomerOrder_Header_RefID = reader.GetGuid(1); //2:Parameter CustomerOrder_Position_RefID of type Guid item.CustomerOrder_Position_RefID = reader.GetGuid(2); //3:Parameter CMN_BPT_CTM_OrganizationalUnit_RefID of type Guid item.CMN_BPT_CTM_OrganizationalUnit_RefID = reader.GetGuid(3); //4:Parameter CreatedBy_BusinessParticipant_RefID of type Guid item.CreatedBy_BusinessParticipant_RefID = reader.GetGuid(4); //5:Parameter Title of type String item.Title = reader.GetString(5); //6:Parameter Comment of type String item.Comment = reader.GetString(6); //7:Parameter NotePublishDate of type DateTime item.NotePublishDate = reader.GetDate(7); //8:Parameter SequenceOrderNumber of type int item.SequenceOrderNumber = reader.GetInteger(8); //9:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(9); //10:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(10); //11:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(11); item.Status_IsAlreadySaved = true; item.Status_IsDirty = false; items.Add(item); } reader.Close(); loader.Load(); managedConnection.commit(); } catch (Exception ex) { managedConnection.rollback(); throw; } return(items); }
private static List <ORM_CMN_STR_PPS_Workplace> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_CMN_STR_PPS_Workplace> items; try { managedConnection.set(connectionString, connection, transaction); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction()); DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName)); query.SetParameters(command); items = new List <ORM_CMN_STR_PPS_Workplace>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_STR_PPS_WorkplaceID", "WorkArea_RefID", "Name_DictID", "Description_DictID", "CMN_CAL_CalendarInstance_RefID", "ShortName", "IsMockObject", "DisplayColor", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { ORM_CMN_STR_PPS_Workplace item = new ORM_CMN_STR_PPS_Workplace(); //0:Parameter CMN_STR_PPS_WorkplaceID of type Guid item.CMN_STR_PPS_WorkplaceID = reader.GetGuid(0); //1:Parameter WorkArea_RefID of type Guid item.WorkArea_RefID = reader.GetGuid(1); //2:Parameter Name of type Dict item.Name = reader.GetDictionary(2); loader.Append(item.Name, TableName); //3:Parameter Description of type Dict item.Description = reader.GetDictionary(3); loader.Append(item.Description, TableName); //4:Parameter CMN_CAL_CalendarInstance_RefID of type Guid item.CMN_CAL_CalendarInstance_RefID = reader.GetGuid(4); //5:Parameter ShortName of type String item.ShortName = reader.GetString(5); //6:Parameter IsMockObject of type Boolean item.IsMockObject = reader.GetBoolean(6); //7:Parameter DisplayColor of type String item.DisplayColor = reader.GetString(7); //8:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(8); //9:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(9); //10:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(10); item.Status_IsAlreadySaved = true; item.Status_IsDirty = false; items.Add(item); } reader.Close(); loader.Load(); managedConnection.commit(); } catch (Exception ex) { managedConnection.rollback(); throw ex; } return(items); }
protected static FR_L2WH_GWHfIoT_1442_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L2WH_GWHfIoT_1442 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L2WH_GWHfIoT_1442_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL2_Warehouse.Atomic.Retrieval.SQL.cls_Get_Warehouse_for_ID_or_TenantID.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, "WarehouseID", Parameter.WarehouseID); List <L2WH_GWHfIoT_1442> results = new List <L2WH_GWHfIoT_1442>(); 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[] { "LOG_WRH_WarehouseID", "LOG_WRH_Warehouse_Group_RefID", "CoordinateCode", "Warehouse_Name", "DeliveryAddress_RefID", "BoundTo_EconomicRegion_RefID", "IsStructureHidden", "IsConsignmentWarehouse", "IfConsignmentWarehouse_DefaultOwningSupplier_RefID", "IsDefaultShipmentWarehouse", "IsDeleted", "CMN_BPT_Supplier_RefID" }); while (reader.Read()) { L2WH_GWHfIoT_1442 resultItem = new L2WH_GWHfIoT_1442(); //0:Parameter LOG_WRH_WarehouseID of type Guid resultItem.LOG_WRH_WarehouseID = reader.GetGuid(0); //1:Parameter LOG_WRH_Warehouse_Group_RefID of type Guid resultItem.LOG_WRH_Warehouse_Group_RefID = reader.GetGuid(1); //2:Parameter CoordinateCode of type String resultItem.CoordinateCode = reader.GetString(2); //3:Parameter Warehouse_Name of type String resultItem.Warehouse_Name = reader.GetString(3); //4:Parameter DeliveryAddress_RefID of type Guid resultItem.DeliveryAddress_RefID = reader.GetGuid(4); //5:Parameter BoundTo_EconomicRegion_RefID of type Guid resultItem.BoundTo_EconomicRegion_RefID = reader.GetGuid(5); //6:Parameter IsStructureHidden of type bool resultItem.IsStructureHidden = reader.GetBoolean(6); //7:Parameter IsConsignmentWarehouse of type bool resultItem.IsConsignmentWarehouse = reader.GetBoolean(7); //8:Parameter IfConsignmentWarehouse_DefaultOwningSupplier_RefID of type Guid resultItem.IfConsignmentWarehouse_DefaultOwningSupplier_RefID = reader.GetGuid(8); //9:Parameter IsDefaultShipmentWarehouse of type bool resultItem.IsDefaultShipmentWarehouse = reader.GetBoolean(9); //10:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(10); //11:Parameter CMN_BPT_Supplier_RefID of type Guid resultItem.CMN_BPT_Supplier_RefID = reader.GetGuid(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Warehouse_for_ID_or_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private FR_Base Load(DbConnection connection, DbTransaction transaction, Guid objectId, string connectionString) { //Standard return type var retStatus = new FR_Base(); var cleanupConnection = false; var cleanupTransaction = false; try { #region Verify/Create Connections //Create connection if Connection is null if (connection == null) { cleanupConnection = true; connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(connectionString); connection.Open(); } //If transaction is not open/not valid if (transaction == null) { cleanupTransaction = true; transaction = connection.BeginTransaction(); } #endregion //Get the Select query #pragma warning disable CA2000 // Dispose objects before losing scope var selectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_BIL.BIL_BillHeader_History.SQL.Select.sql")).ReadToEnd(); #pragma warning restore CA2000 // Dispose objects before losing scope var command = connection.CreateCommand(); //Set Connection/Transaction command.Connection = connection; command.Transaction = transaction; //Set Query/Timeout command.CommandText = selectQuery; command.CommandTimeout = QueryTimeout; //Firstly, before loading, set the GUID to empty //So the entity does not exist, it will have a GUID set to empty _BIL_BillHeader_HistoryID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BIL_BillHeader_HistoryID", objectId); #region Command Execution var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(connection, transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new[] { "BIL_BillHeader_HistoryID", "BillHeader_RefID", "IsCreated", "IsModified", "IsSentToCustomer", "TriggeredBy_BusinessParticipant_RefID", "Comment", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); if (reader.HasRows) { reader.Read(); //Single result only //0:Parameter BIL_BillHeader_HistoryID of type Guid _BIL_BillHeader_HistoryID = reader.GetGuid(0); //1:Parameter BillHeader_RefID of type Guid _BillHeader_RefID = reader.GetGuid(1); //2:Parameter IsCreated of type Boolean _IsCreated = reader.GetBoolean(2); //3:Parameter IsModified of type Boolean _IsModified = reader.GetBoolean(3); //4:Parameter IsSentToCustomer of type Boolean _IsSentToCustomer = reader.GetBoolean(4); //5:Parameter TriggeredBy_BusinessParticipant_RefID of type Guid _TriggeredBy_BusinessParticipant_RefID = reader.GetGuid(5); //6:Parameter Comment of type String _Comment = reader.GetString(6); //7:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(7); //8:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(8); //9:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(9); //10:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(10); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_BIL_BillHeader_HistoryID != Guid.Empty) { //Successfully loaded StatusIsAlreadySaved = true; StatusIsDirty = false; } else { //Fault in loading due to invalid UUID (Guid) StatusIsAlreadySaved = false; StatusIsDirty = false; } #endregion #region Cleanup Transaction/Connection //If we started the transaction, we will commit it if (cleanupTransaction) { transaction.Commit(); } //If we opened the connection we will close it if (cleanupConnection) { connection.Close(); } #endregion } catch (Exception) { try { if (cleanupTransaction) { transaction?.Rollback(); } } catch { // ignored } try { if (cleanupConnection) { connection?.Close(); } } catch { // ignored } throw; } return(retStatus); }
protected static FR_L5ACACU_GCCfT_1715_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5ACACU_GCCfT_1715_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOCustomerAdmin_Customer.Atomic.Retrieval.SQL.cls_Get_PersonCustomers_for_TenantID.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; List <L5ACACU_GCCfT_1715> results = new List <L5ACACU_GCCfT_1715>(); 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[] { "CMN_BPT_CTM_CustomerID", "LastName", "CMN_PER_PersonInfoID", "FirstName", "CMN_BPT_BusinessParticipantID", "BirthDate", "ACC_PAY_Type_RefID", "InternalCustomerNumber", "ACC_PAY_Condition_RefID", "DisplayName", "IsRepresentedByLegalGuardian", "LegalGuardianDisplayName", "IsCustomerOrderAutomaticallyApprovedOnReceipt", "NumberOfComments" }); while (reader.Read()) { L5ACACU_GCCfT_1715 resultItem = new L5ACACU_GCCfT_1715(); //0:Parameter CMN_BPT_CTM_CustomerID of type Guid resultItem.CMN_BPT_CTM_CustomerID = reader.GetGuid(0); //1:Parameter LastName of type String resultItem.LastName = reader.GetString(1); //2:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(2); //3:Parameter FirstName of type String resultItem.FirstName = reader.GetString(3); //4:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(4); //5:Parameter BirthDate of type DateTime resultItem.BirthDate = reader.GetDate(5); //6:Parameter ACC_PAY_Type_RefID of type Guid resultItem.ACC_PAY_Type_RefID = reader.GetGuid(6); //7:Parameter InternalCustomerNumber of type String resultItem.InternalCustomerNumber = reader.GetString(7); //8:Parameter ACC_PAY_Condition_RefID of type Guid resultItem.ACC_PAY_Condition_RefID = reader.GetGuid(8); //9:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(9); //10:Parameter IsRepresentedByLegalGuardian of type bool resultItem.IsRepresentedByLegalGuardian = reader.GetBoolean(10); //11:Parameter LegalGuardianDisplayName of type String resultItem.LegalGuardianDisplayName = reader.GetString(11); //12:Parameter IsCustomerOrderAutomaticallyApprovedOnReceipt of type bool resultItem.IsCustomerOrderAutomaticallyApprovedOnReceipt = reader.GetBoolean(12); //13:Parameter NumberOfComments of type int resultItem.NumberOfComments = reader.GetInteger(13); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_PersonCustomers_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_HEC_ACT_PlannedAction> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_HEC_ACT_PlannedAction> items; try { managedConnection.set(connectionString, connection, transaction); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction()); DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName)); query.SetParameters(command); items = new List <ORM_HEC_ACT_PlannedAction>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "HEC_ACT_PlannedActionID", "HealthcarePlannedActionITL", "Patient_RefID", "Appointment_RefID", "PlannedFor_Date", "IsPerformed", "IfPerformed_PerformedAction_RefID", "IsToBePerformedExternally", "MedicalPractice_RefID", "MedicalPracticeType_RefID", "ToBePerformedBy_BusinessParticipant_RefID", "IsPlannedFollowup", "IfPlannedFollowup_PreviousAction_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); while (reader.Read()) { ORM_HEC_ACT_PlannedAction item = new ORM_HEC_ACT_PlannedAction(); //0:Parameter HEC_ACT_PlannedActionID of type Guid item.HEC_ACT_PlannedActionID = reader.GetGuid(0); //1:Parameter HealthcarePlannedActionITL of type String item.HealthcarePlannedActionITL = reader.GetString(1); //2:Parameter Patient_RefID of type Guid item.Patient_RefID = reader.GetGuid(2); //3:Parameter Appointment_RefID of type Guid item.Appointment_RefID = reader.GetGuid(3); //4:Parameter PlannedFor_Date of type DateTime item.PlannedFor_Date = reader.GetDate(4); //5:Parameter IsPerformed of type Boolean item.IsPerformed = reader.GetBoolean(5); //6:Parameter IfPerformed_PerformedAction_RefID of type Guid item.IfPerformed_PerformedAction_RefID = reader.GetGuid(6); //7:Parameter IsToBePerformedExternally of type Boolean item.IsToBePerformedExternally = reader.GetBoolean(7); //8:Parameter MedicalPractice_RefID of type Guid item.MedicalPractice_RefID = reader.GetGuid(8); //9:Parameter MedicalPracticeType_RefID of type Guid item.MedicalPracticeType_RefID = reader.GetGuid(9); //10:Parameter ToBePerformedBy_BusinessParticipant_RefID of type Guid item.ToBePerformedBy_BusinessParticipant_RefID = reader.GetGuid(10); //11:Parameter IsPlannedFollowup of type Boolean item.IsPlannedFollowup = reader.GetBoolean(11); //12:Parameter IfPlannedFollowup_PreviousAction_RefID of type Guid item.IfPlannedFollowup_PreviousAction_RefID = reader.GetGuid(12); //13:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(13); //14:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(14); //15:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(15); //16:Parameter Modification_Timestamp of type DateTime item.Modification_Timestamp = reader.GetDate(16); item.Status_IsAlreadySaved = true; item.Status_IsDirty = false; items.Add(item); } reader.Close(); loader.Load(); managedConnection.commit(); } catch (Exception ex) { managedConnection.rollback(); throw; } return(items); }
protected static FR_L5CO_GCOHwPnCI_0820_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5CO_GCOHwPnCI_0820_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOBackoffice_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions.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; List <L5CO_GCOHwPnCI_0820_raw> results = new List <L5CO_GCOHwPnCI_0820_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[] { "ORD_CUO_CustomerOrder_HeaderID", "IfCompany_CMN_COM_CompanyInfo_RefID", "CustomerOrder_Number", "OrderedByCompanyName", "OrderedByEmail", "CustomerOrder_Date", "TotalValue_BeforeTax", "Status_Code", "Status_Name_DictID", "GlobalPropertyMatchingID", "OrderCreatedBy", "IsCustomerOrderFinalized", "ConfirmedBy_DisplayName", "Product_Name_DictID", "Product_Number", "CustomerOrder_Header_RefID", "PackageContent_Amount", "PackageContent_MeasuredInUnit_RefID", "DosageForm_Name_DictID", "Abbreviation_DictID", "Label_DictID", "ORD_CUO_CustomerOrder_PositionID", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "TaxRate", "TaxName_DictID", "EconomicRegion_RefID", "ApplicableSalesTax_RefID" }); while (reader.Read()) { L5CO_GCOHwPnCI_0820_raw resultItem = new L5CO_GCOHwPnCI_0820_raw(); //0:Parameter ORD_CUO_CustomerOrder_HeaderID of type Guid resultItem.ORD_CUO_CustomerOrder_HeaderID = reader.GetGuid(0); //1:Parameter IfCompany_CMN_COM_CompanyInfo_RefID of type Guid resultItem.IfCompany_CMN_COM_CompanyInfo_RefID = reader.GetGuid(1); //2:Parameter CustomerOrder_Number of type String resultItem.CustomerOrder_Number = reader.GetString(2); //3:Parameter OrderedByCompanyName of type String resultItem.OrderedByCompanyName = reader.GetString(3); //4:Parameter OrderedByEmail of type String resultItem.OrderedByEmail = reader.GetString(4); //5:Parameter CustomerOrder_Date of type DateTime resultItem.CustomerOrder_Date = reader.GetDate(5); //6:Parameter TotalValue_BeforeTax of type Decimal resultItem.TotalValue_BeforeTax = reader.GetDecimal(6); //7:Parameter Status_Code of type String resultItem.Status_Code = reader.GetString(7); //8:Parameter Status_Name of type Dict resultItem.Status_Name = reader.GetDictionary(8); resultItem.Status_Name.SourceTable = "ord_cuo_customerorder_statuses"; loader.Append(resultItem.Status_Name); //9:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(9); //10:Parameter OrderCreatedBy of type String resultItem.OrderCreatedBy = reader.GetString(10); //11:Parameter IsCustomerOrderFinalized of type Boolean resultItem.IsCustomerOrderFinalized = reader.GetBoolean(11); //12:Parameter ConfirmedBy_DisplayName of type String resultItem.ConfirmedBy_DisplayName = reader.GetString(12); //13:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(13); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //14:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(14); //15:Parameter CustomerOrder_Header_RefID of type Guid resultItem.CustomerOrder_Header_RefID = reader.GetGuid(15); //16:Parameter PackageContent_Amount of type String resultItem.PackageContent_Amount = reader.GetString(16); //17:Parameter PackageContent_MeasuredInUnit_RefID of type Guid resultItem.PackageContent_MeasuredInUnit_RefID = reader.GetGuid(17); //18:Parameter DosageForm_Name of type Dict resultItem.DosageForm_Name = reader.GetDictionary(18); resultItem.DosageForm_Name.SourceTable = "hec_product_dosageforms"; loader.Append(resultItem.DosageForm_Name); //19:Parameter Abbreviation of type Dict resultItem.Abbreviation = reader.GetDictionary(19); resultItem.Abbreviation.SourceTable = "cmn_units"; loader.Append(resultItem.Abbreviation); //20:Parameter Label of type Dict resultItem.Label = reader.GetDictionary(20); resultItem.Label.SourceTable = "cmn_units"; loader.Append(resultItem.Label); //21:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid resultItem.ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(21); //22:Parameter Position_Quantity of type double resultItem.Position_Quantity = reader.GetDouble(22); //23:Parameter Position_ValuePerUnit of type Decimal resultItem.Position_ValuePerUnit = reader.GetDecimal(23); //24:Parameter Position_ValueTotal of type Decimal resultItem.Position_ValueTotal = reader.GetDecimal(24); //25:Parameter TaxRate of type double resultItem.TaxRate = reader.GetDouble(25); //26:Parameter TaxName_DictID of type Dict resultItem.TaxName_DictID = reader.GetDictionary(26); resultItem.TaxName_DictID.SourceTable = "acc_tax_taxes"; loader.Append(resultItem.TaxName_DictID); //27:Parameter EconomicRegion_RefID of type Guid resultItem.EconomicRegion_RefID = reader.GetGuid(27); //28:Parameter ApplicableSalesTax_RefID of type Guid resultItem.ApplicableSalesTax_RefID = reader.GetGuid(28); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5CO_GCOHwPnCI_0820_raw.Convert(results).ToArray(); return(returnStatus); }
protected static FR_L5PR_GSCDfP_1437_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5PR_GSCDfP_1437 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PR_GSCDfP_1437_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_Product.Atomic.Retrieval.SQL.cls_Get_SupplyChainData_for_Product.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, "ProductID", Parameter.ProductID); List <L5PR_GSCDfP_1437> results = new List <L5PR_GSCDfP_1437>(); 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[] { "EconomicRegion_Name_DictID", "ParentEconomicRegion_RefID", "CMN_EconomicRegionID", "LOG_WRH_WarehouseID", "Warehouse_Name", "CMN_BPT_SupplierID", "ExternalSupplierProvidedIdentifier", "DisplayName", "CMN_PRO_Product_SupplierID" }); while (reader.Read()) { L5PR_GSCDfP_1437 resultItem = new L5PR_GSCDfP_1437(); //0:Parameter EconomicRegion_Name of type Dict resultItem.EconomicRegion_Name = reader.GetDictionary(0); resultItem.EconomicRegion_Name.SourceTable = "cmn_economicregion"; loader.Append(resultItem.EconomicRegion_Name); //1:Parameter ParentEconomicRegion_RefID of type Guid resultItem.ParentEconomicRegion_RefID = reader.GetGuid(1); //2:Parameter CMN_EconomicRegionID of type Guid resultItem.CMN_EconomicRegionID = reader.GetGuid(2); //3:Parameter LOG_WRH_WarehouseID of type Guid resultItem.LOG_WRH_WarehouseID = reader.GetGuid(3); //4:Parameter Warehouse_Name of type String resultItem.Warehouse_Name = reader.GetString(4); //5:Parameter CMN_BPT_SupplierID of type Guid resultItem.CMN_BPT_SupplierID = reader.GetGuid(5); //6:Parameter ExternalSupplierProvidedIdentifier of type String resultItem.ExternalSupplierProvidedIdentifier = reader.GetString(6); //7:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(7); //8:Parameter CMN_PRO_Product_SupplierID of type Guid resultItem.CMN_PRO_Product_SupplierID = reader.GetGuid(8); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_SupplyChainData_for_Product", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_RES_BLD_Building> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_RES_BLD_Building> items; try { managedConnection.set(connectionString, connection, transaction); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction()); DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName)); query.SetParameters(command); items = new List <ORM_RES_BLD_Building>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "RES_BLD_BuildingID", "Building_CurrentAverageRentPrice_per_sqm_RefID", "BuildingRevisionHeader_RefID", "Building_BalconyPortionPercent", "Building_Name", "Building_DocumentationStructure_RefID", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" }); while (reader.Read()) { ORM_RES_BLD_Building item = new ORM_RES_BLD_Building(); //0:Parameter RES_BLD_BuildingID of type Guid item.RES_BLD_BuildingID = reader.GetGuid(0); //1:Parameter Building_CurrentAverageRentPrice_per_sqm_RefID of type Guid item.Building_CurrentAverageRentPrice_per_sqm_RefID = reader.GetGuid(1); //2:Parameter BuildingRevisionHeader_RefID of type Guid item.BuildingRevisionHeader_RefID = reader.GetGuid(2); //3:Parameter Building_BalconyPortionPercent of type double item.Building_BalconyPortionPercent = reader.GetDouble(3); //4:Parameter Building_Name of type String item.Building_Name = reader.GetString(4); //5:Parameter Building_DocumentationStructure_RefID of type Guid item.Building_DocumentationStructure_RefID = reader.GetGuid(5); //6:Parameter IsContaminationSuspected of type Boolean item.IsContaminationSuspected = reader.GetBoolean(6); //7:Parameter Building_NumberOfFloors of type int item.Building_NumberOfFloors = reader.GetInteger(7); //8:Parameter Building_ElevatorCoveragePercent of type double item.Building_ElevatorCoveragePercent = reader.GetDouble(8); //9:Parameter Building_NumberOfAppartments of type int item.Building_NumberOfAppartments = reader.GetInteger(9); //10:Parameter Building_NumberOfOccupiedAppartments of type int item.Building_NumberOfOccupiedAppartments = reader.GetInteger(10); //11:Parameter Building_NumberOfOffices of type int item.Building_NumberOfOffices = reader.GetInteger(11); //12:Parameter Building_NumberOfRetailUnits of type int item.Building_NumberOfRetailUnits = reader.GetInteger(12); //13:Parameter Building_NumberOfProductionUnits of type int item.Building_NumberOfProductionUnits = reader.GetInteger(13); //14:Parameter Building_NumberOfOtherUnits of type int item.Building_NumberOfOtherUnits = reader.GetInteger(14); //15:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(15); //16:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(16); //17:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(17); item.Status_IsAlreadySaved = true; item.Status_IsDirty = false; items.Add(item); } reader.Close(); loader.Load(); managedConnection.commit(); } catch (Exception ex) { managedConnection.rollback(); throw ex; } return(items); }
private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString) { //Standard return type FR_Base retStatus = new FR_Base(); bool cleanupConnection = false; bool cleanupTransaction = false; try { #region Verify/Create Connections //Create connection if Connection is null if (Connection == null) { cleanupConnection = true; Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } //If transaction is not open/not valid if (Transaction == null) { cleanupTransaction = true; Transaction = Connection.BeginTransaction(); } #endregion //Get the SelectQuerry string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_RES_BLD.RES_BLD_Building.SQL.Select.sql")).ReadToEnd(); DbCommand command = Connection.CreateCommand(); //Set Connection/Transaction command.Connection = Connection; command.Transaction = Transaction; //Set Query/Timeout command.CommandText = SelectQuery; command.CommandTimeout = QueryTimeout; //Firstly, before loading, set the GUID to empty //So the entity does not exist, it will have a GUID set to empty _RES_BLD_BuildingID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RES_BLD_BuildingID", ObjectID); #region Command Execution try { var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "RES_BLD_BuildingID", "Building_CurrentAverageRentPrice_per_sqm_RefID", "BuildingRevisionHeader_RefID", "Building_BalconyPortionPercent", "Building_Name", "Building_DocumentationStructure_RefID", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter RES_BLD_BuildingID of type Guid _RES_BLD_BuildingID = reader.GetGuid(0); //1:Parameter Building_CurrentAverageRentPrice_per_sqm_RefID of type Guid _Building_CurrentAverageRentPrice_per_sqm_RefID = reader.GetGuid(1); //2:Parameter BuildingRevisionHeader_RefID of type Guid _BuildingRevisionHeader_RefID = reader.GetGuid(2); //3:Parameter Building_BalconyPortionPercent of type double _Building_BalconyPortionPercent = reader.GetDouble(3); //4:Parameter Building_Name of type String _Building_Name = reader.GetString(4); //5:Parameter Building_DocumentationStructure_RefID of type Guid _Building_DocumentationStructure_RefID = reader.GetGuid(5); //6:Parameter IsContaminationSuspected of type Boolean _IsContaminationSuspected = reader.GetBoolean(6); //7:Parameter Building_NumberOfFloors of type int _Building_NumberOfFloors = reader.GetInteger(7); //8:Parameter Building_ElevatorCoveragePercent of type double _Building_ElevatorCoveragePercent = reader.GetDouble(8); //9:Parameter Building_NumberOfAppartments of type int _Building_NumberOfAppartments = reader.GetInteger(9); //10:Parameter Building_NumberOfOccupiedAppartments of type int _Building_NumberOfOccupiedAppartments = reader.GetInteger(10); //11:Parameter Building_NumberOfOffices of type int _Building_NumberOfOffices = reader.GetInteger(11); //12:Parameter Building_NumberOfRetailUnits of type int _Building_NumberOfRetailUnits = reader.GetInteger(12); //13:Parameter Building_NumberOfProductionUnits of type int _Building_NumberOfProductionUnits = reader.GetInteger(13); //14:Parameter Building_NumberOfOtherUnits of type int _Building_NumberOfOtherUnits = reader.GetInteger(14); //15:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(15); //16:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(16); //17:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(17); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_RES_BLD_BuildingID != Guid.Empty) { //Successfully loaded Status_IsAlreadySaved = true; Status_IsDirty = false; } else { //Fault in loading due to invalid UUID (Guid) Status_IsAlreadySaved = false; Status_IsDirty = false; } } catch (Exception ex) { throw ex; } #endregion #region Cleanup Transaction/Connection //If we started the transaction, we will commit it if (cleanupTransaction && Transaction != null) { Transaction.Commit(); } //If we opened the connection we will close it if (cleanupConnection && Connection != null) { 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 ex; } return(retStatus); }
protected static FR_L5OU_GOUDEUID_1502 Execute(DbConnection Connection, DbTransaction Transaction, P_L5OU_GOUDEUID_1502 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5OU_GOUDEUID_1502(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_OrgUnits.Atomic.Retrieval.SQL.cls_Get_OrgUnitData_Edit_for_UnitID.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, "OfficeID", Parameter.OfficeID); List <L5OU_GOUDEUID_1502_raw> results = new List <L5OU_GOUDEUID_1502_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[] { "CMN_STR_OfficeID", "Parent_RefID", "DisplayImage_Document_RefID", "Office_Name_DictID", "PhoneNumber", "Default_Email", "Default_Website", "Comment", "ContactPersonFirstName", "ContactPersonLastName", "ContactPersonTitle", "ParentNameDict", "CMN_AddressID", "IsDefaultAddress", "IsSpecialAddress", "IsBillingAddress", "IsShippingAddress", "Street_Name", "Street_Number", "City_Name", "ZIP", "Longitude", "Lattitude", "Country_ISOCode", "Country_Name", "PPS_TSK_Task_Template_RefID", "HEC_MedicalPractice_TypeID", "MedicalPracticeType_Name_DictID", "CMN_LanguageID", "IsDeleted", "Name_DictID" }); while (reader.Read()) { L5OU_GOUDEUID_1502_raw resultItem = new L5OU_GOUDEUID_1502_raw(); //0:Parameter CMN_STR_OfficeID of type Guid resultItem.CMN_STR_OfficeID = reader.GetGuid(0); //1:Parameter Parent_RefID of type Guid resultItem.Parent_RefID = reader.GetGuid(1); //2:Parameter DisplayImage_Document_RefID of type Guid resultItem.DisplayImage_Document_RefID = reader.GetGuid(2); //3:Parameter Office_Name of type Dict resultItem.Office_Name = reader.GetDictionary(3); resultItem.Office_Name.SourceTable = "cmn_str_offices"; loader.Append(resultItem.Office_Name); //4:Parameter PhoneNumber of type String resultItem.PhoneNumber = reader.GetString(4); //5:Parameter Default_Email of type String resultItem.Default_Email = reader.GetString(5); //6:Parameter Default_Website of type String resultItem.Default_Website = reader.GetString(6); //7:Parameter Comment of type String resultItem.Comment = reader.GetString(7); //8:Parameter ContactPersonFirstName of type String resultItem.ContactPersonFirstName = reader.GetString(8); //9:Parameter ContactPersonLastName of type String resultItem.ContactPersonLastName = reader.GetString(9); //10:Parameter ContactPersonTitle of type String resultItem.ContactPersonTitle = reader.GetString(10); //11:Parameter ParentNameDict of type Dict resultItem.ParentNameDict = reader.GetDictionary(11); resultItem.ParentNameDict.SourceTable = "cmn_str_offices"; loader.Append(resultItem.ParentNameDict); //12:Parameter CMN_AddressID of type Guid resultItem.CMN_AddressID = reader.GetGuid(12); //13:Parameter IsDefaultAddress of type bool resultItem.IsDefaultAddress = reader.GetBoolean(13); //14:Parameter IsSpecialAddress of type bool resultItem.IsSpecialAddress = reader.GetBoolean(14); //15:Parameter IsBillingAddress of type bool resultItem.IsBillingAddress = reader.GetBoolean(15); //16:Parameter IsShippingAddress of type bool resultItem.IsShippingAddress = reader.GetBoolean(16); //17:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(17); //18:Parameter Street_Number of type String resultItem.Street_Number = reader.GetString(18); //19:Parameter City_Name of type String resultItem.City_Name = reader.GetString(19); //20:Parameter ZIP of type String resultItem.ZIP = reader.GetString(20); //21:Parameter Longitude of type double resultItem.Longitude = reader.GetDouble(21); //22:Parameter Lattitude of type double resultItem.Lattitude = reader.GetDouble(22); //23:Parameter Country_ISOCode of type String resultItem.Country_ISOCode = reader.GetString(23); //24:Parameter Country_Name of type String resultItem.Country_Name = reader.GetString(24); //25:Parameter PPS_TSK_Task_Template_RefID of type Guid resultItem.PPS_TSK_Task_Template_RefID = reader.GetGuid(25); //26:Parameter HEC_MedicalPractice_TypeID of type Guid resultItem.HEC_MedicalPractice_TypeID = reader.GetGuid(26); //27:Parameter Medical_Practice_Type_Name of type Dict resultItem.Medical_Practice_Type_Name = reader.GetDictionary(27); resultItem.Medical_Practice_Type_Name.SourceTable = "hec_medicalpractice_types"; loader.Append(resultItem.Medical_Practice_Type_Name); //28:Parameter CMN_LanguageID of type Guid resultItem.CMN_LanguageID = reader.GetGuid(28); //29:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(29); //30:Parameter Name of type Dict resultItem.Name = reader.GetDictionary(30); resultItem.Name.SourceTable = "cmn_languages"; loader.Append(resultItem.Name); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_OrgUnitData_Edit_for_UnitID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5OU_GOUDEUID_1502_raw.Convert(results).FirstOrDefault(); return(returnStatus); }
protected static FR_L6DT_GDTIfDT_1505 Execute(DbConnection Connection, DbTransaction Transaction, P_L6DT_GDTIfDT_1505 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L6DT_GDTIfDT_1505(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL6_DanuTask_DeveloperTask.Atomic.Retrieval.SQL.cls_Get_DeveloperTaskInfo_for_DeveloperTaskID.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, "TaskID", Parameter.TaskID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsBeingPrepared_Only", Parameter.IsBeingPrepared_Only); List <L6DT_GDTIfDT_1505> results = new List <L6DT_GDTIfDT_1505>(); 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[] { "Task_ID", "Task_Identification", "Task_Name", "Task_Deadline", "Task_PercentageComplete", "Task_CompletionStamp", "Task_CreationStamp", "Task_CurrentInvestment", "Task_RequiredEstimation", "Label_DictID", "CreatedByFirstName", "CreatedByLastName", "Task_Description", "Task_Involvement", "IsActive", "DeveloperInvested", "Developer_CompletionEstimation", "Assignment_Timestamp", "IsIncompleteInformation", "IsComplete" }); while (reader.Read()) { L6DT_GDTIfDT_1505 resultItem = new L6DT_GDTIfDT_1505(); //0:Parameter Task_ID of type Guid resultItem.Task_ID = reader.GetGuid(0); //1:Parameter Task_Identification of type String resultItem.Task_Identification = reader.GetString(1); //2:Parameter Task_Name of type String resultItem.Task_Name = reader.GetString(2); //3:Parameter Task_Deadline of type DateTime resultItem.Task_Deadline = reader.GetDate(3); //4:Parameter Task_PercentageComplete of type Double resultItem.Task_PercentageComplete = reader.GetDouble(4); //5:Parameter Task_CompletionStamp of type DateTime resultItem.Task_CompletionStamp = reader.GetDate(5); //6:Parameter Task_CreationStamp of type DateTime resultItem.Task_CreationStamp = reader.GetDate(6); //7:Parameter Task_CurrentInvestment of type long resultItem.Task_CurrentInvestment = reader.GetLong(7); //8:Parameter Task_RequiredEstimation of type long resultItem.Task_RequiredEstimation = reader.GetLong(8); //9:Parameter Priority_Label of type Dict resultItem.Priority_Label = reader.GetDictionary(9); resultItem.Priority_Label.SourceTable = "tms_pro_developertask_priorities"; loader.Append(resultItem.Priority_Label); //10:Parameter CreatedByFirstName of type String resultItem.CreatedByFirstName = reader.GetString(10); //11:Parameter CreatedByLastName of type String resultItem.CreatedByLastName = reader.GetString(11); //12:Parameter Task_Description of type String resultItem.Task_Description = reader.GetString(12); //13:Parameter Task_Involvement of type Guid resultItem.Task_Involvement = reader.GetGuid(13); //14:Parameter IsActive of type bool resultItem.IsActive = reader.GetBoolean(14); //15:Parameter DeveloperInvested of type long resultItem.DeveloperInvested = reader.GetLong(15); //16:Parameter Developer_CompletionEstimation of type long resultItem.Developer_CompletionEstimation = reader.GetLong(16); //17:Parameter Assignment_Timestamp of type DateTime resultItem.Assignment_Timestamp = reader.GetDate(17); //18:Parameter IsIncompleteInformation of type bool resultItem.IsIncompleteInformation = reader.GetBoolean(18); //19:Parameter IsComplete of type bool resultItem.IsComplete = reader.GetBoolean(19); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_DeveloperTaskInfo_for_DeveloperTaskID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.FirstOrDefault(); return(returnStatus); }
protected static FR_L5WA_GWAFSN_1319 Execute(DbConnection Connection, DbTransaction Transaction, P_L5WA_GWAFSN_1319 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5WA_GWAFSN_1319(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_VacationPlanner_WorkArea.Atomic.Retrieval.SQL.cls_Get_WorkArea_for_Shortname.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, "ShortName", Parameter.ShortName); List <L5WA_GWAFSN_1319> results = new List <L5WA_GWAFSN_1319>(); 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[] { "CMN_STR_PPS_WorkAreaID", "Parent_RefID", "Office_RefID", "WorkAreaName_DictID", "WorkAreaDescription_DictID", "Default_StartWorkingHour", "ShortName", "CMN_STR_PPS_WorkArea_TypeID", "WorkAreaTypeName_DictID", "WorkAreaTypeDescription_DictID", "CMN_BPT_STA_SettingProfile_RefID", "CMN_CAL_CalendarInstance_RefID" }); while (reader.Read()) { L5WA_GWAFSN_1319 resultItem = new L5WA_GWAFSN_1319(); //0:Parameter CMN_STR_PPS_WorkAreaID of type Guid resultItem.CMN_STR_PPS_WorkAreaID = reader.GetGuid(0); //1:Parameter Parent_RefID of type Guid resultItem.Parent_RefID = reader.GetGuid(1); //2:Parameter Office_RefID of type Guid resultItem.Office_RefID = reader.GetGuid(2); //3:Parameter WorkAreaName of type Dict resultItem.WorkAreaName = reader.GetDictionary(3); resultItem.WorkAreaName.SourceTable = "cmn_str_pps_workareas"; loader.Append(resultItem.WorkAreaName); //4:Parameter WorkAreaDescription of type Dict resultItem.WorkAreaDescription = reader.GetDictionary(4); resultItem.WorkAreaDescription.SourceTable = "cmn_str_pps_workareas"; loader.Append(resultItem.WorkAreaDescription); //5:Parameter Default_StartWorkingHour of type String resultItem.Default_StartWorkingHour = reader.GetString(5); //6:Parameter ShortName of type String resultItem.ShortName = reader.GetString(6); //7:Parameter CMN_STR_PPS_WorkArea_TypeID of type Guid resultItem.CMN_STR_PPS_WorkArea_TypeID = reader.GetGuid(7); //8:Parameter WorkAreaTypeName of type Dict resultItem.WorkAreaTypeName = reader.GetDictionary(8); resultItem.WorkAreaTypeName.SourceTable = "cmn_str_pps_workarea_types"; loader.Append(resultItem.WorkAreaTypeName); //9:Parameter WorkAreaTypeDescription of type Dict resultItem.WorkAreaTypeDescription = reader.GetDictionary(9); resultItem.WorkAreaTypeDescription.SourceTable = "cmn_str_pps_workarea_types"; loader.Append(resultItem.WorkAreaTypeDescription); //10:Parameter CMN_BPT_STA_SettingProfile_RefID of type Guid resultItem.CMN_BPT_STA_SettingProfile_RefID = reader.GetGuid(10); //11:Parameter CMN_CAL_CalendarInstance_RefID of type Guid resultItem.CMN_CAL_CalendarInstance_RefID = reader.GetGuid(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.FirstOrDefault(); return(returnStatus); }
protected static FR_L5OS_r_questions_qrlabel_1217_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5OS_r_questions_qrlabel_1217 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5OS_r_questions_qrlabel_1217_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_OphthalSurveys.Atomic.Retrieval.SQL.cls_Retrive_Questions_For_Code_Labels.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, "barcodeLabel", Parameter.barcodeLabel); List <L5OS_r_questions_qrlabel_1217> results = new List <L5OS_r_questions_qrlabel_1217>(); 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[] { "IsActive", "QuestionItem_Label_DictID", "QuestionItem_SequenceNumber", "CMN_QST_Questionnaire_Template_VersionID", "CMN_QST_Questionnaire_ItemID", "CMN_QST_QuestionItem_EnumerationAnswerTypeID", "HEC_ShippingPosition_BarcodeLabelID", "LOG_SHP_Shipment_PositionID", "CMN_PRO_Product_RefID", "CMN_PRO_ProductVariant_RefID", "LOG_SHP_Shipment_Position_RefID", "Bound_QuestionnaireTemplateVersion_RefID", "CMN_PRO_ProductID", "Product_Name_DictID", "CMN_PRO_Product_Questionnaire_AssignmentID", "CMN_PRO_Product_RefID1", "CMN_QST_Questionnaire_Template_Version_RefID", "QuestionnaireTemplate_RefID", "CopiedFrom_TemplateVersion_RefID", "CMN_QST_QuestionItem_EnumerationAnswerID", "EnumerationAnswer_Text_DictID", "ShippingPosition_BarcodeLabel" }); while (reader.Read()) { L5OS_r_questions_qrlabel_1217 resultItem = new L5OS_r_questions_qrlabel_1217(); //0:Parameter IsActive of type bool resultItem.IsActive = reader.GetBoolean(0); //1:Parameter QuestionItem_Label of type Dict resultItem.QuestionItem_Label = reader.GetDictionary(1); resultItem.QuestionItem_Label.SourceTable = "cmn_qst_questionnaire_questionitems"; loader.Append(resultItem.QuestionItem_Label); //2:Parameter QuestionItem_SequenceNumber of type String resultItem.QuestionItem_SequenceNumber = reader.GetString(2); //3:Parameter CMN_QST_Questionnaire_Template_VersionID of type Guid resultItem.CMN_QST_Questionnaire_Template_VersionID = reader.GetGuid(3); //4:Parameter CMN_QST_Questionnaire_ItemID of type Guid resultItem.CMN_QST_Questionnaire_ItemID = reader.GetGuid(4); //5:Parameter CMN_QST_QuestionItem_EnumerationAnswerTypeID of type Guid resultItem.CMN_QST_QuestionItem_EnumerationAnswerTypeID = reader.GetGuid(5); //6:Parameter HEC_ShippingPosition_BarcodeLabelID of type Guid resultItem.HEC_ShippingPosition_BarcodeLabelID = reader.GetGuid(6); //7:Parameter LOG_SHP_Shipment_PositionID of type Guid resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(7); //8:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(8); //9:Parameter CMN_PRO_ProductVariant_RefID of type Guid resultItem.CMN_PRO_ProductVariant_RefID = reader.GetGuid(9); //10:Parameter LOG_SHP_Shipment_Position_RefID of type Guid resultItem.LOG_SHP_Shipment_Position_RefID = reader.GetGuid(10); //11:Parameter Bound_QuestionnaireTemplateVersion_RefID of type Guid resultItem.Bound_QuestionnaireTemplateVersion_RefID = reader.GetGuid(11); //12:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(12); //13:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(13); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //14:Parameter CMN_PRO_Product_Questionnaire_AssignmentID of type Guid resultItem.CMN_PRO_Product_Questionnaire_AssignmentID = reader.GetGuid(14); //15:Parameter CMN_PRO_Product_RefID1 of type String resultItem.CMN_PRO_Product_RefID1 = reader.GetString(15); //16:Parameter CMN_QST_Questionnaire_Template_Version_RefID of type Guid resultItem.CMN_QST_Questionnaire_Template_Version_RefID = reader.GetGuid(16); //17:Parameter QuestionnaireTemplate_RefID of type Guid resultItem.QuestionnaireTemplate_RefID = reader.GetGuid(17); //18:Parameter CopiedFrom_TemplateVersion_RefID of type Guid resultItem.CopiedFrom_TemplateVersion_RefID = reader.GetGuid(18); //19:Parameter CMN_QST_QuestionItem_EnumerationAnswerID of type Guid resultItem.CMN_QST_QuestionItem_EnumerationAnswerID = reader.GetGuid(19); //20:Parameter EnumerationAnswer_Text of type Dict resultItem.EnumerationAnswer_Text = reader.GetDictionary(20); resultItem.EnumerationAnswer_Text.SourceTable = "cmn_qst_questionitem_enumerationanswers"; loader.Append(resultItem.EnumerationAnswer_Text); //21:Parameter ShippingPosition_BarcodeLabel of type String resultItem.ShippingPosition_BarcodeLabel = reader.GetString(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Retrive_Questions_For_Code_Labels", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L5ME_GDBDfT_1644_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5ME_GDBDfT_1644_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_EMR.Atomic.Retrieval.SQL.cls_Get_DoctorsBaseData_for_TenantID.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; List <L5ME_GDBDfT_1644_raw> results = new List <L5ME_GDBDfT_1644_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[] { "HEC_DoctorID", "FirstName", "LastName", "Title", "DoctorIDNumber", "CMN_BPT_BusinessParticipantID", "CMN_PER_PersonInfoID", "BusinessParticipantITL", "CMN_AddressID", "Street_Name", "Street_Number", "City_Name", "CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID", "CMN_BPT_BusinessParticipantID1", "PracticeName" }); while (reader.Read()) { L5ME_GDBDfT_1644_raw resultItem = new L5ME_GDBDfT_1644_raw(); //0:Parameter HEC_DoctorID of type Guid resultItem.HEC_DoctorID = reader.GetGuid(0); //1:Parameter FirstName of type String resultItem.FirstName = reader.GetString(1); //2:Parameter LastName of type String resultItem.LastName = reader.GetString(2); //3:Parameter Title of type String resultItem.Title = reader.GetString(3); //4:Parameter DoctorIDNumber of type String resultItem.DoctorIDNumber = reader.GetString(4); //5:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(5); //6:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(6); //7:Parameter BusinessParticipantITL of type String resultItem.BusinessParticipantITL = reader.GetString(7); //8:Parameter CMN_AddressID of type Guid resultItem.CMN_AddressID = reader.GetGuid(8); //9:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(9); //10:Parameter Street_Number of type String resultItem.Street_Number = reader.GetString(10); //11:Parameter City_Name of type String resultItem.City_Name = reader.GetString(11); //12:Parameter CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID = reader.GetGuid(12); //13:Parameter CMN_BPT_BusinessParticipantID1 of type Guid resultItem.CMN_BPT_BusinessParticipantID1 = reader.GetGuid(13); //14:Parameter PracticeName of type String resultItem.PracticeName = reader.GetString(14); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_DoctorsBaseData_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5ME_GDBDfT_1644_raw.Convert(results).ToArray(); return(returnStatus); }
protected static FR_L5BTS_GBSfPID_1141_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5BTS_GBSfPID_1141 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5BTS_GBSfPID_1141_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_BookableTimeSlot.Atomic.Retrieval.SQL.cls_Get_BookableSlots_for_PracticeID.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, "OfficeID", Parameter.OfficeID); List <L5BTS_GBSfPID_1141_raw> results = new List <L5BTS_GBSfPID_1141_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[] { "PPS_TSK_BOK_BookableTimeSlotID", "FreeSlotsForTaskTemplateITPL", "TaskTemplate_RefID", "FreeInterval_End", "FreeInterval_Start", "AssignmentID", "GlobalPropertyMatchingID", "PPS_TSK_BOK_AvailableResourceCombinationID", "PPS_TSK_BOK_DeviceResourceID", "PPS_DEV_Device_Instance_RefID", "PPS_TSK_BOK_StaffResourceID", "CMN_BPT_EMP_Employee_RefID", "CreatedFor_TaskTemplateRequiredStaff_RefID" }); while (reader.Read()) { L5BTS_GBSfPID_1141_raw resultItem = new L5BTS_GBSfPID_1141_raw(); //0:Parameter PPS_TSK_BOK_BookableTimeSlotID of type Guid resultItem.PPS_TSK_BOK_BookableTimeSlotID = reader.GetGuid(0); //1:Parameter FreeSlotsForTaskTemplateITPL of type string resultItem.FreeSlotsForTaskTemplateITPL = reader.GetString(1); //2:Parameter TaskTemplate_RefID of type Guid resultItem.TaskTemplate_RefID = reader.GetGuid(2); //3:Parameter FreeInterval_End of type DateTime resultItem.FreeInterval_End = reader.GetDate(3); //4:Parameter FreeInterval_Start of type DateTime resultItem.FreeInterval_Start = reader.GetDate(4); //5:Parameter AssignmentID of type Guid resultItem.AssignmentID = reader.GetGuid(5); //6:Parameter GlobalPropertyMatchingID of type string resultItem.GlobalPropertyMatchingID = reader.GetString(6); //7:Parameter PPS_TSK_BOK_AvailableResourceCombinationID of type Guid resultItem.PPS_TSK_BOK_AvailableResourceCombinationID = reader.GetGuid(7); //8:Parameter PPS_TSK_BOK_DeviceResourceID of type Guid resultItem.PPS_TSK_BOK_DeviceResourceID = reader.GetGuid(8); //9:Parameter PPS_DEV_Device_Instance_RefID of type Guid resultItem.PPS_DEV_Device_Instance_RefID = reader.GetGuid(9); //10:Parameter PPS_TSK_BOK_StaffResourceID of type Guid resultItem.PPS_TSK_BOK_StaffResourceID = reader.GetGuid(10); //11:Parameter CMN_BPT_EMP_Employee_RefID of type Guid resultItem.CMN_BPT_EMP_Employee_RefID = reader.GetGuid(11); //12:Parameter CreatedFor_TaskTemplateRequiredStaff_RefID of type Guid resultItem.CreatedFor_TaskTemplateRequiredStaff_RefID = reader.GetGuid(12); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_BookableSlots_for_PracticeID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5BTS_GBSfPID_1141_raw.Convert(results).ToArray(); return(returnStatus); }
protected static FR_L5DG_GADfP_0950_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DG_GADfP_0950 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DG_GADfP_0950_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_Diagnosis.Atomic.Retrieval.SQL.cls_Get_AllDiagnosis_for_PatientID.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, "PatientID", Parameter.PatientID); List <L5DG_GADfP_0950> results = new List <L5DG_GADfP_0950>(); 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[] { "HEC_Patient_DiagnosisID", "HEC_DIA_PotentialDiagnosisID", "ICD10_Code", "PotentialDiagnosis_Name_DictID", "HEC_DIA_Diagnosis_StateID", "DiagnosisState_Abbreviation", "DiagnosisState_Name_DictID", "HEC_DIA_Diagnosis_LocalizationID", "DiagnosisLocalization_Name_DictID", "CreationDate", "DiagnosedOnDate", "DoctorFirstName", "DoctorLastName", "HEC_DoctorID" }); while (reader.Read()) { L5DG_GADfP_0950 resultItem = new L5DG_GADfP_0950(); //0:Parameter HEC_Patient_DiagnosisID of type Guid resultItem.HEC_Patient_DiagnosisID = reader.GetGuid(0); //1:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(1); //2:Parameter ICD10_Code of type String resultItem.ICD10_Code = reader.GetString(2); //3:Parameter PotentialDiagnosis_Name_DictID of type Dict resultItem.PotentialDiagnosis_Name_DictID = reader.GetDictionary(3); resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name_DictID); //4:Parameter HEC_DIA_Diagnosis_StateID of type Guid resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(4); //5:Parameter DiagnosisState_Abbreviation of type String resultItem.DiagnosisState_Abbreviation = reader.GetString(5); //6:Parameter DiagnosisState_Name of type Dict resultItem.DiagnosisState_Name = reader.GetDictionary(6); resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states"; loader.Append(resultItem.DiagnosisState_Name); //7:Parameter HEC_DIA_Diagnosis_LocalizationID of type Guid resultItem.HEC_DIA_Diagnosis_LocalizationID = reader.GetGuid(7); //8:Parameter DiagnosisLocalization_Name of type Dict resultItem.DiagnosisLocalization_Name = reader.GetDictionary(8); resultItem.DiagnosisLocalization_Name.SourceTable = "hec_dia_diagnosis_localizations"; loader.Append(resultItem.DiagnosisLocalization_Name); //9:Parameter CreationDate of type DateTime resultItem.CreationDate = reader.GetDate(9); //10:Parameter DiagnosedOnDate of type DateTime resultItem.DiagnosedOnDate = reader.GetDate(10); //11:Parameter DoctorFirstName of type String resultItem.DoctorFirstName = reader.GetString(11); //12:Parameter DoctorLastName of type String resultItem.DoctorLastName = reader.GetString(12); //13:Parameter HEC_DoctorID of type Guid resultItem.HEC_DoctorID = reader.GetGuid(13); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString) { //Standard return type FR_Base retStatus = new FR_Base(); bool cleanupConnection = false; bool cleanupTransaction = false; try { #region Verify/Create Connections //Create connection if Connection is null if (Connection == null) { cleanupConnection = true; Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } //If transaction is not open/not valid if (Transaction == null) { cleanupTransaction = true; Transaction = Connection.BeginTransaction(); } #endregion //Get the SelectQuerry string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_ORD_CUO.ORD_CUO_CustomerOrder_Note.SQL.Select.sql")).ReadToEnd(); DbCommand command = Connection.CreateCommand(); //Set Connection/Transaction command.Connection = Connection; command.Transaction = Transaction; //Set Query/Timeout command.CommandText = SelectQuery; command.CommandTimeout = QueryTimeout; //Firstly, before loading, set the GUID to empty //So the entity does not exist, it will have a GUID set to empty _ORD_CUO_CustomerOrder_NoteID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ORD_CUO_CustomerOrder_NoteID", ObjectID); #region Command Execution try { var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "ORD_CUO_CustomerOrder_NoteID", "CustomerOrder_Header_RefID", "CustomerOrder_Position_RefID", "CMN_BPT_CTM_OrganizationalUnit_RefID", "CreatedBy_BusinessParticipant_RefID", "Title", "Comment", "NotePublishDate", "SequenceOrderNumber", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter ORD_CUO_CustomerOrder_NoteID of type Guid _ORD_CUO_CustomerOrder_NoteID = reader.GetGuid(0); //1:Parameter CustomerOrder_Header_RefID of type Guid _CustomerOrder_Header_RefID = reader.GetGuid(1); //2:Parameter CustomerOrder_Position_RefID of type Guid _CustomerOrder_Position_RefID = reader.GetGuid(2); //3:Parameter CMN_BPT_CTM_OrganizationalUnit_RefID of type Guid _CMN_BPT_CTM_OrganizationalUnit_RefID = reader.GetGuid(3); //4:Parameter CreatedBy_BusinessParticipant_RefID of type Guid _CreatedBy_BusinessParticipant_RefID = reader.GetGuid(4); //5:Parameter Title of type String _Title = reader.GetString(5); //6:Parameter Comment of type String _Comment = reader.GetString(6); //7:Parameter NotePublishDate of type DateTime _NotePublishDate = reader.GetDate(7); //8:Parameter SequenceOrderNumber of type int _SequenceOrderNumber = reader.GetInteger(8); //9:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(9); //10:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(10); //11:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(11); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_ORD_CUO_CustomerOrder_NoteID != Guid.Empty) { //Successfully loaded Status_IsAlreadySaved = true; Status_IsDirty = false; } else { //Fault in loading due to invalid UUID (Guid) Status_IsAlreadySaved = false; Status_IsDirty = false; } } catch (Exception ex) { throw; } #endregion #region Cleanup Transaction/Connection //If we started the transaction, we will commit it if (cleanupTransaction && Transaction != null) { Transaction.Commit(); } //If we opened the connection we will close it if (cleanupConnection && Connection != null) { 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; } return(retStatus); }
protected static FR_L5BH_GBHfTID_1415_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5BH_GBHfTID_1415 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5BH_GBHfTID_1415_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_BillingHistory.Atomic.Retrieval.SQL.cls_Get_BillingHistory_for_TenantID.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, "OrderBy", Parameter.OrderBy); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "OrderValue", Parameter.OrderValue); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "StartIndex", Parameter.StartIndex); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "NumberOfElements", Parameter.NumberOfElements); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "NotInParameters", Parameter.NotInParameters); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "InParameters", Parameter.InParameters); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "SearchCriterium", Parameter.SearchCriterium); /***For Order**/ string newText = command.CommandText.Replace("@OrderValue", Parameter.OrderValue); command.CommandText = newText; /***For Search**/ string newText2 = command.CommandText.Replace("@SearchCriterium", Parameter.SearchCriterium); command.CommandText = newText2; /***For NotInParameters**/ string toReplace = ""; if (Parameter.NotInParameters != "") { toReplace = "NOT IN (" + Parameter.NotInParameters + ")"; } string newText3 = command.CommandText.Replace("@NotInParameters", toReplace); command.CommandText = newText3; /***For InParameters**/ string toReplace2 = ""; if (Parameter.InParameters != "") { toReplace2 = "IN (" + Parameter.InParameters + ")"; } string newText4 = command.CommandText.Replace("@InParameters", toReplace2); command.CommandText = newText4; List <L5BH_GBHfTID_1415> results = new List <L5BH_GBHfTID_1415>(); 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[] { "BillID", "PositionNumber", "TreatmentDate", "HealthInsurance_Number", "InsuranceStateCode", "FirstName", "LastName", "BSNR", "LANR", "GPOS", "Creation_Timestamp", "PositionValue_IncludingTax", "BIL_BillHeaderID", "BIL_BillPositionID", "TreatmentID", "PatientID", "BirthDate", "TCode", "AOKComment" }); while (reader.Read()) { L5BH_GBHfTID_1415 resultItem = new L5BH_GBHfTID_1415(); //0:Parameter BillID of type int resultItem.BillID = reader.GetInteger(0); //1:Parameter PositionNumber of type int resultItem.PositionNumber = reader.GetInteger(1); //2:Parameter TreatmentDate of type DateTime resultItem.TreatmentDate = reader.GetDate(2); //3:Parameter HealthInsurance_Number of type String resultItem.HealthInsurance_Number = reader.GetString(3); //4:Parameter InsuranceStateCode of type String resultItem.InsuranceStateCode = reader.GetString(4); //5:Parameter FirstName of type String resultItem.FirstName = reader.GetString(5); //6:Parameter LastName of type String resultItem.LastName = reader.GetString(6); //7:Parameter BSNR of type String resultItem.BSNR = reader.GetString(7); //8:Parameter LANR of type String resultItem.LANR = reader.GetString(8); //9:Parameter GPOS of type String resultItem.GPOS = reader.GetString(9); //10:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(10); //11:Parameter PositionValue_IncludingTax of type String resultItem.PositionValue_IncludingTax = reader.GetString(11); //12:Parameter BIL_BillHeaderID of type Guid resultItem.BIL_BillHeaderID = reader.GetGuid(12); //13:Parameter BIL_BillPositionID of type Guid resultItem.BIL_BillPositionID = reader.GetGuid(13); //14:Parameter TreatmentID of type Guid resultItem.TreatmentID = reader.GetGuid(14); //15:Parameter PatientID of type Guid resultItem.PatientID = reader.GetGuid(15); //16:Parameter BirthDate of type DateTime resultItem.BirthDate = reader.GetDate(16); //17:Parameter TCode of type int resultItem.TCode = reader.GetInteger(17); //18:Parameter AOKComment of type String resultItem.AOKComment = reader.GetString(18); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_BillingHistory_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString) { //Standard return type FR_Base retStatus = new FR_Base(); bool cleanupConnection = false; bool cleanupTransaction = false; try { #region Verify/Create Connections //Create connection if Connection is null if (Connection == null) { cleanupConnection = true; Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } //If transaction is not open/not valid if (Transaction == null) { cleanupTransaction = true; Transaction = Connection.BeginTransaction(); } #endregion //Get the SelectQuerry string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_CMN_STR_PPS.CMN_STR_PPS_Workplace.SQL.Select.sql")).ReadToEnd(); DbCommand command = Connection.CreateCommand(); //Set Connection/Transaction command.Connection = Connection; command.Transaction = Transaction; //Set Query/Timeout command.CommandText = SelectQuery; command.CommandTimeout = QueryTimeout; //Firstly, before loading, set the GUID to empty //So the entity does not exist, it will have a GUID set to empty _CMN_STR_PPS_WorkplaceID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_STR_PPS_WorkplaceID", ObjectID); #region Command Execution try { var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_STR_PPS_WorkplaceID", "WorkArea_RefID", "Name_DictID", "Description_DictID", "CMN_CAL_CalendarInstance_RefID", "ShortName", "IsMockObject", "DisplayColor", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter CMN_STR_PPS_WorkplaceID of type Guid _CMN_STR_PPS_WorkplaceID = reader.GetGuid(0); //1:Parameter WorkArea_RefID of type Guid _WorkArea_RefID = reader.GetGuid(1); //2:Parameter Name of type Dict _Name = reader.GetDictionary(2); loader.Append(_Name, TableName); //3:Parameter Description of type Dict _Description = reader.GetDictionary(3); loader.Append(_Description, TableName); //4:Parameter CMN_CAL_CalendarInstance_RefID of type Guid _CMN_CAL_CalendarInstance_RefID = reader.GetGuid(4); //5:Parameter ShortName of type String _ShortName = reader.GetString(5); //6:Parameter IsMockObject of type Boolean _IsMockObject = reader.GetBoolean(6); //7:Parameter DisplayColor of type String _DisplayColor = reader.GetString(7); //8:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(8); //9:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(9); //10:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(10); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_CMN_STR_PPS_WorkplaceID != Guid.Empty) { //Successfully loaded Status_IsAlreadySaved = true; Status_IsDirty = false; } else { //Fault in loading due to invalid UUID (Guid) Status_IsAlreadySaved = false; Status_IsDirty = false; } } catch (Exception ex) { throw ex; } #endregion #region Cleanup Transaction/Connection //If we started the transaction, we will commit it if (cleanupTransaction && Transaction != null) { Transaction.Commit(); } //If we opened the connection we will close it if (cleanupConnection && Connection != null) { 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 ex; } return(retStatus); }
protected static FR_L2AI_GAPIfAI_1627 Execute(DbConnection Connection, DbTransaction Transaction, P_L2AI_GAPIfAI_1627 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L2AI_GAPIfAI_1627(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL2_AccountInformation.Atomic.Retrieval.SQL.cls_Get_Account_PersonalInformation_for_AccountID.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, "AccountRefID", Parameter.AccountRefID); List <L2AI_GAPIfAI_1627> results = new List <L2AI_GAPIfAI_1627>(); 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[] { "USR_AccountID", "Username", "AccountSignInEmailAddress", "FirstName", "LastName", "CMN_LanguageID", "ISO_639_2", "File_SourceLocation", "File_ServerLocation", "AccountType", "Salutation_General", "Salutation_Letter", "PrimaryEmail", "Title", "BirthDate", "Gender" }); while (reader.Read()) { L2AI_GAPIfAI_1627 resultItem = new L2AI_GAPIfAI_1627(); //0:Parameter USR_AccountID of type Guid resultItem.USR_AccountID = reader.GetGuid(0); //1:Parameter Username of type String resultItem.Username = reader.GetString(1); //2:Parameter AccountSignInEmailAddress of type String resultItem.AccountSignInEmailAddress = reader.GetString(2); //3:Parameter FirstName of type String resultItem.FirstName = reader.GetString(3); //4:Parameter LastName of type String resultItem.LastName = reader.GetString(4); //5:Parameter CMN_LanguageID of type Guid resultItem.CMN_LanguageID = reader.GetGuid(5); //6:Parameter ISO_639_2 of type String resultItem.ISO_639_2 = reader.GetString(6); //7:Parameter File_SourceLocation of type String resultItem.File_SourceLocation = reader.GetString(7); //8:Parameter File_ServerLocation of type String resultItem.File_ServerLocation = reader.GetString(8); //9:Parameter AccountType of type int resultItem.AccountType = reader.GetInteger(9); //10:Parameter Salutation_General of type String resultItem.Salutation_General = reader.GetString(10); //11:Parameter Salutation_Letter of type String resultItem.Salutation_Letter = reader.GetString(11); //12:Parameter PrimaryEmail of type String resultItem.PrimaryEmail = reader.GetString(12); //13:Parameter Title of type String resultItem.Title = reader.GetString(13); //14:Parameter BirthDate of type DateTime resultItem.BirthDate = reader.GetDate(14); //15:Parameter Gender of type int resultItem.Gender = reader.GetInteger(15); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Account_PersonalInformation_for_AccountID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.FirstOrDefault(); return(returnStatus); }
protected static FR_L3CA_GCPERPfR_1151 Execute(DbConnection Connection, DbTransaction Transaction, P_L3CA_GCPERPfR_1151 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3CA_GCPERPfR_1151(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_Catalog.Atomic.Retrieval.SQL.cls_Get_CatalogProductExtensionRequest_Products_for_RequestID.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, "RequestID", Parameter.RequestID); List <L3CA_GCPERPfR_1151_raw> results = new List <L3CA_GCPERPfR_1151_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[] { "Request_Answer", "IsAnswerSent", "IfAnswerSent_Date", "CMN_BPT_CTM_CatalogProductExtensionRequest_ProductID", "CMN_PRO_Product_RefID", "Comment", "Product_Name_DictID", "Product_Description_DictID", "Product_Number", "PriceAmount", "ProductITL" }); while (reader.Read()) { L3CA_GCPERPfR_1151_raw resultItem = new L3CA_GCPERPfR_1151_raw(); //0:Parameter Request_Answer of type String resultItem.Request_Answer = reader.GetString(0); //1:Parameter IsAnswerSent of type bool resultItem.IsAnswerSent = reader.GetBoolean(1); //2:Parameter IfAnswerSent_Date of type DateTime resultItem.IfAnswerSent_Date = reader.GetDate(2); //3:Parameter CMN_BPT_CTM_CatalogProductExtensionRequest_ProductID of type Guid resultItem.CMN_BPT_CTM_CatalogProductExtensionRequest_ProductID = reader.GetGuid(3); //4:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(4); //5:Parameter Comment of type String resultItem.Comment = reader.GetString(5); //6:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(6); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //7:Parameter Product_Description of type Dict resultItem.Product_Description = reader.GetDictionary(7); resultItem.Product_Description.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Description); //8:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(8); //9:Parameter PriceAmount of type Double resultItem.PriceAmount = reader.GetDouble(9); //10:Parameter ProductITL of type String resultItem.ProductITL = reader.GetString(10); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_CatalogProductExtensionRequest_Products_for_RequestID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L3CA_GCPERPfR_1151_raw.Convert(results).FirstOrDefault(); return(returnStatus); }
protected static FR_L5DO_GDOHDfOT_1654 Execute(DbConnection Connection, DbTransaction Transaction, P_L5DO_GDOHDfOT_1654 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DO_GDOHDfOT_1654(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_DistributionOrder.Atomic.Retrieval.SQL.cls_Get_DistributionOrder_Header_Details_for_OrderTracking.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, "DistributionOrderHeaderID", Parameter.DistributionOrderHeaderID); List <L5DO_GDOHDfOT_1654_raw> results = new List <L5DO_GDOHDfOT_1654_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[] { "ORD_DIS_DistributionOrder_HeaderID", "DistributionOrderDate", "DistributionOrderNumber", "IsCanceled", "IsPartiallyFullfilled", "IsFullyFullfilled", "CostCenterName_DictID", "OfficeName_DictID", "EmployeeName", "WarehouseName", "CreatedBy_BusinessParticipantID", "CreatedBy_BusinessParticipantDisplayName", "ORD_DIS_DistributionOrder_PositionID", "Quantity", "Position_OrdinalNumber", "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Number", "CMN_PRO_Product_VariantID", "IsStandardProductVariant", "VariantName_DictID" }); while (reader.Read()) { L5DO_GDOHDfOT_1654_raw resultItem = new L5DO_GDOHDfOT_1654_raw(); //0:Parameter ORD_DIS_DistributionOrder_HeaderID of type Guid resultItem.ORD_DIS_DistributionOrder_HeaderID = reader.GetGuid(0); //1:Parameter DistributionOrderDate of type DateTime resultItem.DistributionOrderDate = reader.GetDate(1); //2:Parameter DistributionOrderNumber of type string resultItem.DistributionOrderNumber = reader.GetString(2); //3:Parameter IsCanceled of type bool resultItem.IsCanceled = reader.GetBoolean(3); //4:Parameter IsPartiallyFullfilled of type bool resultItem.IsPartiallyFullfilled = reader.GetBoolean(4); //5:Parameter IsFullyFullfilled of type bool resultItem.IsFullyFullfilled = reader.GetBoolean(5); //6:Parameter CostCenterName of type Dict resultItem.CostCenterName = reader.GetDictionary(6); resultItem.CostCenterName.SourceTable = "cmn_str_costcenters"; loader.Append(resultItem.CostCenterName); //7:Parameter OfficeName of type Dict resultItem.OfficeName = reader.GetDictionary(7); resultItem.OfficeName.SourceTable = "cmn_str_offices"; loader.Append(resultItem.OfficeName); //8:Parameter EmployeeName of type string resultItem.EmployeeName = reader.GetString(8); //9:Parameter WarehouseName of type string resultItem.WarehouseName = reader.GetString(9); //10:Parameter CreatedBy_BusinessParticipantID of type Guid resultItem.CreatedBy_BusinessParticipantID = reader.GetGuid(10); //11:Parameter CreatedBy_BusinessParticipantDisplayName of type string resultItem.CreatedBy_BusinessParticipantDisplayName = reader.GetString(11); //12:Parameter ORD_DIS_DistributionOrder_PositionID of type Guid resultItem.ORD_DIS_DistributionOrder_PositionID = reader.GetGuid(12); //13:Parameter Quantity of type double resultItem.Quantity = reader.GetDouble(13); //14:Parameter Position_OrdinalNumber of type int resultItem.Position_OrdinalNumber = reader.GetInteger(14); //15:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(15); //16:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(16); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //17:Parameter Product_Number of type string resultItem.Product_Number = reader.GetString(17); //18:Parameter CMN_PRO_Product_VariantID of type Guid resultItem.CMN_PRO_Product_VariantID = reader.GetGuid(18); //19:Parameter IsStandardProductVariant of type bool resultItem.IsStandardProductVariant = reader.GetBoolean(19); //20:Parameter VariantName of type Dict resultItem.VariantName = reader.GetDictionary(20); resultItem.VariantName.SourceTable = "cmn_pro_product_variants"; loader.Append(resultItem.VariantName); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_DistributionOrder_Header_Details_for_OrderTracking", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5DO_GDOHDfOT_1654_raw.Convert(results).FirstOrDefault(); return(returnStatus); }
private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString) { //Standard return type FR_Base retStatus = new FR_Base(); bool cleanupConnection = false; bool cleanupTransaction = false; try { #region Verify/Create Connections //Create connection if Connection is null if (Connection == null) { cleanupConnection = true; Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } //If transaction is not open/not valid if (Transaction == null) { cleanupTransaction = true; Transaction = Connection.BeginTransaction(); } #endregion //Get the SelectQuerry string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC.HEC_Patient_ParameterType_AvailableUnit.SQL.Select.sql")).ReadToEnd(); DbCommand command = Connection.CreateCommand(); //Set Connection/Transaction command.Connection = Connection; command.Transaction = Transaction; //Set Query/Timeout command.CommandText = SelectQuery; command.CommandTimeout = QueryTimeout; //Firstly, before loading, set the GUID to empty //So the entity does not exist, it will have a GUID set to empty _HEC_Patient_ParameterType_AvailableUnitID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_Patient_ParameterType_AvailableUnitID", ObjectID); #region Command Execution try { var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "HEC_Patient_ParameterType_AvailableUnitID", "Patient_ParameterType_RefID", "Unit_RefID", "IsDefaultUnit", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter HEC_Patient_ParameterType_AvailableUnitID of type Guid _HEC_Patient_ParameterType_AvailableUnitID = reader.GetGuid(0); //1:Parameter Patient_ParameterType_RefID of type Guid _Patient_ParameterType_RefID = reader.GetGuid(1); //2:Parameter Unit_RefID of type Guid _Unit_RefID = reader.GetGuid(2); //3:Parameter IsDefaultUnit of type Boolean _IsDefaultUnit = reader.GetBoolean(3); //4:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(4); //5:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(5); //6:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(6); //7:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(7); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_HEC_Patient_ParameterType_AvailableUnitID != Guid.Empty) { //Successfully loaded Status_IsAlreadySaved = true; Status_IsDirty = false; } else { //Fault in loading due to invalid UUID (Guid) Status_IsAlreadySaved = false; Status_IsDirty = false; } } catch (Exception ex) { throw; } #endregion #region Cleanup Transaction/Connection //If we started the transaction, we will commit it if (cleanupTransaction && Transaction != null) { Transaction.Commit(); } //If we opened the connection we will close it if (cleanupConnection && Connection != null) { 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; } return(retStatus); }
protected static FR_L5DO_GDfDIDN_1124_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DO_GDfDIDN_1124 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DO_GDfDIDN_1124_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_Doctors.Atomic.Retrieval.SQL.cls_Get_Doctors_for_DoctorIDNumber_and_TreatmentID.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; command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@LANR", " IN $$LANR$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$LANR$", Parameter.LANR); command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@TreatmentID", " IN $$TreatmentID$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$TreatmentID$", Parameter.TreatmentID); List <L5DO_GDfDIDN_1124> results = new List <L5DO_GDfDIDN_1124>(); 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[] { "LANR", "DoctorFirstName", "DoctorLastName", "AccountHolder", "AccountNumber", "BankName", "BLZ", "HEC_DoctorID", "PracticeName", "PracticeStreetName", "PracticeStreetNumber", "PracticeZIP", "PracticeTown" }); while (reader.Read()) { L5DO_GDfDIDN_1124 resultItem = new L5DO_GDfDIDN_1124(); //0:Parameter LANR of type String resultItem.LANR = reader.GetString(0); //1:Parameter DoctorFirstName of type String resultItem.DoctorFirstName = reader.GetString(1); //2:Parameter DoctorLastName of type String resultItem.DoctorLastName = reader.GetString(2); //3:Parameter AccountHolder of type String resultItem.AccountHolder = reader.GetString(3); //4:Parameter AccountNumber of type String resultItem.AccountNumber = reader.GetString(4); //5:Parameter BankName of type String resultItem.BankName = reader.GetString(5); //6:Parameter BLZ of type String resultItem.BLZ = reader.GetString(6); //7:Parameter HEC_DoctorID of type Guid resultItem.HEC_DoctorID = reader.GetGuid(7); //8:Parameter PracticeName of type String resultItem.PracticeName = reader.GetString(8); //9:Parameter PracticeStreetName of type String resultItem.PracticeStreetName = reader.GetString(9); //10:Parameter PracticeStreetNumber of type String resultItem.PracticeStreetNumber = reader.GetString(10); //11:Parameter PracticeZIP of type String resultItem.PracticeZIP = reader.GetString(11); //12:Parameter PracticeTown of type String resultItem.PracticeTown = reader.GetString(12); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Doctors_for_DoctorIDNumber_and_TreatmentID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_CAS_GCBDoTfS_1945_Array Execute(DbConnection Connection, DbTransaction Transaction, P_CAS_GCBDoTfS_1405 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_CAS_GCBDoTfS_1945_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "MMDocConnectDBMethods.Case.Atomic.Retrieval.SQL.cls_Get_Case_BillingData_on_Tenant_for_Status.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; command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@Statuses", " IN $$Statuses$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$Statuses$", Parameter.Statuses); List <CAS_GCBDoTfS_1945> results = new List <CAS_GCBDoTfS_1945>(); 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[] { "case_id", "case_number", "bill_position_id", "gpos_id", "fs_status_key", "fs_status_code", "bill_position_number", "gpos_code", "gpos_price", "gpos_type", "hec_bill_position_id", "fs_status_id" }); while (reader.Read()) { CAS_GCBDoTfS_1945 resultItem = new CAS_GCBDoTfS_1945(); //0:Parameter case_id of type Guid resultItem.case_id = reader.GetGuid(0); //1:Parameter case_number of type String resultItem.case_number = reader.GetString(1); //2:Parameter bill_position_id of type Guid resultItem.bill_position_id = reader.GetGuid(2); //3:Parameter gpos_id of type Guid resultItem.gpos_id = reader.GetGuid(3); //4:Parameter fs_status_key of type String resultItem.fs_status_key = reader.GetString(4); //5:Parameter fs_status_code of type int resultItem.fs_status_code = reader.GetInteger(5); //6:Parameter bill_position_number of type String resultItem.bill_position_number = reader.GetString(6); //7:Parameter gpos_code of type String resultItem.gpos_code = reader.GetString(7); //8:Parameter gpos_price of type double resultItem.gpos_price = reader.GetDouble(8); //9:Parameter gpos_type of type String resultItem.gpos_type = reader.GetString(9); //10:Parameter hec_bill_position_id of type Guid resultItem.hec_bill_position_id = reader.GetGuid(10); //11:Parameter fs_status_id of type Guid resultItem.fs_status_id = reader.GetGuid(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Case_BillingData_on_Tenant_for_Status", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L5A_GAATfAID_1530 Execute(DbConnection Connection, DbTransaction Transaction, P_L5A_GAATfAID_1530 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5A_GAATfAID_1530(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_TaskTemplate.Atomic.Retrieval.SQL.cls_Get_AllAppointment_Task_for_AppointmentID.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, "AppointmentID", Parameter.AppointmentID); List <L5A_GAATfAID_1530_raw> results = new List <L5A_GAATfAID_1530_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[] { "PPS_TSK_TaskID", "InstantiatedFrom_TaskTemplate_RefID", "DisplayName", "PlannedStartDate", "PlannedDuration_in_sec", "PPS_TSK_Task_StaffBookingsID", "PPS_TSK_Task_RefID", "CMN_BPT_EMP_Employee_RefID", "CreatedFrom_TaskTemplate_RequiredStaff_RefID", "PPS_TSK_Task_OfficeBookingID", "PPS_TSK_Task_RefID_Office", "CMN_STR_Office_RefID", "PPS_TSK_Task_DeviceBookingID", "PPS_TSK_Task_RefID_Device", "PPS_DEV_Device_Instance_RefID", "HEC_APP_AppointmentID", "Ext_PPS_TSK_Task_RefID", "HEC_ACT_PlannedActionID", "Patient_RefID" }); while (reader.Read()) { L5A_GAATfAID_1530_raw resultItem = new L5A_GAATfAID_1530_raw(); //0:Parameter PPS_TSK_TaskID of type Guid resultItem.PPS_TSK_TaskID = reader.GetGuid(0); //1:Parameter InstantiatedFrom_TaskTemplate_RefID of type Guid resultItem.InstantiatedFrom_TaskTemplate_RefID = reader.GetGuid(1); //2:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(2); //3:Parameter PlannedStartDate of type DateTime resultItem.PlannedStartDate = reader.GetDate(3); //4:Parameter PlannedDuration_in_sec of type String resultItem.PlannedDuration_in_sec = reader.GetString(4); //5:Parameter PPS_TSK_Task_StaffBookingsID of type Guid resultItem.PPS_TSK_Task_StaffBookingsID = reader.GetGuid(5); //6:Parameter PPS_TSK_Task_RefID of type Guid resultItem.PPS_TSK_Task_RefID = reader.GetGuid(6); //7:Parameter CMN_BPT_EMP_Employee_RefID of type Guid resultItem.CMN_BPT_EMP_Employee_RefID = reader.GetGuid(7); //8:Parameter CreatedFrom_TaskTemplate_RequiredStaff_RefID of type Guid resultItem.CreatedFrom_TaskTemplate_RequiredStaff_RefID = reader.GetGuid(8); //9:Parameter PPS_TSK_Task_OfficeBookingID of type Guid resultItem.PPS_TSK_Task_OfficeBookingID = reader.GetGuid(9); //10:Parameter PPS_TSK_Task_RefID_Office of type Guid resultItem.PPS_TSK_Task_RefID_Office = reader.GetGuid(10); //11:Parameter CMN_STR_Office_RefID of type Guid resultItem.CMN_STR_Office_RefID = reader.GetGuid(11); //12:Parameter PPS_TSK_Task_DeviceBookingID of type Guid resultItem.PPS_TSK_Task_DeviceBookingID = reader.GetGuid(12); //13:Parameter PPS_TSK_Task_RefID_Device of type Guid resultItem.PPS_TSK_Task_RefID_Device = reader.GetGuid(13); //14:Parameter PPS_DEV_Device_Instance_RefID of type Guid resultItem.PPS_DEV_Device_Instance_RefID = reader.GetGuid(14); //15:Parameter HEC_APP_AppointmentID of type Guid resultItem.HEC_APP_AppointmentID = reader.GetGuid(15); //16:Parameter Ext_PPS_TSK_Task_RefID of type Guid resultItem.Ext_PPS_TSK_Task_RefID = reader.GetGuid(16); //17:Parameter HEC_ACT_PlannedActionID of type Guid resultItem.HEC_ACT_PlannedActionID = reader.GetGuid(17); //18:Parameter Patient_RefID of type Guid resultItem.Patient_RefID = reader.GetGuid(18); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AllAppointment_Task_for_AppointmentID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5A_GAATfAID_1530_raw.Convert(results).FirstOrDefault(); return(returnStatus); }