Exemplo n.º 1
0
        private void courses_Load(object sender, EventArgs e)
        {
            StudentLinqDataContext dc = new StudentLinqDataContext();

            comboBox1.DisplayMember = "CourseName";
            comboBox1.DataSource    = dc.Courses.ToList <Course>();
        }
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         using (StudentLinqDataContext data = new StudentLinqDataContext())
         {
             studentinfo lg = data.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text);
             Password = lg.CreatePassword;
             name     = lg.StudentName;
             path     = @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\studentpropic\" + name + ".jpg";
         }
         if (Password == textBox2.Text)
         {
             MessageBox.Show("login successfull ");
             textBox1.Text = null;
             textBox2.Text = null;
         }
         StudentHomepage st = new StudentHomepage(name, path);
         st.Show();
         this.Hide();
     }
     catch
     {
         MessageBox.Show("Invalid username or password");
         textBox1.Text = null;
         textBox2.Text = null;
     }
 }
        private void button5_Click(object sender, EventArgs e)
        {
            try
            {
                using (StudentLinqDataContext supdate = new StudentLinqDataContext())
                {
                    StudentLinqDataContext sup = new StudentLinqDataContext();
                    int id = int.Parse(label6.Text);

                    studentinfo sobj = supdate.studentinfos.Single(Student_Info => Student_Info.id == id);

                    sobj.StudentName   = textBox1.Text;
                    sobj.Email         = textBox2.Text;
                    sobj.Mobile        = textBox3.Text;
                    sobj.AdmissionYear = textBox4.Text;
                    sobj.Department    = textBox5.Text;

                    supdate.SubmitChanges();

                    MessageBox.Show("Data Updated");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                ///  textBox1.Text = null;
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            StudentLinqDataContext quest = new StudentLinqDataContext();
            exam exm = new exam();

            exm.ques  = textBox1.Text;
            exm.ans   = ans;
            exm.marks = 1;
            quest.exams.InsertOnSubmit(exm);
            quest.SubmitChanges();
            MessageBox.Show("Question added successfully");
            textBox1.Text = null;
        }
        private void button7_Click(object sender, EventArgs e)
        {
            {
                StudentLinqDataContext sdelete = new StudentLinqDataContext();

                studentinfo sinfo = sdelete.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text);

                sdelete.studentinfos.DeleteOnSubmit(sinfo);

                sdelete.SubmitChanges();
                MessageBox.Show("Data ddeleted");
            }
        }
Exemplo n.º 6
0
        private void StudentSearch_Load(object sender, EventArgs e)
        {
            {
                using (StudentLinqDataContext Ssearch = new StudentLinqDataContext())
                {
                    // Student_Info sinfo = Ssearch.Student_Infos.Single(Student_Info => Student_Info.Id.ToString() == textBox1.Text);


                    /// DCDataContext db = new DCDataContext();
                    // dataGridView1.DataSource = Ssearch.Student_Infos.Select(Student_Info => Student_Info.StudentName  <= DateTime.);

                    // textBox1.Text = sinfo.Student;
                    // dataGridView1.DataSource = sinfo;
                    // dataGridView1.DataBindings()
                    dataGridView1.DataSource = Ssearch.studentinfos;
                }
            }
        }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                StudentLinqDataContext db = new StudentLinqDataContext();
                Course fac = new Course();
                fac.CourseName = textBox1.Text;
                fac.Seat       = textBox2.Text;
                db.Courses.InsertOnSubmit(fac);
                db.SubmitChanges();

                MessageBox.Show("Data Inserted");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Data Not Inserted");
            }
        }
Exemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                StudentLinqDataContext db = new StudentLinqDataContext();

                Co fac = new Co();
                fac.CourseAdded = comboBox1.Text;
                fac.StudentName = studentname;

                db.Cos.InsertOnSubmit(fac);
                db.SubmitChanges();

                MessageBox.Show("Course Added");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Data Not Inserted");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                StudentLinqDataContext dbc = new StudentLinqDataContext();
                studentinfo            st  = new studentinfo();
                st.StudentName    = textBox1.Text;
                st.FatherName     = textBox2.Text;
                st.Email          = textBox3.Text;
                st.Mobile         = textBox4.Text;
                st.Age            = textBox5.Text;
                st.Sex            = textBox6.Text;
                st.Religion       = textBox7.Text;
                st.AdmissionYear  = textBox8.Text;
                st.CreatePassword = textBox10.Text;
                st.Department     = textBox11.Text;
                dbc.studentinfos.InsertOnSubmit(st);
                dbc.SubmitChanges();
                File.Copy(temp1, @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\studentpropic\" + textBox1.Text + ".jpg");

                MessageBox.Show("Data Inserted");
                textBox1.Text  = null;
                textBox2.Text  = null;
                textBox3.Text  = null;
                textBox4.Text  = null;
                textBox5.Text  = null;
                textBox6.Text  = null;
                textBox7.Text  = null;
                textBox8.Text  = null;
                textBox9.Text  = null;
                textBox10.Text = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
        }
Exemplo n.º 10
0
 private void button1_Click(object sender, EventArgs e)
 {
     groupBox1.Show();
     //Random rnd = new Random();
     //int val = rnd.Next(1, 10);
     val++;
     // MessageBox.Show(val.ToString());
     try
     {
         totalmark = totalmark + 1;
         {
             using (StudentLinqDataContext ques = new StudentLinqDataContext())
             {
                 exam xm = ques.exams.Single(quiz => quiz.id == val);
                 label1.Text = (xm.ques);
                 if (xm.ans == answer)
                 {
                     achivedmark = achivedmark + 1;
                 }
                 else
                 {
                     achivedmark = achivedmark + 0;
                 }
                 //  MessageBox.Show(val.ToString());
                 //label1.Show();
                 //  MessageBox.Show("ques "+xm.question);
             }
         }
     }
     catch
     {
         MessageBox.Show("Exam is over your mark is" + achivedmark.ToString() + "out of" + totalmark.ToString());
         this.Dispose();
         //this.Show();
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                using (StudentLinqDataContext Ssearch = new StudentLinqDataContext())
                {
                    studentinfo sinfo = Ssearch.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text);



                    textBox1.Text = sinfo.StudentName;
                    textBox2.Text = sinfo.Email;
                    textBox3.Text = sinfo.Mobile;
                    textBox4.Text = sinfo.AdmissionYear;
                    textBox5.Text = sinfo.Department;
                    MessageBox.Show("Data Found");
                }
            }
            catch
            {
                MessageBox.Show("Data Not Found ");
                textBox1.Text = null;
            }
        }
        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                using (StudentLinqDataContext Ssearch = new StudentLinqDataContext())
                {
                    studentinfo sinfo = Ssearch.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text);



                    label3.Text  = sinfo.StudentName;
                    label4.Text  = sinfo.Email;
                    label12.Text = sinfo.Mobile;
                    label6.Text  = sinfo.AdmissionYear;
                    label8.Text  = sinfo.Department;
                    MessageBox.Show("Data Found");
                    label3.Show();
                    label4.Show();
                    label5.Show();
                    label6.Show();
                    label7.Show();
                    label8.Show();
                    label9.Show();
                    label10.Show();
                    label11.Show();
                    label12.Show();
                    label13.Show();
                    textBox1.Text = null;
                }
            }
            catch
            {
                MessageBox.Show("Data Not Found ");
                textBox1.Text = null;
            }
        }