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_STR.RES_STR_Roof_RequiredAction.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_STR_Roof_RequiredActionID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RES_STR_Roof_RequiredActionID", 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_STR_Roof_RequiredActionID", "RoofPropertyAssestment_RefID", "SelectedActionVersion_RefID", "EffectivePrice_RefID", "Action_PricePerUnit_RefID", "Action_Unit_RefID", "Action_UnitAmount", "IsCustom", "IfCustom_Name", "IfCustom_Description", "Creation_Timestamp", "IsDeleted", "Tenant_RefID", "Action_Timeframe_RefID", "Comment" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter RES_STR_Roof_RequiredActionID of type Guid _RES_STR_Roof_RequiredActionID = reader.GetGuid(0); //1:Parameter RoofPropertyAssestment_RefID of type Guid _RoofPropertyAssestment_RefID = reader.GetGuid(1); //2:Parameter SelectedActionVersion_RefID of type Guid _SelectedActionVersion_RefID = reader.GetGuid(2); //3:Parameter EffectivePrice_RefID of type Guid _EffectivePrice_RefID = reader.GetGuid(3); //4:Parameter Action_PricePerUnit_RefID of type Guid _Action_PricePerUnit_RefID = reader.GetGuid(4); //5:Parameter Action_Unit_RefID of type Guid _Action_Unit_RefID = reader.GetGuid(5); //6:Parameter Action_UnitAmount of type Double _Action_UnitAmount = reader.GetDouble(6); //7:Parameter IsCustom of type Boolean _IsCustom = reader.GetBoolean(7); //8:Parameter IfCustom_Name of type String _IfCustom_Name = reader.GetString(8); //9:Parameter IfCustom_Description of type String _IfCustom_Description = reader.GetString(9); //10:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(10); //11:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(11); //12:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(12); //13:Parameter Action_Timeframe_RefID of type Guid _Action_Timeframe_RefID = reader.GetGuid(13); //14:Parameter Comment of type String _Comment = reader.GetString(14); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_RES_STR_Roof_RequiredActionID != 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_L3PR_GPaPfALaCID_1409_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3PR_GPaPfALaCID_1409 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3PR_GPaPfALaCID_1409_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_Price.Atomic.Retrieval.SQL.cls_Get_Pricelists_and_Prices_for_ArticleList_and_Currency_ID.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]*@ArticleID", " IN $$ArticleID$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$ArticleID$", Parameter.ArticleID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CurrencyID", Parameter.CurrencyID); List <L3PR_GPaPfALaCID_1409> results = new List <L3PR_GPaPfALaCID_1409>(); 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[] { "Pricelist_Name_DictID", "CMN_SLS_PricelistID", "CMN_SLS_PriceID", "GlobalPropertyMatchingID", "PriceAmount", "Release_Version", "CMN_SLS_Pricelist_ReleaseID", "CMN_PRO_Product_RefID", "CMN_Currency_RefID", "IsDynamicPricingUsed", "DynamicPricingFormula_Type_RefID", "DynamicPricingFormula" }); while (reader.Read()) { L3PR_GPaPfALaCID_1409 resultItem = new L3PR_GPaPfALaCID_1409(); //0:Parameter Pricelist_Name of type Dict resultItem.Pricelist_Name = reader.GetDictionary(0); resultItem.Pricelist_Name.SourceTable = "cmn_sls_pricelist"; loader.Append(resultItem.Pricelist_Name); //1:Parameter CMN_SLS_PricelistID of type Guid resultItem.CMN_SLS_PricelistID = reader.GetGuid(1); //2:Parameter CMN_SLS_PriceID of type Guid resultItem.CMN_SLS_PriceID = reader.GetGuid(2); //3:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(3); //4:Parameter PriceAmount of type decimal resultItem.PriceAmount = reader.GetDecimal(4); //5:Parameter Release_Version of type String resultItem.Release_Version = reader.GetString(5); //6:Parameter CMN_SLS_Pricelist_ReleaseID of type Guid resultItem.CMN_SLS_Pricelist_ReleaseID = reader.GetGuid(6); //7:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(7); //8:Parameter CMN_Currency_RefID of type Guid resultItem.CMN_Currency_RefID = reader.GetGuid(8); //9:Parameter IsDynamicPricingUsed of type bool resultItem.IsDynamicPricingUsed = reader.GetBoolean(9); //10:Parameter DynamicPricingFormula_Type_RefID of type Guid resultItem.DynamicPricingFormula_Type_RefID = reader.GetGuid(10); //11:Parameter DynamicPricingFormula of type String resultItem.DynamicPricingFormula = reader.GetString(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Pricelists_and_Prices_for_ArticleList_and_Currency_ID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L5TR_GaTfT_1211_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5TR_GaTfT_1211_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_Treatments.Complex.Retrieval.SQL.cls_Get_all_Treatment_for_TennantID.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 <L5TR_GaTfT_1211_raw> results = new List <L5TR_GaTfT_1211_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_Patient_TreatmentID", "FirstName", "LastName", "IsTreatmentBilled", "IsScheduled", "IfSheduled_Date", "IfTreatmentBilled_Date", "IsTreatmentFollowup", "IsTreatmentPerformed", "IfTreatmentPerformed_Date", "DisplayName", "CompanyName", "Tenant_RefID", "DoctorFirstName", "DoctorLastname", "DoctorTitle", "DoctorFirstNameScheduled", "DoctorLastnameScheduled", "DoctorTitleScheduled" }); while (reader.Read()) { L5TR_GaTfT_1211_raw resultItem = new L5TR_GaTfT_1211_raw(); //0:Parameter HEC_Patient_TreatmentID of type Guid resultItem.HEC_Patient_TreatmentID = 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 IsTreatmentBilled of type bool resultItem.IsTreatmentBilled = reader.GetBoolean(3); //4:Parameter IsScheduled of type bool resultItem.IsScheduled = reader.GetBoolean(4); //5:Parameter IfSheduled_Date of type DateTime resultItem.IfSheduled_Date = reader.GetDate(5); //6:Parameter IfTreatmentBilled_Date of type DateTime resultItem.IfTreatmentBilled_Date = reader.GetDate(6); //7:Parameter IsTreatmentFollowup of type bool resultItem.IsTreatmentFollowup = reader.GetBoolean(7); //8:Parameter IsTreatmentPerformed of type bool resultItem.IsTreatmentPerformed = reader.GetBoolean(8); //9:Parameter IfTreatmentPerformed_Date of type DateTime resultItem.IfTreatmentPerformed_Date = reader.GetDate(9); //10:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(10); //11:Parameter CompanyName of type String resultItem.CompanyName = reader.GetString(11); //12:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(12); //13:Parameter DoctorFirstName of type String resultItem.DoctorFirstName = reader.GetString(13); //14:Parameter DoctorLastname of type String resultItem.DoctorLastname = reader.GetString(14); //15:Parameter DoctorTitle of type String resultItem.DoctorTitle = reader.GetString(15); //16:Parameter DoctorFirstNameScheduled of type String resultItem.DoctorFirstNameScheduled = reader.GetString(16); //17:Parameter DoctorLastnameScheduled of type String resultItem.DoctorLastnameScheduled = reader.GetString(17); //18:Parameter DoctorTitleScheduled of type String resultItem.DoctorTitleScheduled = reader.GetString(18); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_all_Treatment_for_TennantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5TR_GaTfT_1211_raw.Convert(results).ToArray(); return(returnStatus); }
private static List <ORM_CMN_BPT_EMP_EffectiveWorkTime_PositionHistory> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_CMN_BPT_EMP_EffectiveWorkTime_PositionHistory> 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_BPT_EMP_EffectiveWorkTime_PositionHistory>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID", "EffectiveWorkTime_Header_RefID", "EffectiveWorkTime_Position_RefID", "TriggeredAt_Date", "TriggeredBy_BusinessParticipant_RefID", "TriggeredBy_SourceOfEntry", "Comment", "Activity_RefID", "Workplace_RefID", "CMN_BPT_EMP_Employee_LeaveRequest_RefID", "WorkTime_StartTime", "WorkTime_Duration_in_sec", "SourceOfEntry", "IsCreated", "IsModified", "IsDeleted", "Creation_Timestamp", "Tenant_RefID", "Modification_Timestamp" }); while (reader.Read()) { ORM_CMN_BPT_EMP_EffectiveWorkTime_PositionHistory item = new ORM_CMN_BPT_EMP_EffectiveWorkTime_PositionHistory(); //0:Parameter CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID of type Guid item.CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID = reader.GetGuid(0); //1:Parameter EffectiveWorkTime_Header_RefID of type Guid item.EffectiveWorkTime_Header_RefID = reader.GetGuid(1); //2:Parameter EffectiveWorkTime_Position_RefID of type Guid item.EffectiveWorkTime_Position_RefID = reader.GetGuid(2); //3:Parameter TriggeredAt_Date of type DateTime item.TriggeredAt_Date = reader.GetDate(3); //4:Parameter TriggeredBy_BusinessParticipant_RefID of type Guid item.TriggeredBy_BusinessParticipant_RefID = reader.GetGuid(4); //5:Parameter TriggeredBy_SourceOfEntry of type int item.TriggeredBy_SourceOfEntry = reader.GetInteger(5); //6:Parameter Comment of type String item.Comment = reader.GetString(6); //7:Parameter Activity_RefID of type Guid item.Activity_RefID = reader.GetGuid(7); //8:Parameter Workplace_RefID of type Guid item.Workplace_RefID = reader.GetGuid(8); //9:Parameter CMN_BPT_EMP_Employee_LeaveRequest_RefID of type Guid item.CMN_BPT_EMP_Employee_LeaveRequest_RefID = reader.GetGuid(9); //10:Parameter WorkTime_StartTime of type DateTime item.WorkTime_StartTime = reader.GetDate(10); //11:Parameter WorkTime_Duration_in_sec of type int item.WorkTime_Duration_in_sec = reader.GetInteger(11); //12:Parameter SourceOfEntry of type int item.SourceOfEntry = reader.GetInteger(12); //13:Parameter IsCreated of type Boolean item.IsCreated = reader.GetBoolean(13); //14:Parameter IsModified of type Boolean item.IsModified = reader.GetBoolean(14); //15:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(15); //16:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(16); //17:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(17); //18:Parameter Modification_Timestamp of type DateTime item.Modification_Timestamp = reader.GetDate(18); 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 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_USR.USR_Device_ActivityHistory.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 _USR_Device_ActivityHistoryID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "USR_Device_ActivityHistoryID", 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[] { "USR_Device_ActivityHistoryID", "Device_RefID", "Performing_Account_RefID", "DateOfActivity", "WasDevice_Configured", "WasDevice_Configured_WithConfigurationCode_RefID", "WasDevice_RequestingDSC", "WasBanned", "WasUnbanned", "WasCreatedSession", "WasOtherRelevantActivity", "ActivityComment", "AccountComment", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter USR_Device_ActivityHistoryID of type Guid _USR_Device_ActivityHistoryID = reader.GetGuid(0); //1:Parameter Device_RefID of type Guid _Device_RefID = reader.GetGuid(1); //2:Parameter Performing_Account_RefID of type Guid _Performing_Account_RefID = reader.GetGuid(2); //3:Parameter DateOfActivity of type DateTime _DateOfActivity = reader.GetDate(3); //4:Parameter WasDevice_Configured of type Boolean _WasDevice_Configured = reader.GetBoolean(4); //5:Parameter WasDevice_Configured_WithConfigurationCode_RefID of type Guid _WasDevice_Configured_WithConfigurationCode_RefID = reader.GetGuid(5); //6:Parameter WasDevice_RequestingDSC of type Boolean _WasDevice_RequestingDSC = reader.GetBoolean(6); //7:Parameter WasBanned of type Boolean _WasBanned = reader.GetBoolean(7); //8:Parameter WasUnbanned of type Boolean _WasUnbanned = reader.GetBoolean(8); //9:Parameter WasCreatedSession of type Boolean _WasCreatedSession = reader.GetBoolean(9); //10:Parameter WasOtherRelevantActivity of type Boolean _WasOtherRelevantActivity = reader.GetBoolean(10); //11:Parameter ActivityComment of type String _ActivityComment = reader.GetString(11); //12:Parameter AccountComment of type String _AccountComment = reader.GetString(12); //13:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(13); //14:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(14); //15:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(15); //16:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(16); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_USR_Device_ActivityHistoryID != 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); }
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_MedicalPractis.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_MedicalPractiseID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_MedicalPractiseID", 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_MedicalPractiseID", "WeeklyOfficeHours_Template_RefID", "Ext_CompanyInfo_RefID", "AssociatedWith_PhysitianAssociation_RefID", "ContactPerson_RefID", "WeeklySurgeryHours_Template_RefID", "Contact_EmergencyPhoneNumber", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "IsHospital", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter HEC_MedicalPractiseID of type Guid _HEC_MedicalPractiseID = reader.GetGuid(0); //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid _WeeklyOfficeHours_Template_RefID = reader.GetGuid(1); //2:Parameter Ext_CompanyInfo_RefID of type Guid _Ext_CompanyInfo_RefID = reader.GetGuid(2); //3:Parameter AssociatedWith_PhysitianAssociation_RefID of type Guid _AssociatedWith_PhysitianAssociation_RefID = reader.GetGuid(3); //4:Parameter ContactPerson_RefID of type Guid _ContactPerson_RefID = reader.GetGuid(4); //5:Parameter WeeklySurgeryHours_Template_RefID of type Guid _WeeklySurgeryHours_Template_RefID = reader.GetGuid(5); //6:Parameter Contact_EmergencyPhoneNumber of type String _Contact_EmergencyPhoneNumber = 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 IsHospital of type Boolean _IsHospital = reader.GetBoolean(10); //11:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(11); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_HEC_MedicalPractiseID != 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_CAS_GCFGR_1410_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_CAS_GCFGR_1410_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "MMDocConnectDBMethods.Case.Atomic.Retrieval.SQL.cls_Get_Cases_for_General_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; List <CAS_GCFGR_1410> results = new List <CAS_GCFGR_1410>(); 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[] { "CaseNumber", "IM_PotentialDiagnosisLocalization_Code", "IM_PotentialDiagnosis_Name", "IM_PotentialDiagnosis_Code", "IM_PotentialDiagnosisState_Name", "IM_PotentialDiagnosisCatalog_Name", "TreatmentSubmitBPName", "TreatmentPracticeName", "AfterCaseSubmitMedicalPractice", "AfterCaseSubmitResponsibleBPNAme", "Patient_RefID", "PotentialDiagnosis_RefID", "AfterCareDoctor", "SurgeryDoctor", "CaseID", "StatusID", "TreatmentCaseSubmitActionID", "afterCaseSubmitActionID", "LocalizationID", "LocalizationImID", "DiganoseImID", "Code", "Catalog_Name_DictID", "PotentialDiagnosis_Name_DictID", "CodeForType", "TreatmentDate", "AfterCareDate", "BillingCode", "StatusNumber", "PositionNumber", "PositionValue_IncludingTax", "IsTreatmentP", "IsAftercareP", "TreatmentPerformedDiganoseID", "AftercasePerformedDiagnoseID", "TreatmentDiagnoseUpdateIM", "AftercareDiagnoseUpdateIM", "TreatmentLocalizationID", "AftercareLocalizationID", "TreatmentLocalizationCode", "AftercareLocalizationCode", "AftercaseLocalizationIDIM", "TreatmentLocalizationIDIM", "IsPatientFeeWaived", "orderId", "orderStatusCode", "isLabelOnly", "SendInvoiceToPractice", "NumberForPayment", "DrugID", "CodeName", "IsTreatmentID", "IsAftercareID", "AftercareBPT", "GposType", "GposID", "BillPositionID", "IsAftercareCancelled", "CaseCreationDate" }); while (reader.Read()) { CAS_GCFGR_1410 resultItem = new CAS_GCFGR_1410(); //0:Parameter CaseNumber of type String resultItem.CaseNumber = reader.GetString(0); //1:Parameter IM_PotentialDiagnosisLocalization_Code of type String resultItem.IM_PotentialDiagnosisLocalization_Code = reader.GetString(1); //2:Parameter IM_PotentialDiagnosis_Name of type String resultItem.IM_PotentialDiagnosis_Name = reader.GetString(2); //3:Parameter IM_PotentialDiagnosis_Code of type String resultItem.IM_PotentialDiagnosis_Code = reader.GetString(3); //4:Parameter IM_PotentialDiagnosisState_Name of type String resultItem.IM_PotentialDiagnosisState_Name = reader.GetString(4); //5:Parameter IM_PotentialDiagnosisCatalog_Name of type String resultItem.IM_PotentialDiagnosisCatalog_Name = reader.GetString(5); //6:Parameter TreatmentSubmitBPName of type String resultItem.TreatmentSubmitBPName = reader.GetString(6); //7:Parameter TreatmentPracticeName of type String resultItem.TreatmentPracticeName = reader.GetString(7); //8:Parameter AfterCaseSubmitMedicalPractice of type String resultItem.AfterCaseSubmitMedicalPractice = reader.GetString(8); //9:Parameter AfterCaseSubmitResponsibleBPNAme of type String resultItem.AfterCaseSubmitResponsibleBPNAme = reader.GetString(9); //10:Parameter Patient_RefID of type Guid resultItem.Patient_RefID = reader.GetGuid(10); //11:Parameter PotentialDiagnosis_RefID of type Guid resultItem.PotentialDiagnosis_RefID = reader.GetGuid(11); //12:Parameter AfterCareDoctor of type Guid resultItem.AfterCareDoctor = reader.GetGuid(12); //13:Parameter SurgeryDoctor of type Guid resultItem.SurgeryDoctor = reader.GetGuid(13); //14:Parameter CaseID of type Guid resultItem.CaseID = reader.GetGuid(14); //15:Parameter StatusID of type Guid resultItem.StatusID = reader.GetGuid(15); //16:Parameter TreatmentCaseSubmitActionID of type Guid resultItem.TreatmentCaseSubmitActionID = reader.GetGuid(16); //17:Parameter afterCaseSubmitActionID of type Guid resultItem.afterCaseSubmitActionID = reader.GetGuid(17); //18:Parameter LocalizationID of type Guid resultItem.LocalizationID = reader.GetGuid(18); //19:Parameter LocalizationImID of type Guid resultItem.LocalizationImID = reader.GetGuid(19); //20:Parameter DiganoseImID of type Guid resultItem.DiganoseImID = reader.GetGuid(20); //21:Parameter Code of type String resultItem.Code = reader.GetString(21); //22:Parameter Catalog_Name_DictID of type Dict resultItem.Catalog_Name_DictID = reader.GetDictionary(22); resultItem.Catalog_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs"; loader.Append(resultItem.Catalog_Name_DictID); //23:Parameter PotentialDiagnosis_Name_DictID of type Dict resultItem.PotentialDiagnosis_Name_DictID = reader.GetDictionary(23); resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs"; loader.Append(resultItem.PotentialDiagnosis_Name_DictID); //24:Parameter CodeForType of type String resultItem.CodeForType = reader.GetString(24); //25:Parameter TreatmentDate of type DateTime resultItem.TreatmentDate = reader.GetDate(25); //26:Parameter AfterCareDate of type DateTime resultItem.AfterCareDate = reader.GetDate(26); //27:Parameter BillingCode of type String resultItem.BillingCode = reader.GetString(27); //28:Parameter StatusNumber of type String resultItem.StatusNumber = reader.GetString(28); //29:Parameter PositionNumber of type String resultItem.PositionNumber = reader.GetString(29); //30:Parameter PositionValue_IncludingTax of type Double resultItem.PositionValue_IncludingTax = reader.GetDouble(30); //31:Parameter IsTreatmentP of type bool resultItem.IsTreatmentP = reader.GetBoolean(31); //32:Parameter IsAftercareP of type bool resultItem.IsAftercareP = reader.GetBoolean(32); //33:Parameter TreatmentPerformedDiganoseID of type Guid resultItem.TreatmentPerformedDiganoseID = reader.GetGuid(33); //34:Parameter AftercasePerformedDiagnoseID of type Guid resultItem.AftercasePerformedDiagnoseID = reader.GetGuid(34); //35:Parameter TreatmentDiagnoseUpdateIM of type Guid resultItem.TreatmentDiagnoseUpdateIM = reader.GetGuid(35); //36:Parameter AftercareDiagnoseUpdateIM of type Guid resultItem.AftercareDiagnoseUpdateIM = reader.GetGuid(36); //37:Parameter TreatmentLocalizationID of type Guid resultItem.TreatmentLocalizationID = reader.GetGuid(37); //38:Parameter AftercareLocalizationID of type Guid resultItem.AftercareLocalizationID = reader.GetGuid(38); //39:Parameter TreatmentLocalizationCode of type String resultItem.TreatmentLocalizationCode = reader.GetString(39); //40:Parameter AftercareLocalizationCode of type String resultItem.AftercareLocalizationCode = reader.GetString(40); //41:Parameter AftercaseLocalizationIDIM of type Guid resultItem.AftercaseLocalizationIDIM = reader.GetGuid(41); //42:Parameter TreatmentLocalizationIDIM of type Guid resultItem.TreatmentLocalizationIDIM = reader.GetGuid(42); //43:Parameter IsPatientFeeWaived of type Boolean resultItem.IsPatientFeeWaived = reader.GetBoolean(43); //44:Parameter orderId of type Guid resultItem.orderId = reader.GetGuid(44); //45:Parameter orderStatusCode of type string resultItem.orderStatusCode = reader.GetString(45); //46:Parameter isLabelOnly of type Boolean resultItem.isLabelOnly = reader.GetBoolean(46); //47:Parameter SendInvoiceToPractice of type Boolean resultItem.SendInvoiceToPractice = reader.GetBoolean(47); //48:Parameter NumberForPayment of type int resultItem.NumberForPayment = reader.GetInteger(48); //49:Parameter DrugID of type Guid resultItem.DrugID = reader.GetGuid(49); //50:Parameter CodeName of type String resultItem.CodeName = reader.GetString(50); //51:Parameter IsTreatmentID of type Guid resultItem.IsTreatmentID = reader.GetGuid(51); //52:Parameter IsAftercareID of type Guid resultItem.IsAftercareID = reader.GetGuid(52); //53:Parameter AftercareBPT of type Guid resultItem.AftercareBPT = reader.GetGuid(53); //54:Parameter GposType of type String resultItem.GposType = reader.GetString(54); //55:Parameter GposID of type Guid resultItem.GposID = reader.GetGuid(55); //56:Parameter BillPositionID of type Guid resultItem.BillPositionID = reader.GetGuid(56); //57:Parameter IsAftercareCancelled of type Boolean resultItem.IsAftercareCancelled = reader.GetBoolean(57); //58:Parameter CaseCreationDate of type DateTime resultItem.CaseCreationDate = reader.GetDate(58); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Cases_for_General_Report", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L3BT_GBTSVfPL_1423_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3BT_GBTSVfPL_1423 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3BT_GBTSVfPL_1423_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_BusinessTasks.Atomic.Retrieval.SQL.cls_Get_BusinessTasks_SimpleView_for_ProjectIDList.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]*@ProjectIDList", " IN $$ProjectIDList$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$ProjectIDList$", Parameter.ProjectIDList); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Is_ArchivedTasks_Included", Parameter.Is_ArchivedTasks_Included); List <L3BT_GBTSVfPL_1423> results = new List <L3BT_GBTSVfPL_1423>(); 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[] { "TMS_PRO_BusinessTaskID", "IdentificationNumber", "Task_Name_DictID", "Project_RefID", "DOC_Structure_Header_RefID", "BusinessTasksPackage_RefID", "IsArchived", "Task_Status_RefID" }); while (reader.Read()) { L3BT_GBTSVfPL_1423 resultItem = new L3BT_GBTSVfPL_1423(); //0:Parameter TMS_PRO_BusinessTaskID of type Guid resultItem.TMS_PRO_BusinessTaskID = reader.GetGuid(0); //1:Parameter IdentificationNumber of type String resultItem.IdentificationNumber = reader.GetString(1); //2:Parameter Task_Name of type Dict resultItem.Task_Name = reader.GetDictionary(2); resultItem.Task_Name.SourceTable = "tms_pro_businesstasks"; loader.Append(resultItem.Task_Name); //3:Parameter Project_RefID of type Guid resultItem.Project_RefID = reader.GetGuid(3); //4:Parameter DOC_Structure_Header_RefID of type Guid resultItem.DOC_Structure_Header_RefID = reader.GetGuid(4); //5:Parameter BusinessTasksPackage_RefID of type Guid resultItem.BusinessTasksPackage_RefID = reader.GetGuid(5); //6:Parameter IsArchived of type Boolean resultItem.IsArchived = reader.GetBoolean(6); //7:Parameter Task_Status_RefID of type Guid resultItem.Task_Status_RefID = reader.GetGuid(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_BusinessTasks_SimpleView_for_ProjectIDList", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_ORD_PRC_SPB_SupplierBill_Position> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_ORD_PRC_SPB_SupplierBill_Position> 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_PRC_SPB_SupplierBill_Position>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "ORD_PRC_SPB_SupplierBill_PositionID", "SupplierBill_Header_RefID", "PositionNumber", "BillPosition_Comment", "PositionIndex", "PositionValue_BeforeTax", "PositionValue_IncludingTax", "BillPosition_ProductNumber", "Quantity", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { ORM_ORD_PRC_SPB_SupplierBill_Position item = new ORM_ORD_PRC_SPB_SupplierBill_Position(); //0:Parameter ORD_PRC_SPB_SupplierBill_PositionID of type Guid item.ORD_PRC_SPB_SupplierBill_PositionID = reader.GetGuid(0); //1:Parameter SupplierBill_Header_RefID of type Guid item.SupplierBill_Header_RefID = reader.GetGuid(1); //2:Parameter PositionNumber of type String item.PositionNumber = reader.GetString(2); //3:Parameter BillPosition_Comment of type String item.BillPosition_Comment = reader.GetString(3); //4:Parameter PositionIndex of type int item.PositionIndex = reader.GetInteger(4); //5:Parameter PositionValue_BeforeTax of type Decimal item.PositionValue_BeforeTax = reader.GetDecimal(5); //6:Parameter PositionValue_IncludingTax of type Decimal item.PositionValue_IncludingTax = reader.GetDecimal(6); //7:Parameter BillPosition_ProductNumber of type String item.BillPosition_ProductNumber = reader.GetString(7); //8:Parameter Quantity of type Double item.Quantity = reader.GetDouble(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_PRO_Catalog_Revision> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_CMN_PRO_Catalog_Revision> 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_PRO_Catalog_Revision>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_PRO_Catalog_RevisionID", "CMN_PRO_Catalog_RefID", "CatalogRevision_Name", "CatalogRevision_Description", "RevisionNumber", "Valid_From", "Valid_Through", "PublishedBy_BusinessParticipant_RefID", "Default_PricelistRelease_RefID", "PublishedOn_Date", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { ORM_CMN_PRO_Catalog_Revision item = new ORM_CMN_PRO_Catalog_Revision(); //0:Parameter CMN_PRO_Catalog_RevisionID of type Guid item.CMN_PRO_Catalog_RevisionID = reader.GetGuid(0); //1:Parameter CMN_PRO_Catalog_RefID of type Guid item.CMN_PRO_Catalog_RefID = reader.GetGuid(1); //2:Parameter CatalogRevision_Name of type String item.CatalogRevision_Name = reader.GetString(2); //3:Parameter CatalogRevision_Description of type String item.CatalogRevision_Description = reader.GetString(3); //4:Parameter RevisionNumber of type int item.RevisionNumber = reader.GetInteger(4); //5:Parameter Valid_From of type DateTime item.Valid_From = reader.GetDate(5); //6:Parameter Valid_Through of type DateTime item.Valid_Through = reader.GetDate(6); //7:Parameter PublishedBy_BusinessParticipant_RefID of type Guid item.PublishedBy_BusinessParticipant_RefID = reader.GetGuid(7); //8:Parameter Default_PricelistRelease_RefID of type Guid item.Default_PricelistRelease_RefID = reader.GetGuid(8); //9:Parameter PublishedOn_Date of type DateTime item.PublishedOn_Date = reader.GetDate(9); //10:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(10); //11:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(11); //12:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(12); 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_L6TR_GFDbID_1420_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6TR_GFDbID_1420 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L6TR_GFDbID_1420_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL6_Lucenits_Treatments.Atomic.Retrieval.SQL.cls_Get_FollowupData_by_IDs.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]*@TreatmentIDList", " IN $$TreatmentIDList$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$TreatmentIDList$", Parameter.TreatmentIDList); List <L6TR_GFDbID_1420_raw> results = new List <L6TR_GFDbID_1420_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[] { "FollowupID", "IsTreatmentDeleted", "HEC_Patient_TreatmentID", "TreatmentPractice_RefID", "IsTreatmentPerformed", "IfTreatmentPerformed_ByDoctor_RefID", "IfTreatmentPerformed_Date", "IsTreatmentFollowup", "IfTreatmentFollowup_FromTreatment_RefID", "IsScheduled", "IfSheduled_Date", "IsTreatmentBilled", "IfTreatmentBilled_Date", "Treatment_Comment", "IsTreatmentOfLeftEye", "IsTreatmentOfRightEye", "HEC_Patient_RefID", "IfSheduled_ForDoctor_RefID", "HEC_Patient_Treatment_RelevantDiagnosisID", "HEC_DIA_Diagnosis_StateID", "HEC_DIA_PotentialDiagnosisID", "Doctor_RefID", "ICD10_Code", "DiagnosisState_Name_DictID", "DiagnosisState_Abbreviation", "Creation_Date", "DiagnosedOnDate", "PotentialDiagnosis_Name_DictID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID" }); while (reader.Read()) { L6TR_GFDbID_1420_raw resultItem = new L6TR_GFDbID_1420_raw(); //0:Parameter FollowupID of type Guid resultItem.FollowupID = reader.GetGuid(0); //1:Parameter IsTreatmentDeleted of type bool resultItem.IsTreatmentDeleted = reader.GetBoolean(1); //2:Parameter HEC_Patient_TreatmentID of type Guid resultItem.HEC_Patient_TreatmentID = reader.GetGuid(2); //3:Parameter TreatmentPractice_RefID of type Guid resultItem.TreatmentPractice_RefID = reader.GetGuid(3); //4:Parameter IsTreatmentPerformed of type bool resultItem.IsTreatmentPerformed = reader.GetBoolean(4); //5:Parameter IfTreatmentPerformed_ByDoctor_RefID of type Guid resultItem.IfTreatmentPerformed_ByDoctor_RefID = reader.GetGuid(5); //6:Parameter IfTreatmentPerformed_Date of type DateTime resultItem.IfTreatmentPerformed_Date = reader.GetDate(6); //7:Parameter IsTreatmentFollowup of type bool resultItem.IsTreatmentFollowup = reader.GetBoolean(7); //8:Parameter IfTreatmentFollowup_FromTreatment_RefID of type Guid resultItem.IfTreatmentFollowup_FromTreatment_RefID = reader.GetGuid(8); //9:Parameter IsScheduled of type bool resultItem.IsScheduled = reader.GetBoolean(9); //10:Parameter IfSheduled_Date of type DateTime resultItem.IfSheduled_Date = reader.GetDate(10); //11:Parameter IsTreatmentBilled of type bool resultItem.IsTreatmentBilled = reader.GetBoolean(11); //12:Parameter IfTreatmentBilled_Date of type DateTime resultItem.IfTreatmentBilled_Date = reader.GetDate(12); //13:Parameter Treatment_Comment of type String resultItem.Treatment_Comment = reader.GetString(13); //14:Parameter IsTreatmentOfLeftEye of type bool resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(14); //15:Parameter IsTreatmentOfRightEye of type bool resultItem.IsTreatmentOfRightEye = reader.GetBoolean(15); //16:Parameter HEC_Patient_RefID of type Guid resultItem.HEC_Patient_RefID = reader.GetGuid(16); //17:Parameter IfSheduled_ForDoctor_RefID of type Guid resultItem.IfSheduled_ForDoctor_RefID = reader.GetGuid(17); //18:Parameter HEC_Patient_Treatment_RelevantDiagnosisID of type Guid resultItem.HEC_Patient_Treatment_RelevantDiagnosisID = reader.GetGuid(18); //19:Parameter HEC_DIA_Diagnosis_StateID of type Guid resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(19); //20:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(20); //21:Parameter Doctor_RefID of type Guid resultItem.Doctor_RefID = reader.GetGuid(21); //22:Parameter ICD10_Code of type String resultItem.ICD10_Code = reader.GetString(22); //23:Parameter DiagnosisState_Name of type Dict resultItem.DiagnosisState_Name = reader.GetDictionary(23); resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states"; loader.Append(resultItem.DiagnosisState_Name); //24:Parameter DiagnosisState_Abbreviation of type String resultItem.DiagnosisState_Abbreviation = reader.GetString(24); //25:Parameter Creation_Date of type DateTime resultItem.Creation_Date = reader.GetDate(25); //26:Parameter DiagnosedOnDate of type DateTime resultItem.DiagnosedOnDate = reader.GetDate(26); //27:Parameter PotentialDiagnosis_Name_DictID of type Dict resultItem.PotentialDiagnosis_Name_DictID = reader.GetDictionary(27); resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name_DictID); //28:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(28); //29:Parameter Product_Number of type string resultItem.Product_Number = reader.GetString(29); //30:Parameter Quantity of type double resultItem.Quantity = reader.GetDouble(30); //31:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(31); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_FollowupData_by_IDs", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L6TR_GFDbID_1420_raw.Convert(results).ToArray(); return(returnStatus); }
private static List <ORM_CMN_CAL_WeeklyOfficeHours_Interval> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_CMN_CAL_WeeklyOfficeHours_Interval> 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_CAL_WeeklyOfficeHours_Interval>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_CAL_WeeklyOfficeHours_IntervalID", "WeeklyOfficeHours_Template_RefID", "IsWholeDay", "TimeFrom_InMinutes", "TimeTo_InMinutes", "IsMonday", "IsTuesday", "IsWednesday", "IsThursday", "IsFriday", "IsSaturday", "IsSunday", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" }); while (reader.Read()) { ORM_CMN_CAL_WeeklyOfficeHours_Interval item = new ORM_CMN_CAL_WeeklyOfficeHours_Interval(); //0:Parameter CMN_CAL_WeeklyOfficeHours_IntervalID of type Guid item.CMN_CAL_WeeklyOfficeHours_IntervalID = reader.GetGuid(0); //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid item.WeeklyOfficeHours_Template_RefID = reader.GetGuid(1); //2:Parameter IsWholeDay of type Boolean item.IsWholeDay = reader.GetBoolean(2); //3:Parameter TimeFrom_InMinutes of type long item.TimeFrom_InMinutes = reader.GetLong(3); //4:Parameter TimeTo_InMinutes of type long item.TimeTo_InMinutes = reader.GetLong(4); //5:Parameter IsMonday of type Boolean item.IsMonday = reader.GetBoolean(5); //6:Parameter IsTuesday of type Boolean item.IsTuesday = reader.GetBoolean(6); //7:Parameter IsWednesday of type Boolean item.IsWednesday = reader.GetBoolean(7); //8:Parameter IsThursday of type Boolean item.IsThursday = reader.GetBoolean(8); //9:Parameter IsFriday of type Boolean item.IsFriday = reader.GetBoolean(9); //10:Parameter IsSaturday of type Boolean item.IsSaturday = reader.GetBoolean(10); //11:Parameter IsSunday of type Boolean item.IsSunday = reader.GetBoolean(11); //12:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(12); //13:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(13); //14:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(14); 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 VerifySessionToken/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_CAL.CMN_CAL_WeeklyOfficeHours_Interval.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_CAL_WeeklyOfficeHours_IntervalID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_CAL_WeeklyOfficeHours_IntervalID", 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_CAL_WeeklyOfficeHours_IntervalID", "WeeklyOfficeHours_Template_RefID", "IsWholeDay", "TimeFrom_InMinutes", "TimeTo_InMinutes", "IsMonday", "IsTuesday", "IsWednesday", "IsThursday", "IsFriday", "IsSaturday", "IsSunday", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter CMN_CAL_WeeklyOfficeHours_IntervalID of type Guid _CMN_CAL_WeeklyOfficeHours_IntervalID = reader.GetGuid(0); //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid _WeeklyOfficeHours_Template_RefID = reader.GetGuid(1); //2:Parameter IsWholeDay of type Boolean _IsWholeDay = reader.GetBoolean(2); //3:Parameter TimeFrom_InMinutes of type long _TimeFrom_InMinutes = reader.GetLong(3); //4:Parameter TimeTo_InMinutes of type long _TimeTo_InMinutes = reader.GetLong(4); //5:Parameter IsMonday of type Boolean _IsMonday = reader.GetBoolean(5); //6:Parameter IsTuesday of type Boolean _IsTuesday = reader.GetBoolean(6); //7:Parameter IsWednesday of type Boolean _IsWednesday = reader.GetBoolean(7); //8:Parameter IsThursday of type Boolean _IsThursday = reader.GetBoolean(8); //9:Parameter IsFriday of type Boolean _IsFriday = reader.GetBoolean(9); //10:Parameter IsSaturday of type Boolean _IsSaturday = reader.GetBoolean(10); //11:Parameter IsSunday of type Boolean _IsSunday = reader.GetBoolean(11); //12:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(12); //13:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(13); //14:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(14); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_CMN_CAL_WeeklyOfficeHours_IntervalID != 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); }
private static List <ORM_RES_STR_Roof_RequiredAction> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_RES_STR_Roof_RequiredAction> 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_STR_Roof_RequiredAction>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "RES_STR_Roof_RequiredActionID", "RoofPropertyAssestment_RefID", "SelectedActionVersion_RefID", "EffectivePrice_RefID", "Action_PricePerUnit_RefID", "Action_Unit_RefID", "Action_UnitAmount", "IsCustom", "IfCustom_Name", "IfCustom_Description", "Creation_Timestamp", "IsDeleted", "Tenant_RefID", "Action_Timeframe_RefID", "Comment" }); while (reader.Read()) { ORM_RES_STR_Roof_RequiredAction item = new ORM_RES_STR_Roof_RequiredAction(); //0:Parameter RES_STR_Roof_RequiredActionID of type Guid item.RES_STR_Roof_RequiredActionID = reader.GetGuid(0); //1:Parameter RoofPropertyAssestment_RefID of type Guid item.RoofPropertyAssestment_RefID = reader.GetGuid(1); //2:Parameter SelectedActionVersion_RefID of type Guid item.SelectedActionVersion_RefID = reader.GetGuid(2); //3:Parameter EffectivePrice_RefID of type Guid item.EffectivePrice_RefID = reader.GetGuid(3); //4:Parameter Action_PricePerUnit_RefID of type Guid item.Action_PricePerUnit_RefID = reader.GetGuid(4); //5:Parameter Action_Unit_RefID of type Guid item.Action_Unit_RefID = reader.GetGuid(5); //6:Parameter Action_UnitAmount of type Double item.Action_UnitAmount = reader.GetDouble(6); //7:Parameter IsCustom of type Boolean item.IsCustom = reader.GetBoolean(7); //8:Parameter IfCustom_Name of type String item.IfCustom_Name = reader.GetString(8); //9:Parameter IfCustom_Description of type String item.IfCustom_Description = reader.GetString(9); //10:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(10); //11:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(11); //12:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(12); //13:Parameter Action_Timeframe_RefID of type Guid item.Action_Timeframe_RefID = reader.GetGuid(13); //14:Parameter Comment of type String item.Comment = reader.GetString(14); 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_L5_EM_GEWI_1628_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5_EM_GEWI_1628_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_VacationPlanner_Employees.Atomic.Retrieval.SQL.cls_Get_Employee_WorktimeIntervals.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 <L5_EM_GEWI_1628> results = new List <L5_EM_GEWI_1628>(); 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_CAL_WeeklyOfficeHours_IntervalID", "WeeklyOfficeHours_Template_RefID", "IsWholeDay", "TimeFrom_InMinutes", "TimeTo_InMinutes", "IsMonday", "IsTuesday", "IsWednesday", "IsThursday", "IsFriday", "IsSaturday", "IsSunday", "Creation_Timestamp", "Tenant_RefID", "CMN_BPT_EMP_WorkingContractID" }); while (reader.Read()) { L5_EM_GEWI_1628 resultItem = new L5_EM_GEWI_1628(); //0:Parameter CMN_CAL_WeeklyOfficeHours_IntervalID of type Guid resultItem.CMN_CAL_WeeklyOfficeHours_IntervalID = reader.GetGuid(0); //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid resultItem.WeeklyOfficeHours_Template_RefID = reader.GetGuid(1); //2:Parameter IsWholeDay of type bool resultItem.IsWholeDay = reader.GetBoolean(2); //3:Parameter TimeFrom_InMinutes of type String resultItem.TimeFrom_InMinutes = reader.GetString(3); //4:Parameter TimeTo_InMinutes of type double resultItem.TimeTo_InMinutes = reader.GetDouble(4); //5:Parameter IsMonday of type bool resultItem.IsMonday = reader.GetBoolean(5); //6:Parameter IsTuesday of type bool resultItem.IsTuesday = reader.GetBoolean(6); //7:Parameter IsWednesday of type bool resultItem.IsWednesday = reader.GetBoolean(7); //8:Parameter IsThursday of type bool resultItem.IsThursday = reader.GetBoolean(8); //9:Parameter IsFriday of type bool resultItem.IsFriday = reader.GetBoolean(9); //10:Parameter IsSaturday of type bool resultItem.IsSaturday = reader.GetBoolean(10); //11:Parameter IsSunday of type bool resultItem.IsSunday = reader.GetBoolean(11); //12:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(12); //13:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(13); //14:Parameter CMN_BPT_EMP_WorkingContractID of type Guid resultItem.CMN_BPT_EMP_WorkingContractID = reader.GetGuid(14); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Employee_WorktimeIntervals", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_ORD_DIS_DistributionOrder_Position> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_ORD_DIS_DistributionOrder_Position> 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_DIS_DistributionOrder_Position>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "ORD_DIS_DistributionOrder_PositionID", "DistributionOrder_Header_RefID", "Product_RefID", "Product_Variant_RefID", "Product_Release_RefID", "Quantity", "InternallyCharged_TotalNetPriceValue", "InternallyCharged_TotalPointValue", "Position_OrdinalNumber", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); while (reader.Read()) { ORM_ORD_DIS_DistributionOrder_Position item = new ORM_ORD_DIS_DistributionOrder_Position(); //0:Parameter ORD_DIS_DistributionOrder_PositionID of type Guid item.ORD_DIS_DistributionOrder_PositionID = reader.GetGuid(0); //1:Parameter DistributionOrder_Header_RefID of type Guid item.DistributionOrder_Header_RefID = reader.GetGuid(1); //2:Parameter Product_RefID of type Guid item.Product_RefID = reader.GetGuid(2); //3:Parameter Product_Variant_RefID of type Guid item.Product_Variant_RefID = reader.GetGuid(3); //4:Parameter Product_Release_RefID of type Guid item.Product_Release_RefID = reader.GetGuid(4); //5:Parameter Quantity of type double item.Quantity = reader.GetDouble(5); //6:Parameter InternallyCharged_TotalNetPriceValue of type Decimal item.InternallyCharged_TotalNetPriceValue = reader.GetDecimal(6); //7:Parameter InternallyCharged_TotalPointValue of type double item.InternallyCharged_TotalPointValue = reader.GetDouble(7); //8:Parameter Position_OrdinalNumber of type int item.Position_OrdinalNumber = 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); //12:Parameter Modification_Timestamp of type DateTime item.Modification_Timestamp = reader.GetDate(12); 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_L6SO_GASPbtWSvR_1413_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6SO_GASPbtWSvR_1413 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L6SO_GASPbtWSvR_1413_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL6_APOLogistic_ShippingOrder.Atomic.Retrieval.SQL.cls_Get_AllShipmentPositions_bound_to_WarehouseStructure_via_Reservations.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, "ShipmentHeaderID", Parameter.ShipmentHeaderID); List <L6SO_GASPbtWSvR_1413> results = new List <L6SO_GASPbtWSvR_1413>(); 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_SHP_Shipment_PositionID", "LOG_SHP_Shipment_Header_RefID", "CMN_PRO_Product_RefID", "CMN_PRO_ProductVariant_RefID", "CMN_PRO_ProductRelease_RefID", "TrackingInstance_ToShip_RefID", "QuantityToShip", "LOG_RSV_ReservationID", "ReservedQuantity", "IsReservationExpirable", "ReservationExpiryDate", "IsReservationExecuted", "LOG_WRH_Shelf_ContentID", "ShelfContent_Quantity_Current", "ShelfContent_Quantity_Initial", "LOG_WRH_ShelfID", "Shelf_CoordinateCode", "Shelf_CoordinateX", "Shelf_CoordinateY", "Shelf_CoordinateZ", "Shelf_Name", "LOG_WRH_RackID", "Rack_CoordinateCode", "Rack_Shelves_XLabel", "Rack_Shelves_YLabel", "Rack_Shelves_ZLabel", "Rack_Name", "Rack_Shelf_NamePrefix", "LOG_WRH_AreaID", "Area_CoordinateCode", "Area_Name", "Area_Rack_NamePrefix", "LOG_WRH_WarehouseID", "Warehouse_CoordinateCode", "Warehouse_Name", "LOG_ProductTrackingInstanceID", "SerialNumber", "BatchNumber", "ExpirationDate", "ReservedQuantityFromTrackingInstance" }); while (reader.Read()) { L6SO_GASPbtWSvR_1413 resultItem = new L6SO_GASPbtWSvR_1413(); //0:Parameter LOG_SHP_Shipment_PositionID of type Guid resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(0); //1:Parameter LOG_SHP_Shipment_Header_RefID of type Guid resultItem.LOG_SHP_Shipment_Header_RefID = reader.GetGuid(1); //2:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(2); //3:Parameter CMN_PRO_ProductVariant_RefID of type Guid resultItem.CMN_PRO_ProductVariant_RefID = reader.GetGuid(3); //4:Parameter CMN_PRO_ProductRelease_RefID of type Guid resultItem.CMN_PRO_ProductRelease_RefID = reader.GetGuid(4); //5:Parameter TrackingInstance_ToShip_RefID of type Guid resultItem.TrackingInstance_ToShip_RefID = reader.GetGuid(5); //6:Parameter QuantityToShip of type double resultItem.QuantityToShip = reader.GetDouble(6); //7:Parameter LOG_RSV_ReservationID of type Guid resultItem.LOG_RSV_ReservationID = reader.GetGuid(7); //8:Parameter ReservedQuantity of type double resultItem.ReservedQuantity = reader.GetDouble(8); //9:Parameter IsReservationExpirable of type Boolean resultItem.IsReservationExpirable = reader.GetBoolean(9); //10:Parameter ReservationExpiryDate of type DateTime resultItem.ReservationExpiryDate = reader.GetDate(10); //11:Parameter IsReservationExecuted of type Boolean resultItem.IsReservationExecuted = reader.GetBoolean(11); //12:Parameter LOG_WRH_Shelf_ContentID of type Guid resultItem.LOG_WRH_Shelf_ContentID = reader.GetGuid(12); //13:Parameter ShelfContent_Quantity_Current of type double resultItem.ShelfContent_Quantity_Current = reader.GetDouble(13); //14:Parameter ShelfContent_Quantity_Initial of type double resultItem.ShelfContent_Quantity_Initial = reader.GetDouble(14); //15:Parameter LOG_WRH_ShelfID of type Guid resultItem.LOG_WRH_ShelfID = reader.GetGuid(15); //16:Parameter Shelf_CoordinateCode of type String resultItem.Shelf_CoordinateCode = reader.GetString(16); //17:Parameter Shelf_CoordinateX of type String resultItem.Shelf_CoordinateX = reader.GetString(17); //18:Parameter Shelf_CoordinateY of type String resultItem.Shelf_CoordinateY = reader.GetString(18); //19:Parameter Shelf_CoordinateZ of type String resultItem.Shelf_CoordinateZ = reader.GetString(19); //20:Parameter Shelf_Name of type String resultItem.Shelf_Name = reader.GetString(20); //21:Parameter LOG_WRH_RackID of type Guid resultItem.LOG_WRH_RackID = reader.GetGuid(21); //22:Parameter Rack_CoordinateCode of type String resultItem.Rack_CoordinateCode = reader.GetString(22); //23:Parameter Rack_Shelves_XLabel of type String resultItem.Rack_Shelves_XLabel = reader.GetString(23); //24:Parameter Rack_Shelves_YLabel of type String resultItem.Rack_Shelves_YLabel = reader.GetString(24); //25:Parameter Rack_Shelves_ZLabel of type String resultItem.Rack_Shelves_ZLabel = reader.GetString(25); //26:Parameter Rack_Name of type String resultItem.Rack_Name = reader.GetString(26); //27:Parameter Rack_Shelf_NamePrefix of type String resultItem.Rack_Shelf_NamePrefix = reader.GetString(27); //28:Parameter LOG_WRH_AreaID of type Guid resultItem.LOG_WRH_AreaID = reader.GetGuid(28); //29:Parameter Area_CoordinateCode of type String resultItem.Area_CoordinateCode = reader.GetString(29); //30:Parameter Area_Name of type String resultItem.Area_Name = reader.GetString(30); //31:Parameter Area_Rack_NamePrefix of type String resultItem.Area_Rack_NamePrefix = reader.GetString(31); //32:Parameter LOG_WRH_WarehouseID of type Guid resultItem.LOG_WRH_WarehouseID = reader.GetGuid(32); //33:Parameter Warehouse_CoordinateCode of type String resultItem.Warehouse_CoordinateCode = reader.GetString(33); //34:Parameter Warehouse_Name of type String resultItem.Warehouse_Name = reader.GetString(34); //35:Parameter LOG_ProductTrackingInstanceID of type Guid resultItem.LOG_ProductTrackingInstanceID = reader.GetGuid(35); //36:Parameter SerialNumber of type String resultItem.SerialNumber = reader.GetString(36); //37:Parameter BatchNumber of type String resultItem.BatchNumber = reader.GetString(37); //38:Parameter ExpirationDate of type DateTime resultItem.ExpirationDate = reader.GetDate(38); //39:Parameter ReservedQuantityFromTrackingInstance of type float resultItem.ReservedQuantityFromTrackingInstance = (float)reader.GetDouble(39); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AllShipmentPositions_bound_to_WarehouseStructure_via_Reservations", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_TMS_PRO_Comment_Mention> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_TMS_PRO_Comment_Mention> 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_TMS_PRO_Comment_Mention>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "TMS_PRO_Comment_MentionID", "Comment_RefID", "IsMentionFor_Account", "IsMentionFor_BusinessTask", "IsMentionFor_Feature", "IsMentionFor_DeveloperTask", "Mention_Account_RefID", "Mention_BusinessTask_RefID", "Mention_Feature_RefID", "Mention_DeveloperTask_RefID", "CommentMention_Position", "R_CommentMention_Text", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" }); while (reader.Read()) { ORM_TMS_PRO_Comment_Mention item = new ORM_TMS_PRO_Comment_Mention(); //0:Parameter TMS_PRO_Comment_MentionID of type Guid item.TMS_PRO_Comment_MentionID = reader.GetGuid(0); //1:Parameter Comment_RefID of type Guid item.Comment_RefID = reader.GetGuid(1); //2:Parameter IsMentionFor_Account of type Boolean item.IsMentionFor_Account = reader.GetBoolean(2); //3:Parameter IsMentionFor_BusinessTask of type Boolean item.IsMentionFor_BusinessTask = reader.GetBoolean(3); //4:Parameter IsMentionFor_Feature of type Boolean item.IsMentionFor_Feature = reader.GetBoolean(4); //5:Parameter IsMentionFor_DeveloperTask of type Boolean item.IsMentionFor_DeveloperTask = reader.GetBoolean(5); //6:Parameter Mention_Account_RefID of type Guid item.Mention_Account_RefID = reader.GetGuid(6); //7:Parameter Mention_BusinessTask_RefID of type Guid item.Mention_BusinessTask_RefID = reader.GetGuid(7); //8:Parameter Mention_Feature_RefID of type Guid item.Mention_Feature_RefID = reader.GetGuid(8); //9:Parameter Mention_DeveloperTask_RefID of type Guid item.Mention_DeveloperTask_RefID = reader.GetGuid(9); //10:Parameter CommentMention_Position of type int item.CommentMention_Position = reader.GetInteger(10); //11:Parameter R_CommentMention_Text of type String item.R_CommentMention_Text = reader.GetString(11); //12:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(12); //13:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(13); //14:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(14); 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_HEC_MedicalPractis> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_HEC_MedicalPractis> 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_MedicalPractis>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "HEC_MedicalPractiseID", "WeeklyOfficeHours_Template_RefID", "Ext_CompanyInfo_RefID", "AssociatedWith_PhysitianAssociation_RefID", "ContactPerson_RefID", "WeeklySurgeryHours_Template_RefID", "Contact_EmergencyPhoneNumber", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "IsHospital", "Modification_Timestamp" }); while (reader.Read()) { ORM_HEC_MedicalPractis item = new ORM_HEC_MedicalPractis(); //0:Parameter HEC_MedicalPractiseID of type Guid item.HEC_MedicalPractiseID = reader.GetGuid(0); //1:Parameter WeeklyOfficeHours_Template_RefID of type Guid item.WeeklyOfficeHours_Template_RefID = reader.GetGuid(1); //2:Parameter Ext_CompanyInfo_RefID of type Guid item.Ext_CompanyInfo_RefID = reader.GetGuid(2); //3:Parameter AssociatedWith_PhysitianAssociation_RefID of type Guid item.AssociatedWith_PhysitianAssociation_RefID = reader.GetGuid(3); //4:Parameter ContactPerson_RefID of type Guid item.ContactPerson_RefID = reader.GetGuid(4); //5:Parameter WeeklySurgeryHours_Template_RefID of type Guid item.WeeklySurgeryHours_Template_RefID = reader.GetGuid(5); //6:Parameter Contact_EmergencyPhoneNumber of type String item.Contact_EmergencyPhoneNumber = reader.GetString(6); //7:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(7); //8:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(8); //9:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(9); //10:Parameter IsHospital of type Boolean item.IsHospital = reader.GetBoolean(10); //11:Parameter Modification_Timestamp of type DateTime item.Modification_Timestamp = reader.GetDate(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 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_PRO.CMN_PRO_Product_Supplier.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_PRO_Product_SupplierID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_PRO_Product_SupplierID", 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_PRO_Product_SupplierID", "CMN_PRO_Product_RefID", "CMN_PRO_Product_Variant_RefID", "CMN_PRO_Product_Release_RefID", "CMN_BPT_Supplier_RefID", "SupplierPriority", "MinimalPackageOrderingAmount", "BatchOrderSize", "ProcurementPrice_RefID", "RecommendedRetailPrice_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter CMN_PRO_Product_SupplierID of type Guid _CMN_PRO_Product_SupplierID = reader.GetGuid(0); //1:Parameter CMN_PRO_Product_RefID of type Guid _CMN_PRO_Product_RefID = reader.GetGuid(1); //2:Parameter CMN_PRO_Product_Variant_RefID of type Guid _CMN_PRO_Product_Variant_RefID = reader.GetGuid(2); //3:Parameter CMN_PRO_Product_Release_RefID of type Guid _CMN_PRO_Product_Release_RefID = reader.GetGuid(3); //4:Parameter CMN_BPT_Supplier_RefID of type Guid _CMN_BPT_Supplier_RefID = reader.GetGuid(4); //5:Parameter SupplierPriority of type int _SupplierPriority = reader.GetInteger(5); //6:Parameter MinimalPackageOrderingAmount of type double _MinimalPackageOrderingAmount = reader.GetDouble(6); //7:Parameter BatchOrderSize of type int _BatchOrderSize = reader.GetInteger(7); //8:Parameter ProcurementPrice_RefID of type Guid _ProcurementPrice_RefID = reader.GetGuid(8); //9:Parameter RecommendedRetailPrice_RefID of type Guid _RecommendedRetailPrice_RefID = reader.GetGuid(9); //10:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(10); //11:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(11); //12:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(12); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_CMN_PRO_Product_SupplierID != 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); }
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_BPT_EMP.CMN_BPT_EMP_EffectiveWorkTime_PositionHistory.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_BPT_EMP_EffectiveWorkTime_PositionHistoryID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID", 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_BPT_EMP_EffectiveWorkTime_PositionHistoryID", "EffectiveWorkTime_Header_RefID", "EffectiveWorkTime_Position_RefID", "TriggeredAt_Date", "TriggeredBy_BusinessParticipant_RefID", "TriggeredBy_SourceOfEntry", "Comment", "Activity_RefID", "Workplace_RefID", "CMN_BPT_EMP_Employee_LeaveRequest_RefID", "WorkTime_StartTime", "WorkTime_Duration_in_sec", "SourceOfEntry", "IsCreated", "IsModified", "IsDeleted", "Creation_Timestamp", "Tenant_RefID", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID of type Guid _CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID = reader.GetGuid(0); //1:Parameter EffectiveWorkTime_Header_RefID of type Guid _EffectiveWorkTime_Header_RefID = reader.GetGuid(1); //2:Parameter EffectiveWorkTime_Position_RefID of type Guid _EffectiveWorkTime_Position_RefID = reader.GetGuid(2); //3:Parameter TriggeredAt_Date of type DateTime _TriggeredAt_Date = reader.GetDate(3); //4:Parameter TriggeredBy_BusinessParticipant_RefID of type Guid _TriggeredBy_BusinessParticipant_RefID = reader.GetGuid(4); //5:Parameter TriggeredBy_SourceOfEntry of type int _TriggeredBy_SourceOfEntry = reader.GetInteger(5); //6:Parameter Comment of type String _Comment = reader.GetString(6); //7:Parameter Activity_RefID of type Guid _Activity_RefID = reader.GetGuid(7); //8:Parameter Workplace_RefID of type Guid _Workplace_RefID = reader.GetGuid(8); //9:Parameter CMN_BPT_EMP_Employee_LeaveRequest_RefID of type Guid _CMN_BPT_EMP_Employee_LeaveRequest_RefID = reader.GetGuid(9); //10:Parameter WorkTime_StartTime of type DateTime _WorkTime_StartTime = reader.GetDate(10); //11:Parameter WorkTime_Duration_in_sec of type int _WorkTime_Duration_in_sec = reader.GetInteger(11); //12:Parameter SourceOfEntry of type int _SourceOfEntry = reader.GetInteger(12); //13:Parameter IsCreated of type Boolean _IsCreated = reader.GetBoolean(13); //14:Parameter IsModified of type Boolean _IsModified = reader.GetBoolean(14); //15:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(15); //16:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(16); //17:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(17); //18:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(18); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_CMN_BPT_EMP_EffectiveWorkTime_PositionHistoryID != 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); }
private static List <ORM_CMN_PRO_Product_Supplier> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_CMN_PRO_Product_Supplier> 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_PRO_Product_Supplier>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "CMN_PRO_Product_SupplierID", "CMN_PRO_Product_RefID", "CMN_PRO_Product_Variant_RefID", "CMN_PRO_Product_Release_RefID", "CMN_BPT_Supplier_RefID", "SupplierPriority", "MinimalPackageOrderingAmount", "BatchOrderSize", "ProcurementPrice_RefID", "RecommendedRetailPrice_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { ORM_CMN_PRO_Product_Supplier item = new ORM_CMN_PRO_Product_Supplier(); //0:Parameter CMN_PRO_Product_SupplierID of type Guid item.CMN_PRO_Product_SupplierID = reader.GetGuid(0); //1:Parameter CMN_PRO_Product_RefID of type Guid item.CMN_PRO_Product_RefID = reader.GetGuid(1); //2:Parameter CMN_PRO_Product_Variant_RefID of type Guid item.CMN_PRO_Product_Variant_RefID = reader.GetGuid(2); //3:Parameter CMN_PRO_Product_Release_RefID of type Guid item.CMN_PRO_Product_Release_RefID = reader.GetGuid(3); //4:Parameter CMN_BPT_Supplier_RefID of type Guid item.CMN_BPT_Supplier_RefID = reader.GetGuid(4); //5:Parameter SupplierPriority of type int item.SupplierPriority = reader.GetInteger(5); //6:Parameter MinimalPackageOrderingAmount of type double item.MinimalPackageOrderingAmount = reader.GetDouble(6); //7:Parameter BatchOrderSize of type int item.BatchOrderSize = reader.GetInteger(7); //8:Parameter ProcurementPrice_RefID of type Guid item.ProcurementPrice_RefID = reader.GetGuid(8); //9:Parameter RecommendedRetailPrice_RefID of type Guid item.RecommendedRetailPrice_RefID = reader.GetGuid(9); //10:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(10); //11:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(11); //12:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(12); 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_L5PP_GSHDaCOwPfS_1125_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5PP_GSHDaCOwPfS_1125 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PP_GSHDaCOwPfS_1125_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_PickingPreparation.Atomic.Retrieval.SQL.cls_Get_ShippmentHeaderDetails_and_CustomerOrder_with_Positions_for_ShipmentID.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, "ShipmentHeaderID", Parameter.ShipmentHeaderID); List <L5PP_GSHDaCOwPfS_1125> results = new List <L5PP_GSHDaCOwPfS_1125>(); 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_SHP_Shipment_HeaderID", "ShipmentHeader_Number", "LOG_SHP_Shipment_PositionID", "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Number", "CMN_PRO_Product_VariantID", "VariantName_DictID", "IsShippingAddress", "IsBillingAddress", "IsSpecialAddress", "IsDefault", "CMN_AddressID", "Street_Name", "Street_Number", "City_Name", "City_PostalCode", "Country_Name", "Country_ISOCode", "ShipmentCreationDate", "Position_Quantity", "ORD_CUO_CustomerOrder_PositionID", "ORD_CUO_CustomerOrder_HeaderID", "CustomerOrder_Number", "CustomerOrder_Date", "DisplayName" }); while (reader.Read()) { L5PP_GSHDaCOwPfS_1125 resultItem = new L5PP_GSHDaCOwPfS_1125(); //0:Parameter LOG_SHP_Shipment_HeaderID of type Guid resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(0); //1:Parameter ShipmentHeader_Number of type String resultItem.ShipmentHeader_Number = reader.GetString(1); //2:Parameter LOG_SHP_Shipment_PositionID of type Guid resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(2); //3:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(3); //4:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(4); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //5:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(5); //6:Parameter CMN_PRO_Product_VariantID of type Guid resultItem.CMN_PRO_Product_VariantID = reader.GetGuid(6); //7:Parameter VariantName of type Dict resultItem.VariantName = reader.GetDictionary(7); resultItem.VariantName.SourceTable = "cmn_pro_product_variants"; loader.Append(resultItem.VariantName); //8:Parameter IsShippingAddress of type bool resultItem.IsShippingAddress = reader.GetBoolean(8); //9:Parameter IsBillingAddress of type bool resultItem.IsBillingAddress = reader.GetBoolean(9); //10:Parameter IsSpecialAddress of type bool resultItem.IsSpecialAddress = reader.GetBoolean(10); //11:Parameter IsDefault of type bool resultItem.IsDefault = reader.GetBoolean(11); //12:Parameter CMN_AddressID of type Guid resultItem.CMN_AddressID = reader.GetGuid(12); //13:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(13); //14:Parameter Street_Number of type String resultItem.Street_Number = reader.GetString(14); //15:Parameter City_Name of type String resultItem.City_Name = reader.GetString(15); //16:Parameter City_PostalCode of type String resultItem.City_PostalCode = reader.GetString(16); //17:Parameter Country_Name of type String resultItem.Country_Name = reader.GetString(17); //18:Parameter Country_ISOCode of type String resultItem.Country_ISOCode = reader.GetString(18); //19:Parameter ShipmentCreationDate of type DateTime resultItem.ShipmentCreationDate = reader.GetDate(19); //20:Parameter Position_Quantity of type String resultItem.Position_Quantity = reader.GetString(20); //21:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid resultItem.ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(21); //22:Parameter ORD_CUO_CustomerOrder_HeaderID of type Guid resultItem.ORD_CUO_CustomerOrder_HeaderID = reader.GetGuid(22); //23:Parameter CustomerOrder_Number of type String resultItem.CustomerOrder_Number = reader.GetString(23); //24:Parameter CustomerOrder_Date of type DateTime resultItem.CustomerOrder_Date = reader.GetDate(24); //25:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(25); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_ShippmentHeaderDetails_and_CustomerOrder_with_Positions_for_ShipmentID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L3_AHbAC_1534_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_AHbAC_1534 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3_AHbAC_1534_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_MeasuringPoints.Atomic.Retrieval.SQL.cls_AdressHistory_by_AccountCode.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, "AccountCode", Parameter.AccountCode); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DownloadCode", Parameter.DownloadCode); List <L3_AHbAC_1534> results = new List <L3_AHbAC_1534>(); 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[] { "MRS_MPT_AddressHistoryID", "MeasuringPoint_RefID", "Address_RefID", "ActiveFrom", "ActiveThrough", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { L3_AHbAC_1534 resultItem = new L3_AHbAC_1534(); //0:Parameter MRS_MPT_AddressHistoryID of type Guid resultItem.MRS_MPT_AddressHistoryID = reader.GetGuid(0); //1:Parameter MeasuringPoint_RefID of type Guid resultItem.MeasuringPoint_RefID = reader.GetGuid(1); //2:Parameter Address_RefID of type Guid resultItem.Address_RefID = reader.GetGuid(2); //3:Parameter ActiveFrom of type String resultItem.ActiveFrom = reader.GetString(3); //4:Parameter ActiveThrough of type String resultItem.ActiveThrough = reader.GetString(4); //5:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(5); //6:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(6); //7:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_AdressHistory_by_AccountCode", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
private static List <ORM_USR_Device_ActivityHistory> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_USR_Device_ActivityHistory> 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_USR_Device_ActivityHistory>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "USR_Device_ActivityHistoryID", "Device_RefID", "Performing_Account_RefID", "DateOfActivity", "WasDevice_Configured", "WasDevice_Configured_WithConfigurationCode_RefID", "WasDevice_RequestingDSC", "WasBanned", "WasUnbanned", "WasCreatedSession", "WasOtherRelevantActivity", "ActivityComment", "AccountComment", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); while (reader.Read()) { ORM_USR_Device_ActivityHistory item = new ORM_USR_Device_ActivityHistory(); //0:Parameter USR_Device_ActivityHistoryID of type Guid item.USR_Device_ActivityHistoryID = reader.GetGuid(0); //1:Parameter Device_RefID of type Guid item.Device_RefID = reader.GetGuid(1); //2:Parameter Performing_Account_RefID of type Guid item.Performing_Account_RefID = reader.GetGuid(2); //3:Parameter DateOfActivity of type DateTime item.DateOfActivity = reader.GetDate(3); //4:Parameter WasDevice_Configured of type Boolean item.WasDevice_Configured = reader.GetBoolean(4); //5:Parameter WasDevice_Configured_WithConfigurationCode_RefID of type Guid item.WasDevice_Configured_WithConfigurationCode_RefID = reader.GetGuid(5); //6:Parameter WasDevice_RequestingDSC of type Boolean item.WasDevice_RequestingDSC = reader.GetBoolean(6); //7:Parameter WasBanned of type Boolean item.WasBanned = reader.GetBoolean(7); //8:Parameter WasUnbanned of type Boolean item.WasUnbanned = reader.GetBoolean(8); //9:Parameter WasCreatedSession of type Boolean item.WasCreatedSession = reader.GetBoolean(9); //10:Parameter WasOtherRelevantActivity of type Boolean item.WasOtherRelevantActivity = reader.GetBoolean(10); //11:Parameter ActivityComment of type String item.ActivityComment = reader.GetString(11); //12:Parameter AccountComment of type String item.AccountComment = reader.GetString(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); }
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_BIL.BIL_BillHeader.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 _BIL_BillHeaderID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BIL_BillHeaderID", 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[] { "BIL_BillHeaderID", "BillRecipient_BuisnessParticipant_RefID", "CreatedBy_BusinessParticipant_RefID", "Currency_RefID", "BillNumber", "DateOnBill", "TotalValue_BeforeTax", "TotalValue_IncludingTax", "SourceEconomicRegion_RefID", "TargetEconomicRegion_RefID", "BillingAddress_UCD_RefID", "BillHeader_PaymentCondition_RefID", "BillComment", "IsFullyPaid", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter BIL_BillHeaderID of type Guid _BIL_BillHeaderID = reader.GetGuid(0); //1:Parameter BillRecipient_BuisnessParticipant_RefID of type Guid _BillRecipient_BuisnessParticipant_RefID = reader.GetGuid(1); //2:Parameter CreatedBy_BusinessParticipant_RefID of type Guid _CreatedBy_BusinessParticipant_RefID = reader.GetGuid(2); //3:Parameter Currency_RefID of type Guid _Currency_RefID = reader.GetGuid(3); //4:Parameter BillNumber of type String _BillNumber = reader.GetString(4); //5:Parameter DateOnBill of type DateTime _DateOnBill = reader.GetDate(5); //6:Parameter TotalValue_BeforeTax of type Decimal _TotalValue_BeforeTax = reader.GetDecimal(6); //7:Parameter TotalValue_IncludingTax of type Decimal _TotalValue_IncludingTax = reader.GetDecimal(7); //8:Parameter SourceEconomicRegion_RefID of type Guid _SourceEconomicRegion_RefID = reader.GetGuid(8); //9:Parameter TargetEconomicRegion_RefID of type Guid _TargetEconomicRegion_RefID = reader.GetGuid(9); //10:Parameter BillingAddress_UCD_RefID of type Guid _BillingAddress_UCD_RefID = reader.GetGuid(10); //11:Parameter BillHeader_PaymentCondition_RefID of type Guid _BillHeader_PaymentCondition_RefID = reader.GetGuid(11); //12:Parameter BillComment of type String _BillComment = reader.GetString(12); //13:Parameter IsFullyPaid of type Boolean _IsFullyPaid = reader.GetBoolean(13); //14:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(14); //15:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(15); //16:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(16); //17:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(17); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_BIL_BillHeaderID != 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); }
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_BPT_EMP.CMN_BPT_EMP_ExtraWorkCalculation_Surcharges_Detail.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_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID", 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_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID", "ExtraWorkCalculation_Surcharge_RefID", "TimeFrom_in_mins", "TimeTo_in_mins", "Surcharge_Standard_PercentValue", "Surcharge_StartedBeforeMidnight_PercentValue", "BoundTo_StructureCalendarEvent_Type_RefID", "BoundTo_StructureCalendarEvent_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter CMN_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID of type Guid _CMN_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID = reader.GetGuid(0); //1:Parameter ExtraWorkCalculation_Surcharge_RefID of type Guid _ExtraWorkCalculation_Surcharge_RefID = reader.GetGuid(1); //2:Parameter TimeFrom_in_mins of type int _TimeFrom_in_mins = reader.GetInteger(2); //3:Parameter TimeTo_in_mins of type int _TimeTo_in_mins = reader.GetInteger(3); //4:Parameter Surcharge_Standard_PercentValue of type Decimal _Surcharge_Standard_PercentValue = reader.GetDecimal(4); //5:Parameter Surcharge_StartedBeforeMidnight_PercentValue of type Decimal _Surcharge_StartedBeforeMidnight_PercentValue = reader.GetDecimal(5); //6:Parameter BoundTo_StructureCalendarEvent_Type_RefID of type Guid _BoundTo_StructureCalendarEvent_Type_RefID = reader.GetGuid(6); //7:Parameter BoundTo_StructureCalendarEvent_RefID of type Guid _BoundTo_StructureCalendarEvent_RefID = reader.GetGuid(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_BPT_EMP_ExtraWorkCalculation_Surcharges_DetailsID != 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); }
private static List <ORM_BIL_BillHeader> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction) { CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection(); List <ORM_BIL_BillHeader> 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_BIL_BillHeader>(); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); reader.SetOrdinals(new string[] { "BIL_BillHeaderID", "BillRecipient_BuisnessParticipant_RefID", "CreatedBy_BusinessParticipant_RefID", "Currency_RefID", "BillNumber", "DateOnBill", "TotalValue_BeforeTax", "TotalValue_IncludingTax", "SourceEconomicRegion_RefID", "TargetEconomicRegion_RefID", "BillingAddress_UCD_RefID", "BillHeader_PaymentCondition_RefID", "BillComment", "IsFullyPaid", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); while (reader.Read()) { ORM_BIL_BillHeader item = new ORM_BIL_BillHeader(); //0:Parameter BIL_BillHeaderID of type Guid item.BIL_BillHeaderID = reader.GetGuid(0); //1:Parameter BillRecipient_BuisnessParticipant_RefID of type Guid item.BillRecipient_BuisnessParticipant_RefID = reader.GetGuid(1); //2:Parameter CreatedBy_BusinessParticipant_RefID of type Guid item.CreatedBy_BusinessParticipant_RefID = reader.GetGuid(2); //3:Parameter Currency_RefID of type Guid item.Currency_RefID = reader.GetGuid(3); //4:Parameter BillNumber of type String item.BillNumber = reader.GetString(4); //5:Parameter DateOnBill of type DateTime item.DateOnBill = reader.GetDate(5); //6:Parameter TotalValue_BeforeTax of type Decimal item.TotalValue_BeforeTax = reader.GetDecimal(6); //7:Parameter TotalValue_IncludingTax of type Decimal item.TotalValue_IncludingTax = reader.GetDecimal(7); //8:Parameter SourceEconomicRegion_RefID of type Guid item.SourceEconomicRegion_RefID = reader.GetGuid(8); //9:Parameter TargetEconomicRegion_RefID of type Guid item.TargetEconomicRegion_RefID = reader.GetGuid(9); //10:Parameter BillingAddress_UCD_RefID of type Guid item.BillingAddress_UCD_RefID = reader.GetGuid(10); //11:Parameter BillHeader_PaymentCondition_RefID of type Guid item.BillHeader_PaymentCondition_RefID = reader.GetGuid(11); //12:Parameter BillComment of type String item.BillComment = reader.GetString(12); //13:Parameter IsFullyPaid of type Boolean item.IsFullyPaid = reader.GetBoolean(13); //14:Parameter Creation_Timestamp of type DateTime item.Creation_Timestamp = reader.GetDate(14); //15:Parameter Tenant_RefID of type Guid item.Tenant_RefID = reader.GetGuid(15); //16:Parameter IsDeleted of type Boolean item.IsDeleted = reader.GetBoolean(16); //17:Parameter Modification_Timestamp of type DateTime item.Modification_Timestamp = reader.GetDate(17); 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 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_MRS_RUT.MRS_RUT_RouteCycle.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 _MRS_RUT_RouteCycleID = Guid.Empty; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "MRS_RUT_RouteCycleID", 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[] { "MRS_RUT_RouteCycleID", "Route_RefID", "ValidFrom", "ValidThrough", "CronExpressions", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" }); if (reader.HasRows == true) { reader.Read(); //Single result only //0:Parameter MRS_RUT_RouteCycleID of type Guid _MRS_RUT_RouteCycleID = reader.GetGuid(0); //1:Parameter Route_RefID of type Guid _Route_RefID = reader.GetGuid(1); //2:Parameter ValidFrom of type DateTime _ValidFrom = reader.GetDate(2); //3:Parameter ValidThrough of type DateTime _ValidThrough = reader.GetDate(3); //4:Parameter CronExpressions of type String _CronExpressions = reader.GetString(4); //5:Parameter Creation_Timestamp of type DateTime _Creation_Timestamp = reader.GetDate(5); //6:Parameter Tenant_RefID of type Guid _Tenant_RefID = reader.GetGuid(6); //7:Parameter IsDeleted of type Boolean _IsDeleted = reader.GetBoolean(7); //8:Parameter Modification_Timestamp of type DateTime _Modification_Timestamp = reader.GetDate(8); } //Close the reader so other connections can use it reader.Close(); loader.Load(); if (_MRS_RUT_RouteCycleID != 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_L5TN_GSPFT_1044_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5TN_GSPFT_1044_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_VacationPlanner_Tenant.Atomic.Retrieval.SQL.cls_Get_SettingProfile_For_Tenant.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 <L5TN_GSPFT_1044> results = new List <L5TN_GSPFT_1044>(); 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_STA_SettingProfileID", "IsLeaveTimeCalculated_InDays", "StafMember_Caption_DictID", "IsLeaveTimeCalculated_InHours", "IsUsingWorkflow_ForLeaveRequests", "Default_AdulthoodAge", "Default_RestWarningThreshold_Adults_in_mins", "Default_RestWarningThreshold_NonAdults_in_mins", "Default_RestMinimumThresholdl_Adults_in_mins", "Default_RestMinimumThresholdl_NonAdults_in_mins", "Default_WorkTimeWarningTreshold_Adults_in_mins", "Default_WorkTimeWarningTreshold_NonAdults_in_mins", "Default_WorkTimeMaximumTreshold_Adults_in_mins", "Default_WorkTimeMaximumTreshold_NonAdults_in_mins", "Default_WorkStartTimeWarning_NonAdults_in_mins", "Default_WorkStartTimeMinimum_NonAdults_in_mins", "Default_WorkEndTimeWarning_NonAdults_in_mins", "Default_WorktimeBalancePeriod_in_months", "Default_WorkEndTimeMaximum_NonAdults_in_mins", "Default_WorkdayStart_in_mins", "Default_RoosterGridMinimumPlanningUnit_in_mins", "Default_MaximumPreWork_Period_in_mins", "Default_MaximumPostWork_Period_in_mins", "Default_SurchargeCalculation_UseMaximum", "Default_SurchargeCalculation_UseAccumulated" }); while (reader.Read()) { L5TN_GSPFT_1044 resultItem = new L5TN_GSPFT_1044(); //0:Parameter CMN_BPT_STA_SettingProfileID of type Guid resultItem.CMN_BPT_STA_SettingProfileID = reader.GetGuid(0); //1:Parameter IsLeaveTimeCalculated_InDays of type bool resultItem.IsLeaveTimeCalculated_InDays = reader.GetBoolean(1); //2:Parameter StafMember_Caption of type Dict resultItem.StafMember_Caption = reader.GetDictionary(2); resultItem.StafMember_Caption.SourceTable = "cmn_bpt_sta_settingprofiles"; loader.Append(resultItem.StafMember_Caption); //3:Parameter IsLeaveTimeCalculated_InHours of type bool resultItem.IsLeaveTimeCalculated_InHours = reader.GetBoolean(3); //4:Parameter IsUsingWorkflow_ForLeaveRequests of type bool resultItem.IsUsingWorkflow_ForLeaveRequests = reader.GetBoolean(4); //5:Parameter Default_AdulthoodAge of type int resultItem.Default_AdulthoodAge = reader.GetInteger(5); //6:Parameter Default_RestWarningThreshold_Adults_in_mins of type int resultItem.Default_RestWarningThreshold_Adults_in_mins = reader.GetInteger(6); //7:Parameter Default_RestWarningThreshold_NonAdults_in_mins of type int resultItem.Default_RestWarningThreshold_NonAdults_in_mins = reader.GetInteger(7); //8:Parameter Default_RestMinimumThresholdl_Adults_in_mins of type int resultItem.Default_RestMinimumThresholdl_Adults_in_mins = reader.GetInteger(8); //9:Parameter Default_RestMinimumThresholdl_NonAdults_in_mins of type int resultItem.Default_RestMinimumThresholdl_NonAdults_in_mins = reader.GetInteger(9); //10:Parameter Default_WorkTimeWarningTreshold_Adults_in_mins of type int resultItem.Default_WorkTimeWarningTreshold_Adults_in_mins = reader.GetInteger(10); //11:Parameter Default_WorkTimeWarningTreshold_NonAdults_in_mins of type int resultItem.Default_WorkTimeWarningTreshold_NonAdults_in_mins = reader.GetInteger(11); //12:Parameter Default_WorkTimeMaximumTreshold_Adults_in_mins of type int resultItem.Default_WorkTimeMaximumTreshold_Adults_in_mins = reader.GetInteger(12); //13:Parameter Default_WorkTimeMaximumTreshold_NonAdults_in_mins of type int resultItem.Default_WorkTimeMaximumTreshold_NonAdults_in_mins = reader.GetInteger(13); //14:Parameter Default_WorkStartTimeWarning_NonAdults_in_mins of type int resultItem.Default_WorkStartTimeWarning_NonAdults_in_mins = reader.GetInteger(14); //15:Parameter Default_WorkStartTimeMinimum_NonAdults_in_mins of type int resultItem.Default_WorkStartTimeMinimum_NonAdults_in_mins = reader.GetInteger(15); //16:Parameter Default_WorkEndTimeWarning_NonAdults_in_mins of type int resultItem.Default_WorkEndTimeWarning_NonAdults_in_mins = reader.GetInteger(16); //17:Parameter Default_WorktimeBalancePeriod_in_months of type int resultItem.Default_WorktimeBalancePeriod_in_months = reader.GetInteger(17); //18:Parameter Default_WorkEndTimeMaximum_NonAdults_in_mins of type int resultItem.Default_WorkEndTimeMaximum_NonAdults_in_mins = reader.GetInteger(18); //19:Parameter Default_WorkdayStart_in_mins of type int resultItem.Default_WorkdayStart_in_mins = reader.GetInteger(19); //20:Parameter Default_RoosterGridMinimumPlanningUnit_in_mins of type int resultItem.Default_RoosterGridMinimumPlanningUnit_in_mins = reader.GetInteger(20); //21:Parameter Default_MaximumPreWork_Period_in_mins of type int resultItem.Default_MaximumPreWork_Period_in_mins = reader.GetInteger(21); //22:Parameter Default_MaximumPostWork_Period_in_mins of type int resultItem.Default_MaximumPostWork_Period_in_mins = reader.GetInteger(22); //23:Parameter Default_SurchargeCalculation_UseMaximum of type bool resultItem.Default_SurchargeCalculation_UseMaximum = reader.GetBoolean(23); //24:Parameter Default_SurchargeCalculation_UseAccumulated of type bool resultItem.Default_SurchargeCalculation_UseAccumulated = reader.GetBoolean(24); 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); }