Beispiel #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         // start of update command run
         //UPDATE `hallmanagement`.`settings` SET `value` = 'D:\\' WHERE `settings`.`name` = 'imagelocation'
         string updateQuery = "update settings set value= '" + textBox1.Text + "' where name = imagelocation";
         df.Update(updateQuery);
         //end of update command runn
     }
     catch (Exception ee)
     {
         MessageBox.Show("Error Occured. Message - " + ee.Message, "Error: Please Select a Folder", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        private void updateRoomB_Click(object sender, EventArgs e)
        {
            if (Basic.validation.check_empty(roomidL.Text) == "no")
            {
                return;
            }
            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 updateQuery = "UPDATE `seat` SET `room` = '" + roomNoTB.Text + "',`capacity` = '" + capacityTB.Text + "',`hall_id` = '" + hallid + "' WHERE `seat`.`room_id` =" + roomidL.Text + "";

            df.Update(updateQuery);
            //end of update command runn
        }
Beispiel #3
0
        private void updateHallB_Click(object sender, EventArgs e)
        {
            if (hallNameTB.Text == "")
            {
                MessageBox.Show("Please fill up the Hall Name. ", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                hallNameTB.Focus();
                return;
            }
            try
            {
                // start of update command run
                string updateQuery = "update hall_info set hall_name='" + hallNameTB.Text.ToString() + "', type='" + hallTypeCB.SelectedItem.ToString() + "' where hall_id='" + hallIdL.Text.ToString() + "'";
                df.Update(updateQuery);
                //end of update command runn


                bi.load(searchHallCB, "hall_info", "hall_name");
            }
            catch (Exception ee) {
                MessageBox.Show("Error Occured. Message - " + ee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void updateStudentB_Click(object sender, EventArgs e)
        {
            if (Basic.validation.check_empty(studentIdL.Text) == "no")
            {
                return;
            }
            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 updatequery = "UPDATE `student_info` SET `session` = '" + sessionCB.SelectedItem + "',`class_roll` = '" + classRollTB.Text + "',`registration_no` = '" + registrationTB.Text + "',`name` = '" + studentNameTB.Text + "',`f_name` = '" + fatherNameTB.Text + "',`m_name` = '" + motherNameTB.Text + "',`address` = '" + addressTB.Text + "',`sex` = '" + sexCB.SelectedItem + "',`religion` = '" + religionTB.Text + "',`degree` = '" + degreeCB.SelectedItem + "',`mobile` = '" + mobileTB.Text + "',`phone` = '" + phoneTB.Text + "',`email` = '" + emailTB.Text + "',`blood_group` ='" + bloodGroupCB.SelectedItem + "', `alloted_room` = '" + roomTB.Text + "',`hall_id` = '" + hall_id + "',`dept_id` = '" + dept_id + "',`faculty_id` = '" + faculty_id + "',`qouta_id` = '" + qouta_id + "',`added_by` = '" + uid + "',`status` = '" + status + "' WHERE `hall_std_id` =" + studentIdL.Text + "";

            db.Update(updatequery);
            searchStudentToUpdateRB_CheckedChanged(s, EventArgs.Empty);
        }
        private void updateQoutaB_Click(object sender, EventArgs e)
        {
            if (qoutaNameTB.Text == "")
            {
                MessageBox.Show("Please fill up the qouta Name. ", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                qoutaNameTB.Focus();
                return;
            }
            try
            {
                // start of update command run
                string updateQuery = "update qouta set qouta_name='" + qoutaNameTB.Text.ToString() + "' where qouta_id='" + qoutaIdL.Text.ToString() + "'";
                df.Update(updateQuery);
                //end of update command runn

                Basic.information_load bn = new Basic.information_load();
                bn.load(searchQoutaCB, "qouta", "qouta_name");
            }
            catch (Exception ee)
            {
                MessageBox.Show("Error Occured. Message - " + ee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #6
0
        private void updateB_Click(object sender, EventArgs e)
        {
            string error = " ";

            if (newUsernameTB.Text == "" || newPasswordTB.Text == "" || newNameTB.Text == "")
            {
                if (newUsernameTB.Text == "")
                {
                    error = error + "\n* New User Name";
                }
                if (newPasswordTB.Text == "")
                {
                    error = error + "\n* New Password";
                }
                if (newNameTB.Text == "")
                {
                    error = error + "\n* New Name";
                }

                MessageBox.Show("Please input your" + error, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    //UPDATE `hallmanagement`.`user` SET `username` = 'raju', `password` = 'raju', `name` = 'Md. Mahfujur Rahman', `type` = 'Staff' WHERE `user`.`user_id` = 24;
                    String sql = "UPDATE `user` SET `username` = '" + newUsernameTB.Text + "', `password` = '" + newPasswordTB.Text + "', `name` = '" + newNameTB.Text + "', `type` = '" + typeCB.SelectedItem + "' WHERE `user`.`user_id` = " + uid + "";
                    dbo.Update(sql);
                    this.Close();
                }
                catch (Exception ee)
                {
                    MessageBox.Show("Message: " + ee.Message);
                    return;
                }
            }
        }
Beispiel #7
0
        private void updateDeptB_Click(object sender, EventArgs e)
        {
            if (deptNameTB.Text == "")
            {
                MessageBox.Show("Please fill up the dept Name. ", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                deptNameTB.Focus();
                return;
            }
            try
            {
                // start of update command run
                string updateQuery = "update dept_info set dept_name='" + deptNameTB.Text.ToString() + "', faculty_id='" + facultyNameCB.SelectedItem.ToString() + "' where dept_id='" + deptIdL.Text.ToString() + "'";
                df.Update(updateQuery);
                //end of update command runn

                Basic.information_load bn = new Basic.information_load();
                bn.load(searchDeptCB, "dept_info", "dept_name");
                bn.load(facultyNameCB, "faculty_info", "faculty_name");
            }
            catch (Exception ee)
            {
                MessageBox.Show("Error Occured. Message - " + ee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void updateStudentB_Click(object sender, EventArgs e)
        {
            if (Basic.validation.check_empty(remarkIDL.Text) == "no")
            {
                return;
            }

            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 update_query = "UPDATE `remark` SET `remarks` = '" + remarkTB.Text + "', `author` = '" + authorTB.Text + "', `hall_std_id` = '" + hall_std_IDL.Text + "' WHERE `remark`.`remark_id` =" + remarkIDL.Text;

            db.Update(update_query);
        }