示例#1
0
        public int delete(RelGrupoVo relGrupo)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.AppendLine("DELETE FROM " + table);
            this.QUERY.AppendLine(" WHERE id = " + relGrupo.ID);

            return(getData().DefaultView.Count);
        }
示例#2
0
        public int update(RelGrupoVo relGrupo)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.AppendLine("UPDATE " + table);
            this.QUERY.AppendLine("   SET idReport    = " + relGrupo.IDREPORT);
            this.QUERY.AppendLine("     , idUserGroup = " + relGrupo.IDUSERGROUP);
            this.QUERY.AppendLine("     , nivel       = " + relGrupo.NIVEL);
            this.QUERY.AppendLine(" WHERE id = " + relGrupo.ID);

            return(getData().DefaultView.Count);
        }
示例#3
0
        public int insert(RelGrupoVo relGrupo)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.Append("INSERT INTO " + table + " ");
            this.QUERY.AppendLine("(idReport, idUserGroup, nivel)");
            this.QUERY.Append("VALUES(");
            this.QUERY.Append("" + relGrupo.IDREPORT + ",");
            this.QUERY.Append("" + relGrupo.IDUSERGROUP + ",");
            this.QUERY.Append("" + relGrupo.NIVEL + "");
            this.QUERY.AppendLine(")");

            return(getData().DefaultView.Count);
        }
示例#4
0
 public int commit(RelGrupoVo relGrupo)
 {
     if (relGrupo.NIVEL == 0)
     {
         return(delete(relGrupo));
     }
     else if (relGrupo.ID == 0)
     {
         return(insert(relGrupo));
     }
     else
     {
         return(update(relGrupo));
     }
 }