private void cbUseIntgSecu_CheckedChanged(object sender, EventArgs e) { if (cbUseIntgSecu.Checked == true) { txtUserName.Enabled = false; txtPassword.Enabled = false; try { bool loginStatus = m_timeSheetBLL.UseIntegratedSecu(); if (loginStatus == true) { fviewTimesheet fvTimesheet = new fviewTimesheet(); this.Hide(); fvTimesheet.Show(); } else { toolStripStatusInfo.Text = "Check your username and/or password in settings..."; } } catch (Exception ex) { MessageBox.Show("Connection could not be establish", "Server Connection", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { txtUserName.Enabled = true; txtPassword.Enabled = true; } }
/// <summary> /// TODO: check this method later /// </summary> private void Main_FormClosing(object sender, FormClosingEventArgs e) { //fviewTimesheet fvTimesheet = new fviewTimesheet(); //Form f = fvTimesheet.FindForm(); //f.Dispose(); using (fviewTimesheet fvTimesheet = new fviewTimesheet()) { Form f = fvTimesheet.FindForm(); } }
/// <summary> /// TODO: release memory when LOgIn is closed after being call by fviewTS /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { //fviewTimesheet fvTimesheet = new fviewTimesheet(); //Form f = fvTimesheet.FindForm(); //f.Dispose(); using (fviewTimesheet fvTimesheet = new fviewTimesheet()) { Form f = fvTimesheet.FindForm(); } base.OnFormClosing(e); }