コード例 #1
0
 protected void exec_del_attribute(section.type_section st, long id, section_attr.section_attr_type at, string code)
 {
     db_conn.exec(core.parse_query("sections.delete-attribute"
                                   , new Dictionary <string, object>()
     {
         { "section_id", id }, { "attr_type", at.ToString() }
         , { "attr_code", code }, { "section_type", st }
     }));
 }
コード例 #2
0
 protected void exec_set_attribute(section.type_section st, long id, section_attr.section_attr_type at, string code, string qry_val)
 {
     db_conn.exec(core.parse_query("sections.set-attribute"
                                   , new Dictionary <string, object>()
     {
         { "attr_type", at }, { "attr_value", qry_val }
         , { "section_id", id }, { "attr_code", code }, { "section_type", st }
     }));
 }
コード例 #3
0
        public void set_attribute(string code, section_attr.section_attr_type type, object value)
        {
            section_attr a = _attributes.FirstOrDefault(x => x.code == code);

            if (a == null)
            {
                a = new section_attr(code, type, value);
                _attributes.Add(a);
            }
            else
            {
                if (a.type != type)
                {
                    throw new Exception("l'attributo '" + code + "' non è di tipo '" + type.ToString() + "'");
                }
                a.value = value;
            }
        }