예제 #1
0
        private void show_result()
        {
            int hallid = Convert.ToInt32(il.get_value("Select hall_id  from hall_info where hall_name = '" + hallCB.SelectedItem + "'"));

            String basic_query = "Select hall_std_id as 'Hall ID',session as Session,name as Name,degree as Degree,mobile as Mobile,religion as Religion from student_info where hall_id = " + hallid + "  and  alloted_room = '" + roomCB.SelectedItem + "' ";

            il.datagridview_load("select room,capacity from seat where room='" + roomCB.SelectedItem.ToString() + "' and hall_id=" + hallid + "", capacityDGV);
            il.datagridview_load(basic_query + " and status = 0", dataGridView1);
            il.datagridview_load(basic_query + " and status = 1", dataGridView2);
        }
        private void all_info_Load(object sender, EventArgs e)
        {
            bs.datagridview_load("Select hall_id as 'Hall ID', hall_name as 'Hall Name',type as 'Type' From hall_info", hallDGV);

            bs.datagridview_load("Select faculty_id as 'Faculty ID', faculty_name as 'Faculty Name' from faculty_info", facultyDGV);

            bs.datagridview_load("Select dept_info.dept_id as 'Department ID', dept_info.dept_name as 'Department Name', faculty_info.faculty_name as 'Faculty Name' from dept_info,faculty_info where dept_info.faculty_id = faculty_info.faculty_id", deptDGV);

            bs.datagridview_load("Select qouta_id as 'Qouta ID', qouta_name as 'Qouta Name' from qouta", qoutaDGV);
        }
        private void studentDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int row    = e.RowIndex;
            int column = 0;

            if (row > -1)
            {
                string sid = studentDGV[column, row].Value.ToString();
                hall_std_IDL.Text = sid;
                String query = "SELECT `remark_id`, `remarks`, `author`, `hall_std_id`, `date_time` FROM `remark` WHERE `hall_std_id` = " + sid;
                il.datagridview_load(query, remarkDGV);
            }
        }
        internal void searchButtonWork(TextBox searchTB, RadioButton anySearchRB, RadioButton idSearchRB, RadioButton nameSearchRB, RadioButton rollSearchRB,RadioButton registrationSearchRB,RadioButton roomSearchRB,  DataGridView studentDGV)
        {

            //SELECT *  FROM `student_info` WHERE  `class_roll` LIKE '%12%' or  `registration_no` LIKE '%1%' or `name` LIKE '%re%' Or `f_name` LIKE '%re%' or `m_name` LIKE '%re%' or `address` LIKE '%re%'
            string cond = searchTB.Text;
            String column = "";

            if (anySearchRB.Checked)
            {
                column = " `name` ";
            }
            if (idSearchRB.Checked == true)
            {
                column = " `hall_std_id` ";
            }
            if (nameSearchRB.Checked == true)
            {
                column = " `name` ";
            }
            if (rollSearchRB.Checked == true)
            {
                column = " `class_roll` ";
            }
            if (registrationSearchRB.Checked == true)
            {
                column = " `registration_no` ";
            }
            if (roomSearchRB.Checked == true)
            {
                column = " `alloted_room` ";
            }
            String sql = "SELECT s.hall_std_id, s.session, s.class_roll, s.registration_no, s.name, s.f_name, s.m_name, s.address, s.sex, s.religion,s.degree, s.mobile, s.phone, s.email, s.blood_group, s.alloted_room, h.hall_name , d.dept_name,f.faculty_name ,q.qouta_name, u.name AS Added_By  FROM student_info as s,dept_info as d,faculty_info as f,hall_info as h,qouta as q ,user as u where s.dept_id = d.dept_id and s.faculty_id = f.faculty_id and s.hall_id = h.hall_id and s.qouta_id = q.qouta_id and s.added_by = u.user_id and  s." + column + "  LIKE '%" + cond + "%' ";


            il.datagridview_load(sql, studentDGV);
        }
예제 #5
0
        private void showAllB_Click(object sender, EventArgs e)
        {
            string query = "SELECT student_info.hall_std_id, student_info.session, student_info.class_roll, student_info.registration_no, student_info.name, student_info.f_name, student_info.m_name, student_info.address, student_info.sex, student_info.religion, student_info.mobile, student_info.phone, student_info.email, student_info.blood_group, student_info.alloted_room, `user`.name AS Added_By, qouta.qouta_name, dept_info.dept_name, hall_info.hall_name,faculty_info.faculty_name FROM student_info INNER JOIN dept_info ON student_info.dept_id = dept_info.dept_id INNER JOIN                         faculty_info ON student_info.faculty_id = faculty_info.faculty_id INNER JOIN                         hall_info ON student_info.hall_id = hall_info.hall_id INNER JOIN                         qouta ON student_info.qouta_id = qouta.qouta_id INNER JOIN                         `user` ON student_info.added_by = `user`.user_id";

            il.datagridview_load(query, dataGridView1);
        }
 private void all_user_Load(object sender, EventArgs e)
 {
     il.datagridview_load("Select user_id as 'User ID', username as 'User Name', name as 'Name', added_by as 'Added By' from user", userInfoDGV);
 }