private void take_attendance_Load(object sender, EventArgs e) { //try //{ // string path = Path.Combine(Environment.CurrentDirectory, "DataSource\\attendance.xml"); // XDocument xdoc = XDocument.Load(path); // XElement attendanceResult = xdoc.Element("attendance"); // var settingsResult = (from result in attendanceResult.Elements("settings") // select new // { // id = Convert.ToInt32(result.Attribute("id").Value), // start = result.Attribute("start").Value, // end = result.Attribute("end").Value // }).ToList()[0]; // start_countdown_L.Text = settingsResult.start; // end_countdown_L.Text = settingsResult.end; //} //catch (Exception ex) //{ // MessageBox.Show("Error : " + ex.Message); //} start_countdown_L.Text = il.get_value("SELECT `from_date` FROM `att_set` ORDER BY `att_set`.`date_time` DESC LIMIT 0,1"); end_countdown_L.Text = il.get_value("SELECT `to_date` FROM `att_set` ORDER BY `att_set`.`date_time` DESC LIMIT 0,1"); }
private void addRoomB_Click(object sender, EventArgs e) { if (Basic.validation.check_empty(roomNoTB) == "no") { return; } if (Basic.validation.check_empty(capacityTB) == "no") { return; } string hallid = bi.get_value("SELECT hall_id from hall_info where hall_name='" + hall_name_CB.SelectedItem + "'"); string insertQuery = "INSERT INTO `seat` (`room_id`, `room`, `capacity`, `hall_id`) VALUES (NULL, '" + roomNoTB.Text + "', '" + capacityTB.Text + "', '" + hallid + "')"; df.Insert(insertQuery); }
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 addStudentB_Click(object sender, EventArgs e) { if (Basic.validation.check_empty(classRollTB) == "no") { return; } if (Basic.validation.check_empty(registrationTB) == "no") { return; } if (Basic.validation.check_empty(studentNameTB) == "no") { return; } String hall_id = il.get_value("select hall_id from hall_info where hall_name='" + hallNameCB.SelectedItem + "'"); String dept_id = il.get_value("select dept_id from dept_info where dept_name='" + deptNameCB.SelectedItem + "'"); String faculty_id = il.get_value("select faculty_id from faculty_info where faculty_name='" + facultyNameCB.SelectedItem + "'"); String qouta_id = il.get_value("select qouta_id from qouta where qouta_name='" + qoutaCB.SelectedItem + "'"); String status = "0"; if (currentStudentRB.Checked) { status = "0"; } if (oldStudentRB.Checked) { status = "1"; } String sql = "INSERT INTO `student_info` (`hall_std_id`, `session`, `class_roll`, `registration_no`, `name`, `f_name`, `m_name`, `address`, `sex`, `religion`, `degree`, `mobile`, `phone`, `email`, `blood_group`, `alloted_room`, `hall_id`, `dept_id`, `faculty_id`, `qouta_id`, `added_by`, `status`) VALUES (NULL, '" + sessionCB.Text + "', '" + classRollTB.Text + "', '" + registrationTB.Text + "', '" + studentNameTB.Text + "', '" + fatherNameTB.Text + "', '" + motherNameTB.Text + "', '" + addressTB.Text + "', '" + sexCB.SelectedItem + "', '" + religionTB.Text + "', '" + degreeCB.SelectedItem + "', '" + mobileTB.Text + "', '" + phoneTB.Text + "', '" + emailTB.Text + "', '" + bloodGroupCB.SelectedItem + "', '" + roomTB.Text + "', '" + hall_id + "', '" + dept_id + "', '" + faculty_id + "', '" + qouta_id + "', '" + uid + "', '" + status + "');"; db.Insert(sql); addStudentRB_CheckedChanged(s, EventArgs.Empty); }