private TransactionType DataPortal_Fetch(TransactionTypeCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_TransactionType_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <TransactionType>(); if (reader.Read()) { return(GetTransactionType(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.TransactionType' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
//[Transactional(TransactionalTypes.TransactionScope)] protected void DataPortal_Delete(TransactionTypeCriteria criteria) { bool cancel = false; OnDeleting(criteria, ref cancel); if (cancel) { return; } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_TransactionType_Delete]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); //result: The number of rows changed, inserted, or deleted. -1 for select statements; 0 if no rows were affected, or the statement failed. int result = command.ExecuteNonQuery(); if (result == 0) { throw new DBConcurrencyException("The entity is out of date on the client. Please update the entity and try again. This could also be thrown if the sql statement failed to execute."); } } } OnDeleted(); }
private BankTransactionList DataPortal_Fetch(BankTransactionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BankTransaction_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_BankAccountIDHasValue", criteria.BankAccountIDHasValue); command.Parameters.AddWithValue("@p_NarrativeHasValue", criteria.NarrativeHasValue); command.Parameters.AddWithValue("@p_SerialNumberHasValue", criteria.SerialNumberHasValue); command.Parameters.AddWithValue("@p_SegmentAccountNumberHasValue", criteria.SegmentAccountNumberHasValue); command.Parameters.AddWithValue("@p_PaymentTransactionIDHasValue", criteria.PaymentTransactionIDHasValue); command.Parameters.AddWithValue("@p_InstructionIDHasValue", criteria.InstructionIDHasValue); command.Parameters.AddWithValue("@p_ValueDateHasValue", criteria.ValueDateHasValue); command.Parameters.AddWithValue("@p_TransactionDateTimeUTCHasValue", criteria.TransactionDateTimeUTCHasValue); command.Parameters.AddWithValue("@p_DebtorNameHasValue", criteria.DebtorNameHasValue); command.Parameters.AddWithValue("@p_CreditorNameHasValue", criteria.CreditorNameHasValue); command.Parameters.AddWithValue("@p_EndToEndIDHasValue", criteria.EndToEndIDHasValue); command.Parameters.AddWithValue("@p_RemittanceInformation1HasValue", criteria.RemittanceInformation1HasValue); command.Parameters.AddWithValue("@p_RemittanceInfoformation2HasValue", criteria.RemittanceInfoformation2HasValue); command.Parameters.AddWithValue("@p_PayiDTypeHasValue", criteria.PayiDTypeHasValue); command.Parameters.AddWithValue("@p_PayIDHasValue", criteria.PayIDHasValue); command.Parameters.AddWithValue("@p_ReversalreasonCodeHasValue", criteria.ReversalreasonCodeHasValue); command.Parameters.AddWithValue("@p_OriginalTransactionIDHasValue", criteria.OriginalTransactionIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.BankTransaction>(); do { this.Add(CFMData.BankTransaction.GetBankTransaction(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private ApplicationUserList DataPortal_Fetch(ApplicationUserCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_ApplicationUser_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_LastNameHasValue", criteria.LastNameHasValue); command.Parameters.AddWithValue("@p_EmailAddressHasValue", criteria.EmailAddressHasValue); command.Parameters.AddWithValue("@p_MobilePhoneHasValue", criteria.MobilePhoneHasValue); command.Parameters.AddWithValue("@p_WorkPhoneHasValue", criteria.WorkPhoneHasValue); command.Parameters.AddWithValue("@p_EmployeeNumberHasValue", criteria.EmployeeNumberHasValue); command.Parameters.AddWithValue("@p_PasswordResetTokenHasValue", criteria.PasswordResetTokenHasValue); command.Parameters.AddWithValue("@p_PasswordResetTokenExpiryHasValue", criteria.PasswordResetTokenExpiryHasValue); command.Parameters.AddWithValue("@p_ApplicationRoleIDHasValue", criteria.ApplicationRoleIDHasValue); command.Parameters.AddWithValue("@p_LastLoggedOnHasValue", criteria.LastLoggedOnHasValue); command.Parameters.AddWithValue("@p_StatementDeliveryOptionIDHasValue", criteria.StatementDeliveryOptionIDHasValue); command.Parameters.AddWithValue("@p_PhysicalAddressIDHasValue", criteria.PhysicalAddressIDHasValue); command.Parameters.AddWithValue("@p_PostalAddressIDHasValue", criteria.PostalAddressIDHasValue); command.Parameters.AddWithValue("@p_LastActiveCheckSentOnHasValue", criteria.LastActiveCheckSentOnHasValue); command.Parameters.AddWithValue("@p_CreatedByHasValue", criteria.CreatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); command.Parameters.AddWithValue("@p_LastPasswordChangedOnHasValue", criteria.LastPasswordChangedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.ApplicationUser>(); do { this.Add(CFMData.ApplicationUser.GetApplicationUser(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private BankTransaction DataPortal_Fetch(BankTransactionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BankTransaction_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_BankAccountIDHasValue", criteria.BankAccountIDHasValue); command.Parameters.AddWithValue("@p_NarrativeHasValue", criteria.NarrativeHasValue); command.Parameters.AddWithValue("@p_SerialNumberHasValue", criteria.SerialNumberHasValue); command.Parameters.AddWithValue("@p_SegmentAccountNumberHasValue", criteria.SegmentAccountNumberHasValue); command.Parameters.AddWithValue("@p_PaymentTransactionIDHasValue", criteria.PaymentTransactionIDHasValue); command.Parameters.AddWithValue("@p_InstructionIDHasValue", criteria.InstructionIDHasValue); command.Parameters.AddWithValue("@p_ValueDateHasValue", criteria.ValueDateHasValue); command.Parameters.AddWithValue("@p_TransactionDateTimeUTCHasValue", criteria.TransactionDateTimeUTCHasValue); command.Parameters.AddWithValue("@p_DebtorNameHasValue", criteria.DebtorNameHasValue); command.Parameters.AddWithValue("@p_CreditorNameHasValue", criteria.CreditorNameHasValue); command.Parameters.AddWithValue("@p_EndToEndIDHasValue", criteria.EndToEndIDHasValue); command.Parameters.AddWithValue("@p_RemittanceInformation1HasValue", criteria.RemittanceInformation1HasValue); command.Parameters.AddWithValue("@p_RemittanceInfoformation2HasValue", criteria.RemittanceInfoformation2HasValue); command.Parameters.AddWithValue("@p_PayiDTypeHasValue", criteria.PayiDTypeHasValue); command.Parameters.AddWithValue("@p_PayIDHasValue", criteria.PayIDHasValue); command.Parameters.AddWithValue("@p_ReversalreasonCodeHasValue", criteria.ReversalreasonCodeHasValue); command.Parameters.AddWithValue("@p_OriginalTransactionIDHasValue", criteria.OriginalTransactionIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <BankTransaction>(); if (reader.Read()) { return(GetBankTransaction(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.BankTransaction' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private GlList DataPortal_Fetch(GlCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_Gl_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_PostingDateHasValue", criteria.PostingDateHasValue); command.Parameters.AddWithValue("@p_GLCostCentreEntityIDHasValue", criteria.GLCostCentreEntityIDHasValue); command.Parameters.AddWithValue("@p_BankTransactionIDHasValue", criteria.BankTransactionIDHasValue); command.Parameters.AddWithValue("@p_CategoryIDHasValue", criteria.CategoryIDHasValue); command.Parameters.AddWithValue("@p_ExGstAMountHasValue", criteria.ExGstAMountHasValue); command.Parameters.AddWithValue("@p_GSTAmountHasValue", criteria.GSTAmountHasValue); command.Parameters.AddWithValue("@p_DRAmountHasValue", criteria.DRAmountHasValue); command.Parameters.AddWithValue("@p_CRAmountHasValue", criteria.CRAmountHasValue); command.Parameters.AddWithValue("@p_HouseBudgetIDHasValue", criteria.HouseBudgetIDHasValue); command.Parameters.AddWithValue("@p_ClientBudgetIDHasValue", criteria.ClientBudgetIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.Gl>(); do { this.Add(CFMData.Gl.GetGl(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private ApplicationPermissionList DataPortal_Fetch(ApplicationPermissionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_ApplicationPermission_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_ApplicationRoleIDHasValue", criteria.ApplicationRoleIDHasValue); command.Parameters.AddWithValue("@p_ApplicationUserIDHasValue", criteria.ApplicationUserIDHasValue); command.Parameters.AddWithValue("@p_BusinessAreaIDHasValue", criteria.BusinessAreaIDHasValue); command.Parameters.AddWithValue("@p_BusinessDivisionIDHasValue", criteria.BusinessDivisionIDHasValue); command.Parameters.AddWithValue("@p_BusinessEntityIDHasValue", criteria.BusinessEntityIDHasValue); command.Parameters.AddWithValue("@p_HomeIDHasValue", criteria.HomeIDHasValue); command.Parameters.AddWithValue("@p_ClientIDHasValue", criteria.ClientIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.ApplicationPermission>(); do { this.Add(CFMData.ApplicationPermission.GetApplicationPermission(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private BSBDetailList DataPortal_Fetch(BSBDetailCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BSBDetail_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_BSBHasValue", criteria.BsbHasValue); command.Parameters.AddWithValue("@p_BankCodeHasValue", criteria.BankCodeHasValue); command.Parameters.AddWithValue("@p_BSBNameHasValue", criteria.BSBNameHasValue); command.Parameters.AddWithValue("@p_AddressHasValue", criteria.AddressHasValue); command.Parameters.AddWithValue("@p_SuburbHasValue", criteria.SuburbHasValue); command.Parameters.AddWithValue("@p_StateHasValue", criteria.StateHasValue); command.Parameters.AddWithValue("@p_PostCodeHasValue", criteria.PostCodeHasValue); command.Parameters.AddWithValue("@p_PaymentSystemsHasValue", criteria.PaymentSystemsHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.BSBDetail>(); do { this.Add(CFMData.BSBDetail.GetBSBDetail(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private EmailQueueList DataPortal_Fetch(EmailQueueCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_EmailQueue_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_MailingTemplateIDHasValue", criteria.MailingTemplateIDHasValue); command.Parameters.AddWithValue("@p_SendToHasValue", criteria.SendToHasValue); command.Parameters.AddWithValue("@p_MailingTextHasValue", criteria.MailingTextHasValue); command.Parameters.AddWithValue("@p_MailingSubjectHasValue", criteria.MailingSubjectHasValue); command.Parameters.AddWithValue("@p_MailingFromHasValue", criteria.MailingFromHasValue); command.Parameters.AddWithValue("@p_ProcessedDateHasValue", criteria.ProcessedDateHasValue); command.Parameters.AddWithValue("@p_ProcessResultHasValue", criteria.ProcessResultHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.EmailQueue>(); do { this.Add(CFMData.EmailQueue.GetEmailQueue(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private DataOptionList DataPortal_Fetch(DataOptionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_DataOption_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_CodeHasValue", criteria.CodeHasValue); command.Parameters.AddWithValue("@p_DisplayValueHasValue", criteria.DisplayValueHasValue); command.Parameters.AddWithValue("@p_ParentIDHasValue", criteria.ParentIDHasValue); command.Parameters.AddWithValue("@p_AdditionalConfigDataHasValue", criteria.AdditionalConfigDataHasValue); command.Parameters.AddWithValue("@p_ActiveToHasValue", criteria.ActiveToHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.DataOption>(); do { this.Add(CFMData.DataOption.GetDataOption(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private AddressList DataPortal_Fetch(AddressCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_Address_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_StreetHasValue", criteria.StreetHasValue); command.Parameters.AddWithValue("@p_SuburbHasValue", criteria.SuburbHasValue); command.Parameters.AddWithValue("@p_StateIDHasValue", criteria.StateIDHasValue); command.Parameters.AddWithValue("@p_CountryIDHasValue", criteria.CountryIDHasValue); command.Parameters.AddWithValue("@p_PostCodeHasValue", criteria.PostCodeHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.Address>(); do { this.Add(CFMData.Address.GetAddress(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private BudgetApprovalList DataPortal_Fetch(BudgetApprovalCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BudgetApproval_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_AdministratorUserIDHasValue", criteria.AdministratorUserIDHasValue); command.Parameters.AddWithValue("@p_OperationsUserIDHasValue", criteria.OperationsUserIDHasValue); command.Parameters.AddWithValue("@p_ApprovalDateHasValue", criteria.ApprovalDateHasValue); command.Parameters.AddWithValue("@p_ReminderDateHasValue", criteria.ReminderDateHasValue); command.Parameters.AddWithValue("@p_ApprovalFileIDHasValue", criteria.ApprovalFileIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.BudgetApproval>(); do { this.Add(CFMData.BudgetApproval.GetBudgetApproval(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private FinAdministratorList DataPortal_Fetch(FinAdministratorCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_FinAdministrator_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_NameHasValue", criteria.NameHasValue); command.Parameters.AddWithValue("@p_EmailHasValue", criteria.EmailHasValue); command.Parameters.AddWithValue("@p_AddressIDHasValue", criteria.AddressIDHasValue); command.Parameters.AddWithValue("@p_BankAccountIDHasValue", criteria.BankAccountIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.FinAdministrator>(); do { this.Add(CFMData.FinAdministrator.GetFinAdministrator(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private Gl DataPortal_Fetch(GlCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_Gl_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_PostingDateHasValue", criteria.PostingDateHasValue); command.Parameters.AddWithValue("@p_GLCostCentreEntityIDHasValue", criteria.GLCostCentreEntityIDHasValue); command.Parameters.AddWithValue("@p_BankTransactionIDHasValue", criteria.BankTransactionIDHasValue); command.Parameters.AddWithValue("@p_CategoryIDHasValue", criteria.CategoryIDHasValue); command.Parameters.AddWithValue("@p_ExGstAMountHasValue", criteria.ExGstAMountHasValue); command.Parameters.AddWithValue("@p_GSTAmountHasValue", criteria.GSTAmountHasValue); command.Parameters.AddWithValue("@p_DRAmountHasValue", criteria.DRAmountHasValue); command.Parameters.AddWithValue("@p_CRAmountHasValue", criteria.CRAmountHasValue); command.Parameters.AddWithValue("@p_HouseBudgetIDHasValue", criteria.HouseBudgetIDHasValue); command.Parameters.AddWithValue("@p_ClientBudgetIDHasValue", criteria.ClientBudgetIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <Gl>(); if (reader.Read()) { return(GetGl(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.GL' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private ApplicationPermission DataPortal_Fetch(ApplicationPermissionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_ApplicationPermission_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_ApplicationRoleIDHasValue", criteria.ApplicationRoleIDHasValue); command.Parameters.AddWithValue("@p_ApplicationUserIDHasValue", criteria.ApplicationUserIDHasValue); command.Parameters.AddWithValue("@p_BusinessAreaIDHasValue", criteria.BusinessAreaIDHasValue); command.Parameters.AddWithValue("@p_BusinessDivisionIDHasValue", criteria.BusinessDivisionIDHasValue); command.Parameters.AddWithValue("@p_BusinessEntityIDHasValue", criteria.BusinessEntityIDHasValue); command.Parameters.AddWithValue("@p_HomeIDHasValue", criteria.HomeIDHasValue); command.Parameters.AddWithValue("@p_ClientIDHasValue", criteria.ClientIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <ApplicationPermission>(); if (reader.Read()) { return(GetApplicationPermission(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.ApplicationPermission' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private BSBDetail DataPortal_Fetch(BSBDetailCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BSBDetail_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_BSBHasValue", criteria.BsbHasValue); command.Parameters.AddWithValue("@p_BankCodeHasValue", criteria.BankCodeHasValue); command.Parameters.AddWithValue("@p_BSBNameHasValue", criteria.BSBNameHasValue); command.Parameters.AddWithValue("@p_AddressHasValue", criteria.AddressHasValue); command.Parameters.AddWithValue("@p_SuburbHasValue", criteria.SuburbHasValue); command.Parameters.AddWithValue("@p_StateHasValue", criteria.StateHasValue); command.Parameters.AddWithValue("@p_PostCodeHasValue", criteria.PostCodeHasValue); command.Parameters.AddWithValue("@p_PaymentSystemsHasValue", criteria.PaymentSystemsHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <BSBDetail>(); if (reader.Read()) { return(GetBSBDetail(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.BSBDetail' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private DataOptionTypeSortList DataPortal_Fetch(DataOptionTypeSortCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } //RaiseListChangedEvents = false; // Fetch Child objects. using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_DataOptionTypeSort_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); using (var reader = command.ExecuteReader()) { if (reader.Read()) { var rowParser = reader.GetRowParser <CFMData.DataOptionTypeSort>(); do { this.Add(CFMData.DataOptionTypeSort.GetDataOptionTypeSort(rowParser, reader)); }while(reader.Read()); } OnFetched(); return(this); } } } //RaiseListChangedEvents = true; }
private DataOption DataPortal_Fetch(DataOptionCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_DataOption_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_CodeHasValue", criteria.CodeHasValue); command.Parameters.AddWithValue("@p_DisplayValueHasValue", criteria.DisplayValueHasValue); command.Parameters.AddWithValue("@p_ParentIDHasValue", criteria.ParentIDHasValue); command.Parameters.AddWithValue("@p_AdditionalConfigDataHasValue", criteria.AdditionalConfigDataHasValue); command.Parameters.AddWithValue("@p_ActiveToHasValue", criteria.ActiveToHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <DataOption>(); if (reader.Read()) { return(GetDataOption(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.DataOption' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private EmailQueue DataPortal_Fetch(EmailQueueCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_EmailQueue_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_MailingTemplateIDHasValue", criteria.MailingTemplateIDHasValue); command.Parameters.AddWithValue("@p_SendToHasValue", criteria.SendToHasValue); command.Parameters.AddWithValue("@p_MailingTextHasValue", criteria.MailingTextHasValue); command.Parameters.AddWithValue("@p_MailingSubjectHasValue", criteria.MailingSubjectHasValue); command.Parameters.AddWithValue("@p_MailingFromHasValue", criteria.MailingFromHasValue); command.Parameters.AddWithValue("@p_ProcessedDateHasValue", criteria.ProcessedDateHasValue); command.Parameters.AddWithValue("@p_ProcessResultHasValue", criteria.ProcessResultHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <EmailQueue>(); if (reader.Read()) { return(GetEmailQueue(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.EmailQueue' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private BudgetApproval DataPortal_Fetch(BudgetApprovalCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_BudgetApproval_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_AdministratorUserIDHasValue", criteria.AdministratorUserIDHasValue); command.Parameters.AddWithValue("@p_OperationsUserIDHasValue", criteria.OperationsUserIDHasValue); command.Parameters.AddWithValue("@p_ApprovalDateHasValue", criteria.ApprovalDateHasValue); command.Parameters.AddWithValue("@p_ReminderDateHasValue", criteria.ReminderDateHasValue); command.Parameters.AddWithValue("@p_ApprovalFileIDHasValue", criteria.ApprovalFileIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <BudgetApproval>(); if (reader.Read()) { return(GetBudgetApproval(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.BudgetApproval' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }
private FinAdministrator DataPortal_Fetch(FinAdministratorCriteria criteria) { bool cancel = false; OnFetching(criteria, ref cancel); if (cancel) { return(null); } using (var connection = new SqlConnection(ADOHelper.ConnectionString)) { connection.Open(); using (var command = new SqlCommand("[dbo].[spCFM_FinAdministrator_Select]", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddRange(ADOHelper.SqlParameters(criteria.StateBag)); command.Parameters.AddWithValue("@p_NameHasValue", criteria.NameHasValue); command.Parameters.AddWithValue("@p_EmailHasValue", criteria.EmailHasValue); command.Parameters.AddWithValue("@p_AddressIDHasValue", criteria.AddressIDHasValue); command.Parameters.AddWithValue("@p_BankAccountIDHasValue", criteria.BankAccountIDHasValue); command.Parameters.AddWithValue("@p_UpdatedByHasValue", criteria.UpdatedByHasValue); command.Parameters.AddWithValue("@p_UpdatedOnHasValue", criteria.UpdatedOnHasValue); using (var reader = command.ExecuteReader()) { var rowParser = reader.GetRowParser <FinAdministrator>(); if (reader.Read()) { return(GetFinAdministrator(rowParser, reader)); } else { throw new Exception(String.Format("The record was not found in 'dbo.FinAdministrator' using the following criteria: {0}.", criteria)); } } } } OnFetched(); }