Exemplo n.º 1
0
        public virtual int Delete()
        {
            List <MyField> paramsfileds = new List <MyField>();

            Type t = this.GetType();

            PropertyInfo[] props = t.GetProperties();

            DataTable schema = SchemaBuffer.getTableDef(this.GetTableName());

            foreach (PropertyInfo p in props)
            {
                string fName = p.Name.ToUpper();
                Object val   = p.GetGetMethod().Invoke(this, new Object[] { });

                foreach (DataColumn dc in schema.PrimaryKey)
                {
                    if (dc.ColumnName.ToUpper() == fName)
                    {
                        paramsfileds.Add(new MyField(fName, val));
                        continue;
                    }
                }
            }

            return(TableManager.Delete(this.GetTableName(), paramsfileds.ToArray()));
        }
Exemplo n.º 2
0
 public virtual int Delete(params MyField[] paramfileds)
 {
     return(TableManager.Delete(this.GetTableName(), paramfileds));
 }