(a) Pre-Indictment. A complaint may be administratively dismissed by the prosecutor without presentation to the grand jury in which event said prosecutor shall report the dismissal and the basis therefor to the Assignment Judge and shall notify the defendant.
(b) Post-Indictment. Upon motion by the prosecuting attorney, an indictment, accusation or complaint, or any court thereof, may be dismissed prior to trial by order of the judge to whom the same has been assigned for trial. During trial an indictment or accusation, or any count thereof may be dismissed by the trial judge on motion by the prosecuting attorney with the consent of the defendant.