protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            if (con_password.Text.Equals(password.Text))
            {
                string query = @"INSERT INTO [dbo].[teacher_data]
           ([t_name]
           ,[qualification]
           ,[cgpa]
           ,[teacher_id]
           ,[t_addr]
           ,[t_password]
           ,[teacher_post]
           ,[post_type])
     VALUES  ('" + t_name.Text + "', '" + qualification.Text + "', '" + cgpa.Text + "', '" + teacher_id.Text + "', '" + t_addr.Text + "', '" + password.Text + "', '" + teacher_post.Text + "', '" + post_type.Text + "')";
                dc.executequary(query);
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Data Saved" + "');", true);
            }

            else
            {
                massage.Text = "Password Not Matched";
            }
        }
Ejemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            if (confirmpassword.Text.Equals(password.Text))
            {
                string query = @"INSERT INTO [dbo].[student_data]
           ([s_name]
           ,[f_name]
           ,[m_name]
           ,[pre_addr]
           ,[par_addr]
           ,[postoffice]
           ,[postalcode]
           ,[dateofbirth]
           ,[f_phoneno]
           ,[m_phoneno]
           ,[dist]
           ,[nationality]
           ,[student_id]
           ,[pass]
           ,[class]
           ,[section])
     VALUES ('" + s_name.Text + "', '" + f_name.Text + "', '" + m_name.Text + "', '" + pre_addr.Text + "', '" + par_addr.Text + "', '" + postoffice.Text + "', '" + postalcode.Text + "', '" + dateofbirth.Text + "', '" + f_phoneno.Text + "', '" + m_phoneno.Text + "', '" + dist.Text + "', '" + nationality.Text + "', '" + student_id.Text + "', '" + password.Text + "', '" + class_.SelectedItem.Value + "' ,'" + section.SelectedItem.Value + "')";

                dc.executequary(query);
            }

            else
            {
            }

            //Response.Redirect("ADMIN DASH.aspx");
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"DELETE FROM [dbo].[teacher_data]
      WHERE [teacher_id] = '" + delete_id.Text + "'";

            dc.executequary(query);
            ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Teacher Deleted" + "');", true);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"INSERT INTO [dbo].[notice]
           ([notice])
     VALUES ('" + notice.Text + "')";

            dc.executequary(query);
            ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Notice has been sent" + "');", true);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"INSERT INTO [dbo].[payment]
           ([class]
           ,[section]
           ,[student_id]
           ,[payable]
           ,[due]
           ,[paid])
     VALUES ('" + p_class.SelectedItem.Value + "', '" + p_section.SelectedItem.Value + "', '" + p_student_id.Text + "', '" + payable.Text + "', '" + due.Text + "','" + paid.Text + "')";

            dc.executequary(query);
            ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Saved" + "');", true);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            if (section.SelectedItem.Value == "- Select Section" && group.SelectedItem.Value != "- Select Group")
            {
                if (class_.SelectedItem.Text == "6" || class_.SelectedItem.Text == "7" || class_.SelectedItem.Text == "8")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + " Select Class 9 or 10" + "');", true);
                }
                else
                {
                    string query = @"INSERT INTO [dbo].[students_mark]
           ([class]
           ,[section]
           ,[student_id]
           ,[classtest_one]
           ,[classtest_two]
           ,[classtest_three]
           ,[mid_exam]
           ,[final_exam]
           ,[sub_name])
     VALUES ('" + class_.SelectedItem.Value + "', '" + group.SelectedItem.Value + "', '" + student_id.Text + "', '" + classtest_one.Text + "', '" + classtest_two.Text + "', '" + classtest_three.Text + "', '" + mid_exam.Text + "', '" + final_exam.Text + "', '" + subject_.SelectedItem.Value + "')";

                    dc.executequary(query);

                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Data Saved" + "');", true);
                }
            }

            else if (group.SelectedItem.Value == "- Select Group" && section.SelectedItem.Value != "- Select Section")
            {
                if (class_.SelectedItem.Text == "9" || class_.SelectedItem.Text == "10")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "select Please Class 6 or 7 or 8" + "');", true);
                }
                else
                {
                    string query = @"INSERT INTO [dbo].[students_mark]
           ([class]
           ,[section]
           ,[student_id]
           ,[classtest_one]
           ,[classtest_two]
           ,[classtest_three]
           ,[mid_exam]
           ,[final_exam]
           ,[sub_name])
     VALUES ('" + class_.SelectedItem.Value + "', '" + section.SelectedItem.Value + "', '" + student_id.Text + "', '" + classtest_one.Text + "', '" + classtest_two.Text + "', '" + classtest_three.Text + "', '" + mid_exam.Text + "', '" + final_exam.Text + "', '" + subject_.SelectedItem.Value + "')";

                    dc.executequary(query);

                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Data Saved" + "');", true);
                }
            }

            else if (group.SelectedItem.Value == "- Select Group" && section.SelectedItem.Value == "- Select Section")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + " Select Section or Group" + "');", true);
            }

            else if (group.SelectedItem.Value != "- Select Group" && section.SelectedItem.Value != "- Select Section")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Select a Section or a group" + "');", true);
            }
        }