private void insClass_Click(object sender, EventArgs e)
        {
            if (ClassID.Text == "")
            {
                if (className.Text == "")
                {
                    MessageBox.Show("Class id or Class name can not be blank");
                }
                else
                {
                    var cr = new Course
                    {
                        Name = className.Text
                               //Course_Id = int.Parse(ClassID.Text),
                               //TID = int.Parse(TechID.Text),
                               //SID = int.Parse(StuID.Text),
                               //NID = i++
                    };
                    db.Courses.InsertOnSubmit(cr);
                    db.SubmitChanges();
                }
            }
            else
            {
                MessageBox.Show("ID will be auto genereted. Leave it blank.");
                ClassID.Text = "";
            }

            // dgv.DataSource = db.Courses;
            //StuID.Text = "";
            // TechID.Text = "";
            className.Text = "";
        }
        private void button3_Click(object sender, EventArgs e)
        {
            all_classDataContext db = new all_classDataContext();
            int     id  = _2nd_frame.Getid();
            student stu = db.students.SingleOrDefault(x => x.Student_Id == id);

            stu.Password = pass.Text;
            //prod.price = float.Parse(textBox2.Text);
            db.SubmitChanges();
            MessageBox.Show("password changed");
        }
Exemplo n.º 3
0
 private void button12_Click(object sender, EventArgs e)
 {
     if (pass_fld.Text == "")
     {
         MessageBox.Show(" Empty feild ");
     }
     else
     {
         all_classDataContext db = new all_classDataContext();
         int     id  = _2nd_frame.Getid();
         Teacher stu = db.Teachers.SingleOrDefault(x => x.teacher_Id == id);
         stu.Password = pass_fld.Text;
         //prod.price = float.Parse(textBox2.Text);
         db.SubmitChanges();
         MessageBox.Show("password changed");
     }
 }
Exemplo n.º 4
0
        private void notes_Click(object sender, EventArgs e)
        {
            if (Note_Link.Text == "")
            {
                MessageBox.Show("The box can not be blank");
            }
            else
            {
                var n = new Note
                {
                    Note_link = Note_Link.Text,
                };

                db.Notes.InsertOnSubmit(n);
                db.SubmitChanges();
                MessageBox.Show("Note link is inserted .. ");
            }
        }