Beispiel #1
0
        private void button15_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();
            string        id = textBox1.Text;
            FR            s  = DB.FRs.SingleOrDefault(x => x.Username == id);

            if (s != null)
            {
                s.Name  = textBox2.Text;
                s.Email = textBox3.Text;

                s.Address        = textBox4.Text;
                s.Contact_Number = textBox5.Text;
                s.Gender         = comboBox1.Text;
                s.Blood_Group    = comboBox3.Text;
                s.Books_Type     = comboBox4.Text;
                s.Books_Name     = textBox6.Text;
                s.Author_Editor  = textBox7.Text;
                s.Book_Can_Hold  = textBox8.Text;
                s.Designation    = textBox10.Text;


                DB.SubmitChanges();
                MessageBox.Show("Information Updated!!");
            }
        }
Beispiel #2
0
        private void button16_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();
            //int id = int.Parse(textBox3.Text);
            string id = textBox1.Text;
            FR     s  = DB.FRs.SingleOrDefault(x => x.Username == id);

            if (s != null)
            {
                //textBox2.Text = s.Username;
                textBox9.Text  = s.Password;
                textBox2.Text  = s.Name;
                textBox3.Text  = s.Email;
                textBox10.Text = s.Designation;
                textBox4.Text  = s.Address;
                textBox5.Text  = s.Contact_Number;
                comboBox1.Text = s.Gender;
                comboBox3.Text = s.Blood_Group;
                comboBox4.Text = s.Books_Type;
                textBox6.Text  = s.Books_Name;
                textBox7.Text  = s.Author_Editor;
                textBox8.Text  = s.Book_Can_Hold;
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
        private void button15_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            Login w = new Login();

            w.Username = textBox1.Text;
            w.Password = textBox9.Text;
            w.Role     = "Faculty";
            FR m = new FR();

            m.Username       = textBox1.Text;
            m.Name           = textBox2.Text;
            m.Email          = textBox3.Text;
            m.Designation    = textBox10.Text;
            m.Address        = textBox4.Text;
            m.Contact_Number = textBox5.Text;
            m.Gender         = comboBox1.Text;

            m.Blood_Group   = comboBox3.Text;
            m.Books_Type    = comboBox4.Text;
            m.Books_Name    = textBox6.Text;
            m.Author_Editor = textBox7.Text;
            m.Book_Can_Hold = textBox8.Text;
            m.Password      = textBox9.Text;

            DB.FRs.InsertOnSubmit(m);
            DB.Logins.InsertOnSubmit(w);
            DB.SubmitChanges();
            MessageBox.Show("Faculty Added!!");
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            string id = textBox8.Text;
            FR     s  = DB.FRs.SingleOrDefault(x => x.Username == id);

            if (s != null)
            {
                textBox6.Text = s.Books_Name;
                textBox7.Text = s.Author_Editor;
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
Beispiel #5
0
        public FacultyDashboard(String s)
        {
            InitializeComponent();
            this.s = s;

            DBDataContext DB = new DBDataContext();

            using (DB)
            {
                FR ci = DB.FRs.SingleOrDefault(p => p.Username == s);
                if (ci != null)
                {
                    textBox1.Text = ci.Username;
                    textBox2.Text = ci.Name;
                    textBox3.Text = ci.Email;
                    textBox4.Text = ci.Designation;
                    textBox5.Text = ci.Address;
                }
            }
        }
Beispiel #6
0
        private void button18_Click(object sender, EventArgs e)
        {
            //int id = int.Parse(textBox3.Text);
            DBDataContext DB = new DBDataContext();
            string        id = textBox1.Text;
            FR            s  = DB.FRs.SingleOrDefault(x => x.Username == id);
            Login         ln = DB.Logins.SingleOrDefault(x => x.Username == id);

            if (s != null)
            {
                DB.FRs.DeleteOnSubmit(s);
                DB.Logins.DeleteOnSubmit(ln);
                DB.SubmitChanges();
            }
            else
            {
                MessageBox.Show("Data not found");
            }
            MessageBox.Show("Successfully Deleted The Information", "Delete Faculty", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
 partial void DeleteFR(FR instance);
 partial void UpdateFR(FR instance);
 partial void InsertFR(FR instance);