Esempio n. 1
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");
            }
        }
Esempio n. 2
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!!");
            }
        }
        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!!");
        }
Esempio n. 4
0
        private void button15_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            Login w = new Login();

            w.Username = textBox1.Text; //new user k login database e pathysi
            w.Password = textBox9.Text; //new password k login database e pathysi
            w.Role     = "Student";     //this is only for student

            MR m = new MR();

            m.Username   = textBox1.Text;
            m.Name       = textBox2.Text;
            m.Email      = textBox3.Text;
            m.Department = comboBox2.Text;
            m.Address    = textBox4.Text;
            m.Contact_No = 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.MRs.InsertOnSubmit(m);
            DB.Logins.InsertOnSubmit(w);
            DB.SubmitChanges();
            MessageBox.Show("Student Added!!");
        }
Esempio n. 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            AB w = new AB();

            w.Book_Id   = textBox2.Text;
            w.Book_Name = textBox1.Text;
            w.Quantity  = textBox3.Text;

            DB.ABs.InsertOnSubmit(w);
            DB.SubmitChanges();
            MessageBox.Show("Book Added!!");
        }
Esempio n. 6
0
        private void button2_Click(object sender, EventArgs e)
        {
            var   db = new DBDataContext();
            Login t  = null;

            t = db.Logins.SingleOrDefault(p => p.Username == textBox1.Text && p.Password == textBox2.Text);


            if (t != null)
            {
                if (t.Role == "Admin")
                {
                    MessageBox.Show("Login as a Librarian");
                    LibrarianHomepage obj = new LibrarianHomepage();
                    obj.StartPosition = FormStartPosition.CenterScreen;
                    obj.Show();
                    this.Hide();

                    textBox1.Clear();
                    textBox2.Clear();
                }
                else if (t.Role == "Faculty")
                {
                    MessageBox.Show("Login as a Faculty");
                    FacultyDashboard fd = new FacultyDashboard(t.Username);
                    fd.StartPosition = FormStartPosition.CenterScreen;
                    fd.Show();
                    this.Hide();
                    textBox1.Clear();
                    textBox2.Clear();
                }

                else
                {
                    MessageBox.Show("Login as a Student");

                    StudentDashboard sd = new StudentDashboard(t.Username);
                    sd.StartPosition = FormStartPosition.CenterScreen;
                    sd.Show();
                    this.Hide();
                    textBox1.Clear();
                    textBox2.Clear();
                }
            }
            else
            {
                MessageBox.Show("Invalid Username or Password! ", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();
            string        id = textBox2.Text;
            AB            s  = DB.ABs.SingleOrDefault(x => x.Book_Id == id);

            if (s != null)
            {
                s.Book_Id   = textBox2.Text;
                s.Book_Name = textBox1.Text;
                s.Quantity  = textBox3.Text;
                DB.SubmitChanges();
                MessageBox.Show("Information Updated!!");
            }
        }
Esempio n. 8
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");
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            string id = textBox2.Text;
            AB     s  = DB.ABs.SingleOrDefault(x => x.Book_Id == id);

            if (s != null)
            {
                textBox1.Text = s.Book_Name;
                textBox3.Text = s.Quantity;
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
Esempio n. 10
0
        private void button18_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();
            string        id = textBox1.Text;
            MR            s  = DB.MRs.SingleOrDefault(x => x.Username == id);

            if (s != null)
            {
                DB.MRs.DeleteOnSubmit(s);
                DB.SubmitChanges();
            }
            else
            {
                MessageBox.Show("Data not found");
            }
            MessageBox.Show("Successfully Deleted The Information", "Delete Student", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
Esempio n. 11
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;
                }
            }
        }
Esempio n. 12
0
        public StudentDashboard(String j)
        {
            InitializeComponent();
            this.j = j;

            DBDataContext DB = new DBDataContext();

            using (DB)
            {
                MR ci = DB.MRs.SingleOrDefault(p => p.Username == j);
                if (ci != null)
                {
                    textBox1.Text = ci.Username;
                    textBox2.Text = ci.Name;
                    textBox3.Text = ci.Email;
                    //textBox4.Text = ci.Designation;
                    textBox5.Text = ci.Address;
                }
            }
        }