/// <summary> /// This method is used for closing all the child form /// </summary> /// <param name="formNumber"></param> private void CloseAllChildForm(int formNumber) { foreach (Form frm in this.MdiChildren) { frm.Dispose(); frm.Close(); } switch (formNumber) { case 1: FormDetail.OpenWelcomeForm(); break; case 2: FormDetail.OpenCustomerShortCodeForm(); break; case 3: FormDetail.OpenUserDetailsForm(); break; case 4: FormDetail.OpenSyncOptionForm(); break; case 5: FormDetail.OpenLDAPPathForm(); break; case 6: FormDetail.OpenCustomerEmailForm(); break; case 7: FormDetail.OpenInstallationPathForm(); break; case 8: FormDetail.OpenInstallForm(); break; } if (formNumber == 1) { btnBack.Enabled = false; } else { btnBack.Enabled = true; } if (formNumber == 8) { btnNext.Text = Common.GetResourceKeyValue("CommonInstall"); } else { btnNext.Text = Common.GetResourceKeyValue("CommonNext"); } }
/// <summary> /// Back button click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBack_Click(object sender, EventArgs e) { //Disabling the back button if it is a start form if (GlobalData.BackFormName == "StartForm") { btnBack.Enabled = false; } else { btnBack.Enabled = true; } btnNext.Text = Common.GetResourceKeyValue("CommonNext"); if (!string.IsNullOrEmpty(GlobalData.BackFormName)) { //loading the appropriate form based on the form name switch (GlobalData.BackFormName) { case "StartForm": if (Common.GetPreviousAppSettings() != null) { ((Install)this.MdiChildren[0]).Close(); } else { ((CustomerValidation)this.MdiChildren[0]).Close(); } FormDetail.OpenWelcomeForm(); break; case "CustomerValidation": ((UserDetails)this.MdiChildren[0]).Close(); FormDetail.OpenCustomerShortCodeForm(); break; case "UserDetails": ((SyncOption)this.MdiChildren[0]).Close(); FormDetail.OpenUserDetailsForm(); break; case "SyncOption": ((LDAPPath)this.MdiChildren[0]).Close(); FormDetail.OpenSyncOptionForm(); break; case "LDAPPath": ((CustomerEmail)this.MdiChildren[0]).Close(); FormDetail.OpenLDAPPathForm(); break; case "CustomerEmail": ((InstallationPath)this.MdiChildren[0]).Close(); FormDetail.OpenCustomerEmailForm(); break; case "InstallationPath": ((Install)this.MdiChildren[0]).Close(); FormDetail.OpenInstallationPathForm(); break; case "Install": FormDetail.OpenInstallForm(); break; } } }