private void CheckUser(object sender, RoutedEventArgs e)
        {
            mainDal check = new mainDal();

            if (teacher.IsChecked.Equals(true))
            {
                if (check.Login(this.username.Text, this.password.Password, "teacher"))
                {
                    adminBoard a = new adminBoard();
                    name    = this.username.Text;
                    a.Name1 = name;
                    a.Show();
                }
                else
                {
                    MessageBox.Show("Invalid Password");
                }
            }
            else if (student.IsChecked.Equals(true))
            {
                if (check.Login(this.username.Text, this.password.Password, "student"))
                {
                    studentBoard s = new studentBoard();
                    s.Name1 = this.username.Text;
                    s.Show();
                }
                else
                {
                    MessageBox.Show("Invalid Password");
                }
            }
        }
示例#2
0
文件: Program.cs 项目: T4g1/3eme
        static void Main(string[] args)
        {
            mainDal db = new mainDal();

            db.DeleteFromUsers("Pseudo", "toto");
            Console.ReadLine();
        }
        private void view(object sender, RoutedEventArgs e)
        {
            mainDal m = new mainDal();
            user    u = m.getDetail(name);

            MessageBox.Show("Name: " + u.Name + "\n Password:"******"\nEmail:" + u.Email + "\n Designation:" + u.Designation);
        }
        private void Done1(object sender, RoutedEventArgs e)
        {
            mainDal d1 = new mainDal();

            d1.addQuiz(li);
            this.Close();
        }
        private void changepwd(object sender, RoutedEventArgs e)
        {
            mainDal m = new mainDal();

            m.updatePassword(this.Name1, this.newpwd.Password);
            this.Close();
        }
示例#6
0
        public Reports()
        {
            InitializeComponent();
            mainDal   d = new mainDal();
            DataTable t = d.getReport();

            myGrid.ItemsSource = t.DefaultView;
        }
        public allQuizez()
        {
            InitializeComponent();
            m = new mainDal();

            DataTable t = m.getAllQuizez();

            myGrid.ItemsSource = t.DefaultView;
        }
        private void updateinfo(object sender, RoutedEventArgs e)
        {
            user obj = new user();

            obj.Name     = this.newName.Text;
            obj.Email    = this.newEmail.Text;
            obj.Password = this.newPwd.Text;
            mainDal d = new mainDal();

            d.update(obj, this.Name1);
        }
示例#9
0
        private void result1(object sender, RoutedEventArgs e)
        {
            r.Name = this.Name1;
            mainDal r1 = new mainDal();

            r1.addResult(r);
            quizRunResult re = new quizRunResult();

            re.setResult(r);
            this.Close();
            re.Show();
        }
示例#10
0
        private void addStudent1(object sender, RoutedEventArgs e)
        {
            user    student = new user();
            mainDal add     = new mainDal();

            student.Name        = this.nameBox.Text;
            student.Password    = this.pwdBox.Text;
            student.Email       = this.emailBox.Text;
            student.Designation = "student";
            add.addStudent1(student);
            this.Close();
        }
 public viewAnnouncement()
 {
     tiltes = new List <string>();
     posts  = new mainDal();
     InitializeComponent();
     li = posts.getALLPost();
     foreach (announcement a in li)
     {
         string til = a.Title;
         tiltes.Add(til);
     }
     this.titleOfAnouncement.ItemsSource = tiltes;
 }
        private void postTodb(object sender, RoutedEventArgs e)
        {
            mainDal      post = new mainDal();
            announcement a    = new announcement();

            a.Title    = this.titleBox.Text;
            a.Contents = this.contentBox.Text;
            DateTime d = DateTime.Now;

            a.Date = d.ToString();
            post.post(a);
            this.Close();
        }
        public void setDataParticular(string name)
        {
            mainDal m = new mainDal();

            DataTable t = m.getPArticularReport(name);

            _reportViewer.LocalReport.DataSources.Clear();
            // it will clear the data source of
            //report if any.
            _reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", t.DefaultView));
            // it will set the data source of report. First argument is dataset and 2nd in the table.
            _reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
            // this sets the path of //report.
            _reportViewer.LocalReport.EnableExternalImages = true;
            _reportViewer.Visible = true;
            _reportViewer.RefreshReport();
        }
        private void delQuiz(object sender, RoutedEventArgs e)
        {
            mainDal m = new mainDal();

            string val = delVal.Text;
            int    id  = 0;

            try
            {
                id = int.Parse(val);
            }
            catch
            {
                delVal.Text = "Enter Valid id";
            }

            m.deleteQuiz(id);
        }
示例#15
0
        public startQuiz()
        {
            db = new mainDal();
            DateTime d = DateTime.Now;

            InitializeComponent();
            r         = new buninessObjects.result();
            r.Qid     = 1;
            r.Attempt = 0;
            r.Correct = 0;
            r.Timing  = d.ToString();

            li = db.startQuiz();

            this.statement.Content = li[i].Statement;
            opA.Content            = li[i].OptionA;
            opB.Content            = li[i].OptionB;
            opC.Content            = li[i].OptionC;
            opD.Content            = li[i].OptionD;
            r.Total = li.Count;
        }