private void NewEditExit_EditClick(object sender, EventArgs e) { try { switch (this.NewEditExit.BtnEditText) { case "&Edit": this.EnableDisableControls(false); this.cboTripCode.Enabled = true; this.VisibleControls(true); this.BindComboBox(true); this.InitializeControls(); break; case "&Delete": if (this.cboTripCode.SelectedValue != null) { if (Globalizer.ShowMessage(MessageType.Question, "Are you sure want to delete?") == DialogResult.Yes) { TripController tripController = new TripController(); tripController.DeleteByTripID(this.cboTripCode.SelectedValue.ToString()); string log = "Form-TripPlan;Item-TripCode:" + this.cboTripCode.Text + ";action-Delete"; userAction.Log(log); Globalizer.ShowMessage(MessageType.Information, "Deleted Successfully"); this.ResetControl(); this.BindTripID(); } } break; } } catch (Exception ex) { Globalizer.ShowMessage(MessageType.Critical, ex.Message); } }