Beispiel #1
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);
        }
        public GetWoMasterAndDetailsFromCustomerCodeTypeQM Execute(long vendorCode, string woType, string DcNumber, bool Invoiced)
        {
            var response = new GetWoMasterAndDetailsFromCustomerCodeTypeQM();

            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspGetWoMasterAndDetailsFromCustomerCodeWoTypeForDc]";
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(AddParameter("@VendorCode", SsDbType.BigInt, ParameterDirection.Input, vendorCode));
                sqlCommand.Parameters.Add(AddParameter("@WoType", SsDbType.VarChar, ParameterDirection.Input, woType));
                sqlCommand.Parameters.Add(AddParameter("@DcNumber", SsDbType.VarChar, ParameterDirection.Input, DcNumber));
                sqlCommand.Parameters.Add(AddParameter("@Invoiced", SsDbType.Bit, ParameterDirection.Input, Invoiced));

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