private void Away_button_Click(object sender, EventArgs e) { showTenant = false; showSP = false; edit = false; Tenants_listBox.ClearSelected(); Serv_Providers_listBox.ClearSelected(); search_input_textBox.Text = ""; HideTextBoxes(); HideButtons(); if (hide_add) { Add_Tenant_button.Hide(); } }
private void ShowButtons() { // Hide all buttons (except edit and delete) Ok_button.Hide(); Cancel_button.Hide(); Add_Tenant_button.Hide(); Add_SP_button.Hide(); Edit_button.Show(); Delete_button.Show(); if (edit || AddSP || AddTenant) { Ok_button.Show(); Cancel_button.Show(); Edit_button.Hide(); Delete_button.Hide(); } }
private void Ok_button_Click(object sender, EventArgs e) { // Clickable away action causes lost of contact/edit info Away_button.Enabled = true; DisableAllWriteTextboxes(); if (edit && showTenant) { EditTenant(); Fill_Tenant_ListBox(false, ""); } else if (edit && showSP) { EditSP(); Fill_Serv_Prov_ListBox(false, ""); } else if (AddTenant) { AddTen(); Fill_Tenant_ListBox(false, ""); } else if (AddSP) { AddServP(); Fill_Serv_Prov_ListBox(false, ""); } showSP = false; showTenant = false; edit = false; AddSP = false; AddTenant = false; updateAvailApart(); search_input_textBox.Text = ""; HideTextBoxes(); HideButtons(); if (hide_add) { Add_Tenant_button.Hide(); } ResetAllInput(); DisableAllWriteTextboxes(); }