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); }
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); }
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); }
public int commit(RelGrupoVo relGrupo) { if (relGrupo.NIVEL == 0) { return(delete(relGrupo)); } else if (relGrupo.ID == 0) { return(insert(relGrupo)); } else { return(update(relGrupo)); } }