Example #1
0
        public void Reset(int gtinId)
        {
            const string commandText = @"Delete From chz_scanned_sgtins
            Where chz_gtin_id =  @chz_gtin_id";

            var parameter = new GtinIdParameter()
            {
                Id = gtinId
            };
            var transaction = Transact <SgtinModel> .Create(ConnectionString, commandText, parameter : parameter);

            transaction.ExecuteNonQuery();
        }
Example #2
0
        public IEnumerable <SgtinModel> Get(int gtinId)
        {
            const string commandText = @"Select chz_sgtin_id,sgtin
            From chz_sgtins
            Where chz_gtin_id=1";

            var parameter = new GtinIdParameter()
            {
                Id = gtinId
            };
            var transaction = Transact <SgtinModel> .Create(ConnectionString, commandText, parameter : parameter);

            return(transaction.ExecuteReader());
        }
Example #3
0
        public bool MatchCheck(int gtin)
        {
            const string commandText = @"Select Count(*) As count, 
            (Select Count(*) From chz_sgtins Inner Join chz_scanned_sgtins On chz_sgtins.sgtin=chz_scanned_sgtins.sgtin) As match_count
            From chz_sgtins
            Where chz_sgtins.chz_gtin_id=@chz_gtin_id";

            var parameter = new GtinIdParameter()
            {
                Id = gtin
            };
            var transaction = Transact <MatchCheckResult> .Create(ConnectionString, commandText, parameter : parameter);

            var result = transaction.ExecuteReader().First();

            return(result.Count == result.MatchCount);
        }