コード例 #1
0
ファイル: AdminPanel.cs プロジェクト: ulasgokce/E-Class
        private void btnQuestionAdd_Click(object sender, EventArgs e)
        {
            this.Hide();
            QuestionAdd aq = new QuestionAdd();

            aq.Show();
        }
コード例 #2
0
ファイル: AdminPanel.cs プロジェクト: ulasgokce/E-Class
 private void btnQuestionUpdate_Click(object sender, EventArgs e)
 {
     using (ExamEntities db = new ExamEntities())
     {
         if (dgwQuestions.SelectedCells.Count > 0)
         {
             this.Hide();
             Question        question         = new Question();
             int             selectedrowindex = dgwQuestions.SelectedCells[0].RowIndex;
             DataGridViewRow selectedRow      = dgwQuestions.Rows[selectedrowindex];
             int             id = Convert.ToInt32(Convert.ToString(selectedRow.Cells["Id"].Value));
             question = db.Questions.Where(x => x.Id == id).FirstOrDefault();
             ObjectPasser.Question = question;
             QuestionAdd qa = new QuestionAdd();
             qa.Show();
         }
     }
 }
コード例 #3
0
ファイル: Login.cs プロジェクト: ulasgokce/E-Class
        private void Login_Click(object sender, EventArgs e)
        {
            using (ExamEntities db = new ExamEntities())
            {
                switch (GetIn.GetInside(txtUserName.Text, txtPassword.Text))
                {
                case 0:
                {
                    //TODO: Admin Login
                    this.Hide();
                    AdminPanel ap = new AdminPanel();
                    ap.Show();
                    break;
                }

                case 1:
                {
                    //TODO: Teacher Login
                    this.Hide();
                    QuestionAdd qa = new QuestionAdd();
                    qa.Show();
                    break;
                }

                case 2:
                {
                    //TODO: Student Login
                    this.Hide();
                    StudentPanel sp = new StudentPanel();
                    sp.Show();
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
        }