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

            try
            {
                string query = @"SELECT [s_name]
      ,[f_name]
      ,[m_name]
      ,[pre_addr]
      ,[par_addr]
      ,[postoffice]
      ,[postalcode]
      ,[dateofbirth]
      ,[f_phoneno]
      ,[m_phoneno]
      ,[dist]
      ,[nationality]
      ,[student_id]
      ,[pass]
      ,[class]
      ,[section]
  FROM [dbo].[student_data] where [student_id] = '" + studentid.Text + "' or [student_name] = '" + studentid.Text + "' and [class] ='" + class_.SelectedItem.Value + "' and [section] = '" + section.SelectedItem.Value + "' ";

                student_details.DataSource = dc.GetData(query);
                student_details.DataBind();
            }

            catch (SqlException ex)
            {
            }
        }
        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";
            }
        }
Esempio n. 3
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);
        }
        public void noticegrid()
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [notice]
  FROM [dbo].[notice]";

            notice.DataSource = dc.GetData(query);
            notice.DataBind();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [sub_name]
  FROM [dbo].[subjects] where class = '" + insertid.Text + "'";

            subjects.DataSource = dc.GetData(query);
            subjects.DataBind();
        }
        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 teacher_button_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [t_name]
      ,[qualification]
      ,[cgpa]
      ,[teacher_id]
      ,[t_addr]
      ,[teacher_post]
      ,[post_type]
  FROM [dbo].[teacher_data]";

            teacher.DataSource = dc.GetData(query);
            teacher.DataBind();
        }
        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);
        }
        public void dashshow()
        {
            dataconnection dc = new dataconnection();
            String         connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
            SqlConnection  conn             = new SqlConnection(connectionString);

            SqlDataAdapter da = new SqlDataAdapter("select payable,due,paid from payment", conn);
            DataTable      dt = new DataTable();

            da.Fill(dt);

            TextBox1.Text = dt.Rows[0][0].ToString();

            TextBox2.Text = dt.Rows[0][1].ToString();

            TextBox3.Text = dt.Rows[0][2].ToString();
        }
Esempio n. 11
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            try
            {
                string query = @"SELECT [class]
      ,[classtest_one]
      ,[classtest_two]
      ,[classtest_three]
      ,[mid_exam]
      ,[final_exam]
      ,[sub_name]
  FROM [dbo].[students_mark] where [student_id] = '" + student_id.Text + "' and [section] = '" + section.SelectedItem.Value + "' and [class] ='" + class_.SelectedItem.Value + "'";

                student_result.DataSource = dc.GetData(query);
                student_result.DataBind();
            }

            catch
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "result Not Found" + "');", 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);
            }
        }