private void Toolbar_Application_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { try { switch (e.Tool.Key) { case "BTN_Users": case "BTN_Books": this.IsMdiContainer = true; FRM_Students Form2 = new FRM_Students(); Form2.MdiParent = this; Form2.Show(); break; case "BTN_Students": this.IsMdiContainer = true; Form1 Form = new Form1(); Form.MdiParent = this; Form.Show(); break; case "BTN_Reports": break; } } catch (Exception ex) { ExceptionHandler.HandleException(ex.Message, this.Name, "Toolbar_Application_ToolClick"); } }
private void Toolbar_Application_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { try { switch (e.Tool.Key) { case "BTN_Users": case "BTN_Books": //this.IsMdiContainer = true; Frm_BOOKS Form2 = new Frm_BOOKS(); //Form2.MdiParent = this; Form2.ShowDialog(); break; case "BTN_Students": this.IsMdiContainer = true; FRM_Students Form = new FRM_Students(); //Form.MdiParent = this; Form.ShowDialog(); break; case "BTN_CreateQuestion": this.IsMdiContainer = true; FRM_Questions vFrm_Questions = new FRM_Questions(); vFrm_Questions.ShowDialog(); break; case "BTN_Exams": string visExamTaken = BasicClass.fReturnScalar("SELECT ISNULL(IsExamTaken,'N') from [User] WHERE ID =" + BasicClass.vUsrID + " ", this.Name); if (visExamTaken.Trim().ToUpper() == "Y") { MessageBox.Show("هذا المستخدم قام بتأدية ذلك الامتحان من قبل", "", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } else { this.IsMdiContainer = true; FRM_Exam vFrm_Exam = new FRM_Exam(); vFrm_Exam.ShowDialog(); break; } case "BTN_Reports": break; } } catch (Exception ex) { ExceptionHandler.HandleException(ex.Message, this.Name, "Toolbar_Application_ToolClick"); } }
private void FRM_Main_Load(object sender, EventArgs e) { try { Intializer init = new Intializer(); if (init.sRaiseLoginForm() == false) { Application.Exit(); } else { if (BasicClass.vUsrID != 0 && BasicClass.vRoleID != 0) { // IF Admin Enable All except Exams & create Exam if (BasicClass.vRoleID == 1) { sEnableApplications(true, false, true, false, true); } // IF intructor Enable Exams & create Exam , Reports else if (BasicClass.vRoleID == 2) { sEnableApplications(false, true, false, true, true); } // IF Student // Enable Exam Only else if (BasicClass.vRoleID == 3) { sEnableApplications(false, false, true, false, false); FRM_Students vFrm = new FRM_Students(); vFrm.ShowDialog(); } //sEnableOptions(false, false, false, false); } } } catch (Exception ex) { ExceptionHandler.HandleException(ex.Message, this.Name, "FRM_Main_Load"); } }