private void btnSave_Click(object sender, EventArgs e) { if (btnDelete.Enabled == false && btnUpdate.Enabled == false) { game.Id = random.Next(4, 2147483647); game.Name = tb_name.Text; game.Description = txt_description.Text; game.Link = txt_link.Text; game.Date = txt_date.Text; game.Developer = txt_developer.Text; game.Genre = txt_genre.Text; game.Image = txt_image.Text; gameBusiness.Add(game); } else if (btnAdd.Enabled == false && btnUpdate.Enabled == false) { gameBusiness.Delete(tb_name.Text); } else { game.Id = random.Next(4, 2147483647); game.Name = tb_name.Text; game.Description = txt_description.Text; game.Link = txt_link.Text; game.Date = txt_date.Text; game.Developer = txt_developer.Text; game.Genre = txt_genre.Text; game.Image = txt_image.Text; gameBusiness.Update(game); } lb_description.Visible = true; txt_description.Visible = true; lb_link.Visible = true; txt_link.Visible = true; lb_date.Visible = true; txt_date.Visible = true; lb_developer.Visible = true; txt_developer.Visible = true; lb_genre.Visible = true; txt_genre.Visible = true; lb_image.Visible = true; txt_image.Visible = true; btnDelete.Enabled = true; btnAdd.Enabled = true; btnUpdate.Enabled = true; }