コード例 #1
0
        public int GetSerialCount(string custCode, string locCode, string itemCode)
        {
            var ctx = new AccellosContext();

            string sql = @"SELECT COUNT(serial) cnt FROM l_ryder_cisco_sncyc_cnt
WHERE cust_code = :1 AND loc_code = :2 AND item_code = :3";
            IList <OracleParameter> parameters = new List <OracleParameter>
            {
                new OracleParameter(":1", OracleDbType.Varchar2, custCode, ParameterDirection.Input),
                new OracleParameter(":2", OracleDbType.Varchar2, locCode, ParameterDirection.Input),
                new OracleParameter(":3", OracleDbType.Varchar2, itemCode, ParameterDirection.Input)
            };

            using (var cn = (OracleConnection)ctx.DbConnection)
            {
                return(OracleManager.ExecuteScalar(cn, sql, parameters));
            }
        }