Ejemplo n.º 1
0
        public bool Delete(string id)
        {
            string sql = "update SERVICES set DELETED=1 where ID=?";

            OleDbParameter[] parms = new OleDbParameter[] {
                new OleDbParameter("ID", OleDbType.VarChar)
            };

            parms[0].Value = id;
            return(OledbHelper.ExecSql(sql, parms));
        }
Ejemplo n.º 2
0
        public bool Add(Service service)
        {
            string sql = "insert into SERVICES(ID, NAME, URL, REMARKS)VALUES(?,?,?,?)";

            OleDbParameter[] parms = new OleDbParameter[] {
                new OleDbParameter("ID", OleDbType.VarChar),
                new OleDbParameter("NAME", OleDbType.VarChar),
                new OleDbParameter("PARAMS", OleDbType.VarChar),
                new OleDbParameter("URL", OleDbType.VarChar)
            };
            parms[0].Value = service.ID;
            parms[1].Value = service.NAME;
            parms[2].Value = service.URL;
            parms[3].Value = service.PARAMS;
            return(OledbHelper.ExecSql(sql, parms));
        }
Ejemplo n.º 3
0
        public bool Edit(Service service)
        {
            string sql = "update SERVICES set NAME=?, URL=?, ContentType=?, PARAMS=? where ID=?";

            OleDbParameter[] parms = new OleDbParameter[] {
                new OleDbParameter("ID", OleDbType.VarChar),
                new OleDbParameter("NAME", OleDbType.VarChar),
                new OleDbParameter("PARAMS", OleDbType.VarChar),
                new OleDbParameter("URL", OleDbType.VarChar)
            };

            parms[0].Value = service.ID;
            parms[1].Value = service.NAME;
            parms[2].Value = service.URL;
            parms[3].Value = service.PARAMS;
            return(OledbHelper.ExecSql(sql, parms));
        }