示例#1
0
        public int stpAlteraCategoria(int cdcategoria, string nmcategoria)
        {
            Queue<SqlParameter> qParameters = null;
            Database db = null;

            try
            {
                CreateParameters(Database.Action.Update, ref qParameters, cdcategoria, nmcategoria);
                db = new Database();
                return db.ExecuteNonQuery("stpAlteraCategoria", ref qParameters);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                qParameters = null;
                db.Dispose();
                db = null;
            }
        }
示例#2
0
        public DataSet stpConsultaCategoria(string nmcategoria)
        {
            Queue<SqlParameter> qParameters = null;
            Database db = null;
            DataSet ds = null;

            try
            {
                CreateParameters(Database.Action.List, ref qParameters, 0, nmcategoria);
                db = new Database();
                ds = db.ExecuteDataSet("stpConsultaCategoria", ref qParameters);
                return ds;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                qParameters = null;
                db.Dispose();
                db = null;
            }
        }
示例#3
0
        public int stpIncluiCategoria(string nmcategoria)
        {
            Queue<SqlParameter> qParameters = null;
            Database db = null;

            try
            {
                CreateParameters(Database.Action.Insert, ref qParameters, 0, nmcategoria);
                db = new Database();
                return db.ExecuteNonQuery("stpIncluiCategoria", ref qParameters);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                qParameters = null;
                db.Dispose();
                db = null;
            }
        }