Exemple #1
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);
        }
        public GetDcNumberForInvoiceQM Execute(Int64 VendorCode, string WoType)
        {
            var response = new GetDcNumberForInvoiceQM();

            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspGetDcNumberForInvoice]";
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(AddParameter("@VendorCode", SsDbType.BigInt, ParameterDirection.Input, VendorCode));
                sqlCommand.Parameters.Add(AddParameter("@WoType", SsDbType.NVarChar, ParameterDirection.Input, WoType));

                using (var reader = SsDbCommandHelper.ExecuteReader(sqlCommand))
                {
                    response.GetDcNumberForInvoiceList = reader.ToList <GetDcNumberForInvoiceModel>();
                }
            }
            return(response);
        }