public EmployeeAddEdit(Employee selectedEmployee, ManagerForm form) { inputHandler = new FormInputHandler(); parent = form; InitializeComponent(); if (selectedEmployee == null) { return; } AddUserButton.Text = "Edit"; employee = selectedEmployee; FillTextBoxes(); }
public ActorAddEdit(AddMovieForm parent, Actor actor) { this.parent = parent; this.actor = actor; validator = new FormInputHandler(); InitializeComponent(); if (actor == null) { return; } fillFormData(); AddEdit.Text = "Edit"; }
private void SearchButton_Click(object sender, EventArgs e) { FormInputHandler inputcleaner = new FormInputHandler(); List <String> queryList = new List <String>(); if (!inputcleaner.doesNotContainSemiColonOrSingleQuote(TitleBox.Text)) { return; } String q = "Select * from movie where [name] like '%" + TitleBox.Text + "%' "; if (!inputcleaner.doesNotContainSemiColonOrSingleQuote(GenreComboBox.Text)) { return; } if (GenreComboBox.Text != "") { queryList.Add("genre like '" + GenreComboBox.Text + "'"); } if (movieActors.Count != 0) { string actors = ""; foreach (Actor actor in movieActors) { actors += actor.Id.ToString() + ", "; } //remove the last 2 characters actors = actors.Remove(actors.Length - 2); queryList.Add("mid in (select mid from starred where aid in (" + actors + "))"); } foreach (string s in queryList) { q += "and " + s; } parent.fillSearch(DBEnvironment.searchForMovies(q)); }