public void Button_edit_Click(Object sender, System.EventArgs e) // edit what if name/comment { int lngid; string whatifName; string whatifComment; try { classE1_1.Open(); lngid = classE1_1.glngwid; whatifName = txtWhatifName.Text; whatifName = MyUtilities.clean(whatifName).Trim(); whatifComment = txtWhatifComment.Text; whatifComment = MyUtilities.clean(whatifComment); // if (whatifName.Length == 0) { //Label4.Text = "Save name/comment not saved. No name was provided. "; //Label4.Visible = true; Master.ShowErrorMessage("Cannot save name and comment. The name cannot be empty."); } else if (!GetCurrentWhatif().ToUpper().Equals(whatifName.ToUpper()) && WhatifExists(whatifName)) { Master.ShowErrorMessage("Cannot save name and comment because a whatif with the same name already exists. Please choose a different whatif name."); } else { classE1_1.updatewidname(lngid, whatifName, whatifComment); Master.PassCurrentWhatifName(whatifName); Master.SetCurrentWhatifLabel(); set_page2_words(); updatingdatasource(); ShowWhatifs(); } classE1_1.Close(); } catch (Exception ex) { logFiles.ErrorLog(ex); Master.ShowErrorMessage("MPX internal error has occured."); } }