Example #1
0
        public int delete(RelUsuVo relUsu)
        {
            this.QUERY = new StringBuilder(fromDatabase);

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

            return(getData().DefaultView.Count);
        }
Example #2
0
        public int update(RelUsuVo relUsu)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.AppendLine("UPDATE " + table);
            this.QUERY.AppendLine("   SET ");
            this.QUERY.AppendLine("     idReport    = " + relUsu.IDREPORT + ",");
            this.QUERY.AppendLine("     idUser      = "******",");
            this.QUERY.AppendLine("     nivel       = " + relUsu.NIVEL);
            this.QUERY.AppendLine(" WHERE id = " + relUsu.ID);

            return(getData().DefaultView.Count);
        }
Example #3
0
 public int commit(RelUsuVo relUsu)
 {
     if (relUsu.NIVEL == 0)
     {
         return(delete(relUsu));
     }
     else if (relUsu.ID == 0)
     {
         return(insert(relUsu));
     }
     else
     {
         return(update(relUsu));
     }
 }
Example #4
0
        public int insert(RelUsuVo relUsu)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.Append("INSERT INTO " + table);
            this.QUERY.AppendLine("(idUser, idReport, nivel)");

            this.QUERY.Append("VALUES");
            this.QUERY.Append("(");
            this.QUERY.Append("" + relUsu.IDUSER + ",");
            this.QUERY.Append("" + relUsu.IDREPORT + ",");
            this.QUERY.Append("" + relUsu.NIVEL + "");
            this.QUERY.AppendLine(")");

            return(getData().DefaultView.Count);
        }