Exemple #1
0
        public void Save()
        {
            Debug.Enter();

            //
            // Save the taxonomy entry.
            //
            SqlCommand cmd = new SqlCommand("net_taxonomy_save", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@flag", SqlDbType.Int)).Direction       = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@taxonomyID", SqlDbType.Int)).Direction = ParameterDirection.Output;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromKey("@tModelKey", tModelKey);
            paramacc.SetInt("@flag", taxonomyFlag);

            cmd.ExecuteNonQuery();

            int taxonomyID = paramacc.GetInt("@taxonomyID");

            foreach (TaxonomyValue tv in TaxonomyValues)
            {
                tv.Save(tModelKey);
            }
        }