예제 #1
0
        private void btnQuestionAdd_Click(object sender, EventArgs e)
        {
            this.Hide();
            QuestionAdd aq = new QuestionAdd();

            aq.Show();
        }
예제 #2
0
 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;
                }
                }
            }
        }