public DespatchEnquiryOptionQM GetDespatchEnquiryForGrid(Int16 Option, DateTime?fromDate, DateTime?ToDate) { DespatchEnquiryOptionQM ds = new DespatchEnquiryOptionQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDespatchEnquirySelectCommandForGrid { Connection = connection }; ds = command.Execute(Option, fromDate, ToDate); } return(ds); }
protected override void SetUp() { var loggerFactory = new ConsoleLoggerFactory(false); _connectionProvider = new DbConnectionProvider(SqlTestHelper.ConnectionString, loggerFactory); var sagaTypeNamingStrategy = new LegacySagaTypeNamingStrategy(); var serializer = new DefaultSagaSerializer(); _dataTableName = TestConfig.GetName("sagas"); _indexTableName = TestConfig.GetName("sagaindex"); SqlTestHelper.DropTable(_indexTableName); SqlTestHelper.DropTable(_dataTableName); _storage = new SqlServerSagaStorage(_connectionProvider, _dataTableName, _indexTableName, loggerFactory, sagaTypeNamingStrategy, serializer); }
public GetSequenceNumberQM GetSequenceNumber(decimal PartCode) { GetSequenceNumberQM model = new GetSequenceNumberQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetSequenceNumberSelectCommand { Connection = connection }; model = command.Execute(PartCode); } return(model); }
public GetProcessCardDetailsQM GetProcessCardDetails(decimal PartCode) { GetProcessCardDetailsQM model = new GetProcessCardDetailsQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetProcessCardDetailsSelectCommand { Connection = connection }; model = command.Execute(PartCode); } return(model); }
protected override void SetUp() { var loggerFactory = new ConsoleLoggerFactory(false); var connectionProvider = new DbConnectionProvider(SqlTestHelper.ConnectionString, loggerFactory); var sagaTypeNamingStrategy = new LegacySagaTypeNamingStrategy(); var dataTableName = TestConfig.GetName("sagas"); var indexTableName = TestConfig.GetName("sagaindex"); SqlTestHelper.DropTable(indexTableName); SqlTestHelper.DropTable(dataTableName); _storage = new SqlServerSagaStorage(connectionProvider, dataTableName, indexTableName, loggerFactory, sagaTypeNamingStrategy); _storage.EnsureTablesAreCreated(); }
/// <summary> /// Generate sql statement /// </summary> /// <typeparam name="T"></typeparam> /// <param name="data"></param> /// <returns></returns> internal SqlStatement GenerateSqlQueue <T>(T data) where T : AbstractEntity { SchemaTable schemaTable = data.GetSchema(); DbBaseProvider dbProvider = DbConnectionProvider.CreateDbProvider(schemaTable.ConnectKey); if (dbProvider != null) { CommandStruct command = GenerateCommand(dbProvider, data, schemaTable, false, null); if (command != null) { int identityId = data.GetIdentityId(); return(dbProvider.GenerateSql(identityId, command)); } } return(null); }
public GetWorkOrderNumberForHeatQM GetWorkOrderNumberHeat() { var model = new GetWorkOrderNumberForHeatQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new WorkOrderNumberForHeatSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetWoMasterAndDetailsFromCustomerCodeTypeQM GetWoMasterAndDetails(Int64 vendorCode, string woType, string DcNumber, bool Invoiced) { var model = new GetWoMasterAndDetailsFromCustomerCodeTypeQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetWoMasterAndDetailsSelectCommand { Connection = connection }; model = command.Execute(vendorCode, woType, DcNumber, Invoiced); } return(model); }
public GetWOMasterForDcQM GetWoMasterForDc(Int64 vendorCode, string woType) { var model = new GetWOMasterForDcQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetWoMasterForDcSelectCommand { Connection = connection }; model = command.Execute(vendorCode, woType); } return(model); }
public CustomUserInformationQueryModel GetUserInformation(CustomUserInformationCommandModel customUserInformationCM) { CustomUserInformationQueryModel userInformationQueryModel; using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var userInformationSelectCommand = new CustomUserInformationSelectCommand { Connection = connection }; userInformationQueryModel = userInformationSelectCommand.Execute(customUserInformationCM.UserName, customUserInformationCM.Password); } return(userInformationQueryModel); }
public async Task CanDoWorkInTransaction() { var provizzle = new DbConnectionProvider(SqlTestHelper.ConnectionString, new ConsoleLoggerFactory(true)); using (var dbConnection = await provizzle.GetConnection()) { using (var cmd = dbConnection.CreateCommand()) { cmd.CommandText = "insert into bimse (text) values ('hej med dig')"; await cmd.ExecuteNonQueryAsync(); } //await dbConnection.Complete(); } }
public static async Task RemoveExpiredCodesAsync() { const string query = "DELETE FROM emailtokens WHERE expirydate < @current"; using (var dbConn = DbConnectionProvider.CreateDbConnection()) { try { await dbConn.ExecuteAsync(query, new { current = DateTime.Now }); } catch (DbException ex) { DbConnectionProvider.HandleDbException(ex); } } }
public DataSet GetInvoicedEnquiry() { DataSet ds = new DataSet(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetInvoicedEnquirySelectCommand { Connection = connection }; ds = command.Execute(); } return(ds); }
public DataSet GetDespatchEnquiry(Int16 Option, DateTime?FromDate, DateTime?ToDate) { DataSet ds = new DataSet(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDespatchEnquirySelectCommand { Connection = connection }; ds = command.Execute(Option, FromDate, ToDate); } return(ds); }
public GetDcNumberForInvoiceQM GetDcNumberForInvoice(Int64 VendorCode, string WoType) { var response = new GetDcNumberForInvoiceQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDcNumberForInvoiceSelectCommand { Connection = connection }; response = command.Execute(VendorCode, WoType); } return(response); }
public GetSerialNoFromWoNumerWoSerialQM GetSerialNoFromWoNumerWoSerialForDc(string woNumber, decimal woSerial) { var model = new GetSerialNoFromWoNumerWoSerialQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetSerialNoForDcSelectCommand { Connection = connection }; model = command.Execute(woNumber, woSerial); } return(model); }
public GetDcDetailsForInvoiceQM GetDcDetailsForInvoice(string DcNumber) { var response = new GetDcDetailsForInvoiceQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDcDetailsForInvoiceSelectCommand { Connection = connection }; response = command.Execute(DcNumber); } return(response); }
public GetDcMasterQM GetDcMaster() { GetDcMasterQM getDcMasterQM = new GetDcMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDcMasterSelectCommand { Connection = connection }; getDcMasterQM = command.Execute(); } return(getDcMasterQM); }
public GetJobCardEntryReportQM GetJobCardEntryReport(string WoNumber, string WoSerial) { var model = new GetJobCardEntryReportQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new JobCardEntryReportSelectCommand { Connection = connection }; model = command.Execute(WoNumber, WoSerial); } return(model); }
public GetGPReceivingResponseQM GetGPReceivingMasterAndDetails(Int64 VendorCode) { var model = new GetGPReceivingResponseQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetReceivingMasterAndDetailsSelectCommand { Connection = connection }; model = command.Execute(VendorCode); } return(model); }
public GetWorkOrderDetailsStatusQM GetWorkOrderDetailsStatus(GetWorkOrderDetailsStatusCM modelCM) { var model = new GetWorkOrderDetailsStatusQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new WorkOrderDetailsStatusSelectCommand { Connection = connection }; model = command.Execute(modelCM); } return(model); }
public GetGPReceivedDetailsQM GetGPReceivedDetails() { var model = new GetGPReceivedDetailsQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetReceivedDetailsSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetJobCardMaintanceQM GetJobCardMaintane() { GetJobCardMaintanceQM model = new GetJobCardMaintanceQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetJobCardMaintanceSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetInvoiceMasterQM GetInvoiceMaster() { var response = new GetInvoiceMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetInvoiceMasterSelectCommand { Connection = connection }; response = command.Execute(); } return(response); }
private static void WriteSqlLog(ProfileSummary summary, string dbProviderName, string connectionString) { var dbProvider = DbConnectionProvider.CreateDbProvider(ConnectKey, dbProviderName, connectionString); var command = dbProvider.CreateCommandStruct(MessageQueueTableName, CommandMode.Insert); foreach (var pair in GetDetailValues(summary)) { if (pair.Key.ToLower() == MessageQueueColumns[0].ToLower()) { //ignore "id" continue; } command.AddParameter(pair.Key, pair.Value); } dbProvider.ExecuteQuery(command); }
public string GetInvoiceNumber(string WoType) { string workOrderNumber = string.Empty; using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetInvoiceNumberSelectCommand { Connection = connection }; workOrderNumber = command.Execute(WoType); } return(workOrderNumber); }
public GetParameterMasterQM GetParameterMaster() { var model = new GetParameterMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new ParameterMasterSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetDimensionReportQM GetDimensionReport(string InvoiceNumber, decimal InvoiceSerial, int IsReportFor) { var response = new GetDimensionReportQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDimensionReportSelectCommand { Connection = connection }; response = command.Execute(InvoiceNumber, InvoiceSerial, IsReportFor); } return(response); }
public GetProcessCardQM GetProcessCard(string vendorCode) { GetProcessCardQM model = new GetProcessCardQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetProcessCardSelectCommand { Connection = connection }; model = command.Execute(vendorCode); } return(model); }
public StockEnquiryOptionQM GetStockEnquiryForGrid(Int16 Option) { StockEnquiryOptionQM ds = new StockEnquiryOptionQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetStockEnquirySelectCommandForGrid { Connection = connection }; ds = command.Execute(Option); } return(ds); }