Example #1
0
        public void Delete(AnnouncementTable announcement)
        {
            string command = "DELETE FROM NET_ANNOUNCEMENTS WHERE announce_id = :id";
            int    rows;

            conn.Open();

            cmd = new OracleCommand(command, conn);
            cmd.Parameters.Add(new OracleParameter("id", announcement.announce_id));

            rows = cmd.ExecuteNonQuery();

            conn.Close();

            Message = rows.ToString() + " row(s) have been deleted.";
        }
Example #2
0
        public void Update(AnnouncementTable announcement)
        {
            string command = "UPDATE NET_ANNOUNCEMENTS SET announce_id = :id, announce_text = :a_text, announce_date = SYSDATE, emp_id = :e_id WHERE announce_id = :id";
            int    rows;

            conn.Open();

            cmd = new OracleCommand(command, conn);
            cmd.Parameters.Add(new OracleParameter("id", announcement.announce_id));
            cmd.Parameters.Add(new OracleParameter("a_text", announcement.announce_text));
            cmd.Parameters.Add(new OracleParameter("e_id", announcement.emp_id));

            rows = cmd.ExecuteNonQuery();

            conn.Close();

            Message = rows.ToString() + " row(s) have been updated.";
        }
Example #3
0
        public void Add(AnnouncementTable announcement)
        {
            string command = "INSERT INTO NET_ANNOUNCEMENTS (announce_id, announce_text, emp_id) VALUES (:id, :a_text, :e_id)";
            int    rows;

            conn.Open();

            cmd = new OracleCommand(command, conn);
            cmd.Parameters.Add(new OracleParameter("id", announcement.announce_id));
            cmd.Parameters.Add(new OracleParameter("a_text", announcement.announce_text));
            cmd.Parameters.Add(new OracleParameter("e_id", announcement.emp_id));

            rows = cmd.ExecuteNonQuery();

            conn.Close();

            Message = rows.ToString() + " row(s) have been added.";
        }