private void FeeSettingForm_FormClosing(object sender, FormClosingEventArgs e) { FeeSettingForm.instanceFrm = null; //this.Hide(); //this.Close(); //e.Cancel = true; }
private void Check_Is_Fee_Setting_Is_Saved() { string Is_Fee_Setting_Saved; string Is_Class_Fee_Setting_Saved; string Is_Record_Exists_Out; ClassFeeSetting classFeeSetting = new ClassFeeSetting(); classFeeSetting.Check_Is_Fee_Setting_Is_Saved( Convert.ToInt32(ddlAcademicYear.SelectedValue), out Is_Fee_Setting_Saved, out Is_Class_Fee_Setting_Saved); if (Is_Fee_Setting_Saved.ToUpper() == "N") { MessageBox.Show("Fee Setting For This Academic Year Is Not Found.\nPlease Copy/Add New Fee Setting For This Academic Year.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information); ddlAcademicYear.SelectedIndex = 0; FeeSettingForm feeSettingForm = new FeeSettingForm(); feeSettingForm.MaximizeBox = false; feeSettingForm.MinimizeBox = false; feeSettingForm.StartPosition = FormStartPosition.CenterParent; feeSettingForm.ShowDialog(this); return; } if (Is_Class_Fee_Setting_Saved.ToUpper() == "N") { DialogResult dResult = MessageBox.Show("Class Fee Setting For This Academic Year Is Not Found.\nPlease Add New/Copy Previous Academic Year's Class Fee Setting.\nDo You Want To Copy Previous Academic Year's Data?", "Class Fee Setting", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dResult == DialogResult.Yes) { classFeeSetting.Check_Class_Fee_Setting_For_Previous_Academic_Year( Convert.ToInt32(ddlAcademicYear.SelectedValue), out Is_Record_Exists_Out); //IF Record of Previous Year is available then copy. if (Is_Record_Exists_Out.ToUpper() == "Y") { Copy_Class_Fee_Setting(); } else { MessageBox.Show("No Record Found For Previous Year.\n Please Add New Record.", "Class Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }