コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
ファイル: SqlDataSender.cs プロジェクト: catontheway/ScutCode
        /// <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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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();
            }
        }
コード例 #12
0
        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);
                }
            }
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        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);
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
        }
コード例 #23
0
        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);
        }
コード例 #24
0
        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);
        }
コード例 #25
0
        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);
        }
コード例 #26
0
        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);
        }
コード例 #27
0
        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);
        }
コード例 #28
0
        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);
        }
コード例 #29
0
        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);
        }
コード例 #30
0
        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);
        }