private void presentB_Click(object sender, EventArgs e)
        {
            if (status != 1)
            {
                if (status == 0)
                {
                    MessageBox.Show(prev_countdown);
                }
                else
                {
                    MessageBox.Show(after_countdown);
                }
                return;
            }
            if (studentIdTB.Text == "")
            {
                MessageBox.Show("search and Select a student from the list.");
                return;
            }

            if (check_duplicate(studentIdTB) == "no")
            {
                return;
            }

            db.Insert("INSERT INTO `attendance` (`att_id`, `hall_std_id`, `date_time`) VALUES (NULL, '" + studentIdTB.Text + "', CURRENT_TIMESTAMP);");
        }
예제 #2
0
        private void saveB_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    XDocument doc =
            //              new XDocument(
            //                new XElement("attendance",
            //                  new XElement("settings", new XAttribute("id", "1"), new XAttribute("start",startDTP.Value.ToString()), new XAttribute("end", endDTP.Value.ToString()))
            //                  ));
            //    string installationPath = Environment.CurrentDirectory;
            //    var currentDirectory = Path.Combine(installationPath, "DataSource");
            //    bool IsExists = System.IO.Directory.Exists(currentDirectory);
            //    if (!IsExists) System.IO.Directory.CreateDirectory(currentDirectory);


            //    var fileName = Path.Combine(currentDirectory, "attendance.xml");
            //    doc.Save(fileName);
            //    MessageBox.Show("You have successfully set Attendance settings as administrator.");
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show("Error Occured:" + ex.Message);
            //}
            string start = Basic.time.todbTime(startDTP.Value);
            string end   = Basic.time.todbTime(endDTP.Value);

            db.Insert("INSERT INTO `att_set` (`att_set_id`, `from_date`, `to_date`, `date_time`) VALUES (NULL, '" + start + "', '" + end + "', CURRENT_TIMESTAMP);");
        }
예제 #3
0
        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 addStudentB_Click(object sender, EventArgs e)
        {
            if (Basic.validation.check_empty(hall_std_IDL.Text) == "no")
            {
                return;
            }
            if (Basic.validation.check_empty(remarkTB) == "no")
            {
                return;
            }
            if (Basic.validation.check_empty(authorTB) == "no")
            {
                return;
            }

            String add_query = "INSERT INTO `remark` (`remark_id`, `remarks`, `author`, `hall_std_id`, `date_time`) VALUES (NULL, '" + remarkTB.Text + "', '" + authorTB.Text + "', '" + hall_std_IDL.Text + "', CURRENT_TIMESTAMP)";

            db.Insert(add_query);
        }
예제 #5
0
        private void addHallB_Click(object sender, EventArgs e)
        {
            if (hallNameTB.Text == "")
            {
                MessageBox.Show("Please fill up the Hall Name. ", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            try
            {
                //add query string and insert command run
                string insertQuery = "insert into hall_info values (null,'" + hallNameTB.Text.ToString() + "','" + hallTypeCB.SelectedItem.ToString() + "')";

                df.Insert(insertQuery);
                // end add query string and insert command run

                hallNameTB.Text = "";
            }
            catch (Exception ex) {
                MessageBox.Show("Error occured. Message - " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #6
0
        private void addDeptB_Click(object sender, EventArgs e)
        {
            if (deptNameTB.Text == "")
            {
                MessageBox.Show("Please fill up the dept Name. ", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            try
            {
                //add query string and insert command run
                string insertQuery = "insert into dept_info values (null,'" + deptNameTB.Text.ToString() + "',( SELECT faculty_id FROM faculty_info where faculty_name= '" + facultyNameCB.SelectedItem.ToString() + "'))";

                df.Insert(insertQuery);
                // end add query string and insert command run

                deptNameTB.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occured. Message - " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        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);
        }