Example #1
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);
        }
Example #2
0
        public GetSerialNoFromWoNumerWoSerialQM Execute(string woNumber, decimal woSerial)
        {
            var response = new GetSerialNoFromWoNumerWoSerialQM();

            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspGetSerialNoFromWoNumerWoSerialForDc]";
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(AddParameter("@WoNumber", SsDbType.VarChar, ParameterDirection.Input, woNumber));
                sqlCommand.Parameters.Add(AddParameter("@WoSerial", SsDbType.Decimal, ParameterDirection.Input, woSerial));

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