コード例 #1
0
    protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e)
    {
        String x = RadioButtonList1.Text;

        FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName));
        fn = FileUpload1.FileName;

        if (x.Equals("Yes"))
        {
            MultiView1.ActiveViewIndex = 0;
        }
        else
        {
            MultiView1.ActiveViewIndex = 1;


            dbconnect  db5  = new dbconnect();
            SqlCommand cmd5 = new SqlCommand();
            cmd5.CommandText = "select guard_no from key_gen";
            SqlDataReader dr5 = db5.executeread(cmd5);
            dr5.Read();
            xx = dr5.GetInt32(0);
            xx++;
            string did = "GUARD_" + xx.ToString();
            TextBox14.Text = did;
            db5.execute(cmd5);
        }
    }
コード例 #2
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        // FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName));
        dbconnect  db5  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "insert into admission values(@adm_no,@class,@name,@photo,@aadhar,@dob,@mother,@religion,@nation,@state,@medium,@prev_school,@tc,@guardian_no,@status)";
        cmd2.Parameters.AddWithValue("@adm_no", TextBox1.Text);
        cmd2.Parameters.AddWithValue("@class", DropDownList1.SelectedValue);
        cmd2.Parameters.AddWithValue("@name", TextBox2.Text);
        // cmd2.Parameters.AddWithValue("@photo", "~/photos/" + FileUpload1.FileName);
        cmd2.Parameters.AddWithValue("@photo", "~/photos/" + fn);
        cmd2.Parameters.AddWithValue("@aadhar", TextBox3.Text);
        cmd2.Parameters.AddWithValue("@dob", TextBox4.Text);
        cmd2.Parameters.AddWithValue("@mother", TextBox5.Text);
        cmd2.Parameters.AddWithValue("@religion", TextBox6.Text);
        cmd2.Parameters.AddWithValue("@nation", TextBox7.Text);
        cmd2.Parameters.AddWithValue("@state", TextBox8.Text);
        cmd2.Parameters.AddWithValue("@medium", DropDownList2.SelectedValue);
        cmd2.Parameters.AddWithValue("@prev_school", TextBox10.Text);
        cmd2.Parameters.AddWithValue("@tc", TextBox11.Text);
        cmd2.Parameters.AddWithValue("@guardian_no", TextBox13.Text);

        cmd2.Parameters.AddWithValue("@status", "Notalloted");
        db5.execute(cmd2);
    }
コード例 #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db1  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "update faculty set post=@pst, email=@em, ph=@p where staff_id=@id";
        cmd1.Parameters.AddWithValue("@pst", DropDownList3.SelectedValue);
        cmd1.Parameters.AddWithValue("@em", TextBox8.Text);
        cmd1.Parameters.AddWithValue("@p", TextBox9.Text);
        cmd1.Parameters.AddWithValue("@id", TextBox1.Text);
        db1.execute(cmd1);


        dbconnect  db5  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "insert into qualification values(@staff_id,@class,@school,@board,@year,@mark)";
        cmd2.Parameters.AddWithValue("@staff_id", TextBox1.Text);
        cmd2.Parameters.AddWithValue("@class", DropDownList2.SelectedValue);
        cmd2.Parameters.AddWithValue("@school", TextBox4.Text);
        cmd2.Parameters.AddWithValue("@board", TextBox8.Text);
        cmd2.Parameters.AddWithValue("@year", TextBox10.Text);
        cmd2.Parameters.AddWithValue("@mark", TextBox9.Text);
        db5.execute(cmd2);
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = Request.QueryString["id"];

        TextBox5.Text = a;
        dbconnect  db2  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "select gallery_no from key_gen";
        SqlDataReader dr = db2.executeread(cmd1);

        dr.Read();
        int x = dr.GetInt32(0);

        x++;
        string galno = "G_" + x.ToString();

        TextBox1.Text = galno;


        dbconnect  db3  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "update key_gen set gallery_no=@x";
        cmd2.Parameters.AddWithValue("@x", x);
        db3.execute(cmd2);
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String     did = Session["divid"].ToString();
        dbconnect  db  = new dbconnect();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select div_allotment.adm_no from div_allotment,admission where divid=@did  and  div_allotment.adm_no=admission.adm_no order by name";
        cmd.Parameters.AddWithValue("@did", did);
        SqlDataReader dr2 = db.executeread(cmd);

        r = 1;
        while (dr2.Read())
        {
            String     adm  = dr2.GetString(0);
            dbconnect  db1  = new dbconnect();
            SqlCommand cmd1 = new SqlCommand();
            cmd1.CommandText = "update div_allotment set roll_no=@rol where adm_no=@adm";
            cmd1.Parameters.AddWithValue("@rol", r);
            cmd1.Parameters.AddWithValue("@adm", adm);
            r = r + 1;
            db1.execute(cmd1);
        }



        dbconnect  db2  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "select * from admission,div_allotment where admission.adm_no=div_allotment.adm_no";
        SqlDataReader dr3 = db2.executeread(cmd2);

        DataList1.DataSource = dr3;
        DataList1.DataBind();
    }
コード例 #6
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName));
        dbconnect  db5  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "insert into application values(@applic_no,@class,@name,@pic,@aadhar,@dob,@guardian,@occupation,@bank_no,@address,@relationship,@ph,@email,@mother,@rel,@nationality,@state,@medium,@prev_school,@tc,@status)";
        cmd2.Parameters.AddWithValue("@applic_no", TextBox1.Text);
        cmd2.Parameters.AddWithValue("@class", DropDownList1.SelectedValue);
        cmd2.Parameters.AddWithValue("@name", TextBox2.Text);
        cmd2.Parameters.AddWithValue("@pic", "~/photos/" + FileUpload1.FileName);
        cmd2.Parameters.AddWithValue("@aadhar", TextBox3.Text);
        cmd2.Parameters.AddWithValue("@dob", TextBox4.Text);
        cmd2.Parameters.AddWithValue("@guardian", TextBox5.Text);
        cmd2.Parameters.AddWithValue("@occupation", TextBox6.Text);
        cmd2.Parameters.AddWithValue("@bank_no", TextBox7.Text);
        cmd2.Parameters.AddWithValue("@address", TextBox8.Text);
        cmd2.Parameters.AddWithValue("@relationship", DropDownList2.Text);
        cmd2.Parameters.AddWithValue("@ph", TextBox9.Text);
        cmd2.Parameters.AddWithValue("@email", TextBox10.Text);
        cmd2.Parameters.AddWithValue("@mother", TextBox11.Text);
        cmd2.Parameters.AddWithValue("@rel", TextBox12.Text);
        cmd2.Parameters.AddWithValue("@nationality", TextBox13.Text);
        cmd2.Parameters.AddWithValue("@state", TextBox14.Text);
        cmd2.Parameters.AddWithValue("@medium", DropDownList3.SelectedValue);
        cmd2.Parameters.AddWithValue("@prev_school", TextBox15.Text);
        cmd2.Parameters.AddWithValue("@tc", TextBox16.Text);
        cmd2.Parameters.AddWithValue("@status", "applied");
        db5.execute(cmd2);
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            dbconnect  db4  = new dbconnect();
            SqlCommand cmd1 = new SqlCommand();
            cmd1.CommandText = "select fid from tbl_key";
            SqlDataReader dr = db4.executeread(cmd1);
            dr.Read();
            int x = dr.GetInt32(0);
            x++;
            string fid = "FED_" + x.ToString();
            TextBox6.Text = fid;

            dbconnect  db3  = new dbconnect();
            SqlCommand cmd2 = new SqlCommand();
            cmd2.CommandText = "update tbl_key set fid=@x";
            cmd2.Parameters.AddWithValue("@x", x);
            db3.execute(cmd2);
            Session["fid"] = TextBox6.Text;
        }
        dbconnect  db6  = new dbconnect();
        SqlCommand cmd4 = new SqlCommand();

        cmd4.CommandText = "select distinct dept_id from tbl_dept";
        SqlDataReader dr1 = db6.executeread(cmd4);

        while (dr1.Read())
        {
            DropDownList4.Items.Add(dr1.GetString(0));
        }
    }
コード例 #8
0
    /* protected void Button2_Click(object sender, EventArgs e)
     * {
     *    //FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName));
     *   dbconnect db4 = new dbconnect();
     *   SqlCommand cmd1 = new SqlCommand();
     *
     *   cmd1.CommandText = "insert into admission values(@adm_no,@class,@name,@photo,@aadhar,@dob,@mother,@religion,@nation,@state,@medium,@prev_school,@tc)";
     *   cmd1.Parameters.AddWithValue("@adm_no", "");
     *   cmd1.Parameters.AddWithValue("@class",Label2.Text);
     *   cmd1.Parameters.AddWithValue("@name", TextBox2.Text);
     * //   cmd1.Parameters.AddWithValue("@photo", "~/photos/" + FileUpload1.FileName);
     *   cmd1.Parameters.AddWithValue("@aadhar",TextBox3.Text);
     *   cmd1.Parameters.AddWithValue("@religion",TextBox13.Text);
     *   cmd1.Parameters.AddWithValue("@nation",TextBox14.Text);
     *   cmd1.Parameters.AddWithValue("@state",TextBox15.Text);
     *   cmd1.Parameters.AddWithValue("@medium",TextBox18.Text);
     *   cmd1.Parameters.AddWithValue("@prev_school",TextBox16.Text);
     *   cmd1.Parameters.AddWithValue("@tc",TextBox17.Text);
     *   db4.execute(cmd1);
     * }*/


    /* protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
     * {
     *
     *       dbconnect db4 = new dbconnect();
     *       SqlCommand cmd4 = new SqlCommand();
     *       cmd4.CommandText = "select div from division where class=@class";
     *      cmd4.Parameters.AddWithValue("@class", DropDownList1.SelectedValue);
     *       SqlDataReader dr2 = db4.executeread(cmd4);
     *       while (dr2.Read())
     *       {
     *           DropDownList2.Items.Add(dr2.GetString(0));
     *       }
     *       db4.execute(cmd4);
     *   }*/

    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        /* dbconnect db4 = new dbconnect();
         * SqlCommand cmd4 = new SqlCommand();
         * cmd4.CommandText = "select div_id from division where class=@class and div=@division";
         * cmd4.Parameters.AddWithValue("@class", DropDownList1.SelectedValue);
         * cmd4.Parameters.AddWithValue("@division",DropDownList2.SelectedValue);
         * SqlDataReader dr2 = db4.executeread(cmd4);
         * dr2.Read();
         * TextBox12.Text = dr2.GetString(0);
         * db4.execute(cmd4);
         */

        dbconnect  db5  = new dbconnect();
        SqlCommand cmd5 = new SqlCommand();

        cmd5.CommandText = "select name from admission,div_allot where admission.adm_no=div_allot.adm_no and div_allot.div_id=@div_id";
        cmd5.Parameters.AddWithValue("@div_id", TextBox12.Text);

        SqlDataReader dr3 = db5.executeread(cmd5);

        while (dr3.Read())
        {
            DropDownList3.Items.Add(dr3.GetString(2));
        }
        db5.execute(cmd5);
    }
コード例 #9
0
    protected void Button4_Click(object sender, EventArgs e)
    {
        dbconnect  db4  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "insert into faculty values(@staff_id,@name,@address,@dob,@sex,@post,@email,@ph)";
        cmd1.Parameters.AddWithValue("@staff_id", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@name", TextBox2.Text);
        cmd1.Parameters.AddWithValue("@address", TextBox6.Text);
        cmd1.Parameters.AddWithValue("@sex", RadioButtonList2.SelectedValue);
        cmd1.Parameters.AddWithValue("@dob", TextBox7.Text);
        cmd1.Parameters.AddWithValue("@post", DropDownList1.SelectedValue);
        cmd1.Parameters.AddWithValue("@email", TextBox4.Text);
        cmd1.Parameters.AddWithValue("@ph", TextBox5.Text);

        db4.execute(cmd1);



        /* dbconnect db5 = new dbconnect();
         * SqlCommand cmd2 = new SqlCommand();
         *
         * cmd2.CommandText = "insert into tbl_login values(@login_id,@password,@type)";
         * cmd2.Parameters.AddWithValue("@login_id", TextBox4.Text);
         * cmd2.Parameters.AddWithValue("@password", TextBox5.Text);
         * cmd2.Parameters.AddWithValue("@type", DropDownList1.SelectedValue);
         * db5.execute(cmd2);*/
    }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            dbconnect  db4  = new dbconnect();
            SqlCommand cmd4 = new SqlCommand();
            cmd4.CommandText = "select distinct class from division";
            SqlDataReader dr2 = db4.executeread(cmd4);
            while (dr2.Read())
            {
                DropDownList1.Items.Add(dr2.GetInt32(0).ToString());
            }
            db4.execute(cmd4);
        }



        dbconnect  db  = new dbconnect();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from admission where class=@class and status=@x";
        cmd.Parameters.AddWithValue("@class", Convert.ToInt32(DropDownList1.SelectedItem.Text));
        cmd.Parameters.AddWithValue("@x", "Notalloted");
        SqlDataReader dr = db.executeread(cmd);

        DataList1.DataSource = dr;
        DataList1.DataBind();
    }
コード例 #11
0
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        dbconnect  db2  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "select * from division where div_id=@id";
        cmd2.Parameters.AddWithValue("@id", DropDownList1.SelectedValue);
        SqlDataReader dr1 = db2.executeread(cmd2);

        dr1.Read();
        TextBox1.Text = dr1.GetInt32(1).ToString();
        TextBox2.Text = dr1.GetString(2);
        TextBox3.Text = dr1.GetString(3);
        TextBox5.Text = dr1.GetDateTime(4).ToShortDateString();
        dbconnect  db3  = new dbconnect();
        SqlCommand cmd3 = new SqlCommand();

        cmd3.CommandText = "select name from faculty where staff_id=@id";
        cmd3.Parameters.AddWithValue("@id", TextBox3.Text);
        SqlDataReader dr2 = db3.executeread(cmd3);

        dr2.Read();

        TextBox4.Text = dr2.GetString(0);


        //TextBox5.Text = dr.GetDateTime(4);
        db3.execute(cmd3);
    }
コード例 #12
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db5  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "insert into tbl_account values(@aid,@name,@desig,@di,@em,@ph,@st)";
        cmd1.Parameters.AddWithValue("@aid", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@name", TextBox2.Text);
        cmd1.Parameters.AddWithValue("@desig", DropDownList1.SelectedValue);
        cmd1.Parameters.AddWithValue("di", DropDownList2.SelectedValue);
        cmd1.Parameters.AddWithValue("@em", TextBox3.Text);
        cmd1.Parameters.AddWithValue("@ph", TextBox4.Text);
        cmd1.Parameters.AddWithValue("@st", "ok");

        db5.execute(cmd1);

        dbconnect  db6  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "insert into tbl_login values(@ac,@p,@d)";
        cmd2.Parameters.AddWithValue("@ac", TextBox1.Text);
        cmd2.Parameters.AddWithValue("@p", TextBox4.Text);
        cmd2.Parameters.AddWithValue("@d", DropDownList1.SelectedValue);
        db6.execute(cmd2);
    }
コード例 #13
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db6  = new dbconnect();
        SqlCommand cmd6 = new SqlCommand();

        cmd6.CommandText = "SELECT * from tbl_account where account_id=@acid";
        cmd6.Parameters.AddWithValue("@acid", TextBox1.Text);
        SqlDataReader dr2 = db6.executeread(cmd6);

        if (dr2.HasRows)
        {
            Response.Write("<script>confirm('Account Id alredy exists')</script>");
            //Server.Transfer("add_account.aspx");
            Server.Transfer("adminhome.aspx");
        }
        else
        {
            dbconnect  db5  = new dbconnect();
            SqlCommand cmd1 = new SqlCommand();

            cmd1.CommandText = "insert into tbl_account values(@aid,@name,@desig,@di,@em,@ph,@st,@ph)";
            cmd1.Parameters.AddWithValue("@aid", TextBox1.Text);
            cmd1.Parameters.AddWithValue("@name", TextBox2.Text);
            cmd1.Parameters.AddWithValue("@desig", DropDownList1.SelectedValue);
            cmd1.Parameters.AddWithValue("di", Label8.Text);
            cmd1.Parameters.AddWithValue("@em", TextBox3.Text);
            cmd1.Parameters.AddWithValue("@ph", TextBox4.Text);
            cmd1.Parameters.AddWithValue("@st", "ok");

            db5.execute(cmd1);
            Response.Write("<script>alert('Account Created')</script>");
            Server.Transfer("adminhome.aspx");
            //Response.Redirect("adminhome.aspx");
        }
    }
コード例 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = Request.QueryString["id"];

        TextBox1.Text = a;
        dbconnect  db2  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "select * from admission where adm_no=@adm_no";
        cmd2.Parameters.AddWithValue("@adm_no", a);
        SqlDataReader dr1 = db2.executeread(cmd2);

        dr1.Read();
        TextBox2.Text = dr1.GetString(2);
        TextBox3.Text = dr1.GetInt32(1).ToString();
        db2.execute(cmd2);

        if (!IsPostBack)
        {
            dbconnect  db4  = new dbconnect();
            SqlCommand cmd4 = new SqlCommand();
            cmd4.CommandText = "select div from division where class=@class";
            cmd4.Parameters.AddWithValue("@class", TextBox3.Text);
            SqlDataReader dr2 = db4.executeread(cmd4);
            while (dr2.Read())
            {
                DropDownList1.Items.Add(dr2.GetString(0));
            }
            db4.execute(cmd4);
        }
    }
コード例 #15
0
ファイル: mapping.ascx.cs プロジェクト: ashikplk9/feedback2
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db24 = new dbconnect();
        SqlCommand cmd5 = new SqlCommand();

        db24.execute(cmd5);
    }
コード例 #16
0
ファイル: mapping.ascx.cs プロジェクト: ashikplk9/feedback
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db24 = new dbconnect();
        SqlCommand cmd5 = new SqlCommand();

        cmd5.CommandText = "update tbl_sem set teacher='" + TextBox4.Text + "' Where subject='" + DropDownList2.SelectedValue + "' ";
        db24.execute(cmd5);
    }
コード例 #17
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db35 = new dbconnect();
        SqlCommand cmd4 = new SqlCommand();

        cmd4.CommandText = "update tbl_account set account_id='" + DropDownList1.SelectedValue + "',name='" + TextBox3.Text + "',email='" + TextBox4.Text + "',phone='" + TextBox5.Text + "',status='" + TextBox6.Text + "' Where account_id='" + DropDownList1.SelectedValue + "' ";
        db35.execute(cmd4);
    }
コード例 #18
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        dbconnect  db27 = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "Delete from tbl_feedback";
        db27.execute(cmd1);
    }
コード例 #19
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db7  = new dbconnect();
        SqlCommand cmd4 = new SqlCommand();

        cmd4.CommandText = "Delete from tbl_dept where dept_id=@did";
        cmd4.Parameters.AddWithValue("@did", DropDownList1.SelectedValue);
        db7.execute(cmd4);
    }
コード例 #20
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db3  = new dbconnect();
        SqlCommand cmd3 = new SqlCommand();

        cmd3.CommandText = "delete from division where div_id=@id";
        cmd3.Parameters.AddWithValue("@id", DropDownList1.SelectedValue);
        db3.execute(cmd3);
    }
コード例 #21
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Session["subject"] = DropDownList3.SelectedValue;
        Session["teacher"] = TextBox3.Text;
        Session["month"]   = TextBox4.Text;
        Session["year"]    = TextBox5.Text;
        Session["subcode"] = TextBox7.Text;
        int        q    = 1;
        dbconnect  db5  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();



        cmd1.CommandText = "insert into stud_feedback values(@fid,@dept,@course,@stream,@sem,@sub,@teacher,@month,@year,@subcod)";
        cmd1.Parameters.AddWithValue("@fid", TextBox6.Text);
        cmd1.Parameters.AddWithValue("@dept", DropDownList4.SelectedValue);
        cmd1.Parameters.AddWithValue("@course", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@stream", TextBox2.Text);
        cmd1.Parameters.AddWithValue("@sem", DropDownList5.SelectedValue);
        cmd1.Parameters.AddWithValue("sub", DropDownList3.SelectedValue);
        cmd1.Parameters.AddWithValue("@teacher", TextBox3.Text);
        cmd1.Parameters.AddWithValue("@month", TextBox4.Text);
        cmd1.Parameters.AddWithValue("@year", TextBox5.Text);
        cmd1.Parameters.AddWithValue("@subcod", TextBox7.Text);
        db5.execute(cmd1);
        SqlCommand cmd3 = new SqlCommand();

        while (q <= 18)
        {
            cmd3.CommandText = "insert into tbl_feedback values(@fid,@no,@op1,@op2,@op3,@op4,@op5,@op6)";
            cmd3.Parameters.AddWithValue("@fid", TextBox7.Text);
            cmd3.Parameters.AddWithValue("@no", q);
            cmd3.Parameters.AddWithValue("@op1", 0);
            cmd3.Parameters.AddWithValue("@op2", 0);
            cmd3.Parameters.AddWithValue("@op3", 0);
            cmd3.Parameters.AddWithValue("@op4", 0);
            cmd3.Parameters.AddWithValue("@op5", 0);
            cmd3.Parameters.AddWithValue("@op6", 0);
            q++;
            db5.execute(cmd3);
            cmd3.Parameters.Clear();
        }
        Response.Redirect("question.aspx");
    }
コード例 #22
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db3  = new dbconnect();
        SqlCommand cmd3 = new SqlCommand();

        cmd3.CommandText = "delete from tbl_account where account_id=@id";
        cmd3.Parameters.AddWithValue("@id", DropDownList1.SelectedValue);
        db3.execute(cmd3);
        Panel1.Visible = false;
    }
コード例 #23
0
ファイル: add_qstn.ascx.cs プロジェクト: ashikplk9/feedback
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db13 = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "insert into tbl_qstn values(@qid,@qstn)";
        cmd1.Parameters.AddWithValue("@qid", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@qstn", TextBox2.Text);
        db13.execute(cmd1);
    }
コード例 #24
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db2  = new dbconnect();
        SqlCommand cmd2 = new SqlCommand();

        cmd2.CommandText = "insert into tbl_qstn values(@no,@qn)";
        cmd2.Parameters.AddWithValue("@no", TextBox1.Text);
        cmd2.Parameters.AddWithValue("@qn", TextBox2.Text);
        db2.execute(cmd2);
    }
コード例 #25
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int        q    = 1;
        dbconnect  db3  = new dbconnect();
        SqlCommand cmd4 = new SqlCommand();

        cmd4.CommandText = "insert into stud_feedback values(@code,@dept,@course,@stream,@sem,@sub,@teacher,@month,@year)";
        cmd4.Parameters.AddWithValue("@code", TextBox7.Text);
        cmd4.Parameters.AddWithValue("@dept", DropDownList1.SelectedValue);
        cmd4.Parameters.AddWithValue("@course", TextBox1.Text);
        cmd4.Parameters.AddWithValue("@stream", TextBox2.Text);
        cmd4.Parameters.AddWithValue("@sem", DropDownList2.SelectedValue);
        cmd4.Parameters.AddWithValue("sub", DropDownList3.SelectedValue);
        cmd4.Parameters.AddWithValue("@teacher", TextBox3.Text);
        cmd4.Parameters.AddWithValue("@month", TextBox4.Text);
        cmd4.Parameters.AddWithValue("@year", TextBox5.Text);

        db3.execute(cmd4);
        SqlCommand cmd3 = new SqlCommand();

        while (q <= 18)
        {
            cmd3.CommandText = "insert into tbl_feedback values(@code,@no,@op1,@op2,@op3,@op4,@op5,@op6)";
            cmd3.Parameters.AddWithValue("@code", TextBox7.Text);
            cmd3.Parameters.AddWithValue("@no", q);
            cmd3.Parameters.AddWithValue("@op1", 0);
            cmd3.Parameters.AddWithValue("@op2", 0);
            cmd3.Parameters.AddWithValue("@op3", 0);
            cmd3.Parameters.AddWithValue("@op4", 0);
            cmd3.Parameters.AddWithValue("@op5", 0);
            cmd3.Parameters.AddWithValue("@op6", 0);
            q++;
            db3.execute(cmd3);
            cmd3.Parameters.Clear();
        }

        Response.Redirect("question.aspx");



        Button3.Visible = true;
    }
コード例 #26
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db1  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "update division set staff_id=@id where division_id=@did";

        cmd1.Parameters.AddWithValue("@id", DropDownList1.SelectedValue);
        cmd1.Parameters.AddWithValue("@did", TextBox1.Text);
        db1.execute(cmd1);
    }
コード例 #27
0
ファイル: add_dept.ascx.cs プロジェクト: ashikplk9/feedback
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "insert into tbl_dept values(@did,@crs,@strm,@no)";
        cmd1.Parameters.AddWithValue("@did", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@crs", TextBox2.Text);
        cmd1.Parameters.AddWithValue("@strm", TextBox3.Text);
        cmd1.Parameters.AddWithValue("@no", DropDownList1.SelectedValue);
        db1.execute(cmd1);
        Response.Redirect("Admin_home.aspx");
    }
コード例 #28
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db6  = new dbconnect();
        SqlCommand cmd3 = new SqlCommand();

        cmd3.CommandText = "insert into fee_pattern values(@fee_no,@fname,@description,@amount)";
        cmd3.Parameters.AddWithValue("@fee_no", TextBox1.Text);
        cmd3.Parameters.AddWithValue("@fname", TextBox2.Text);
        cmd3.Parameters.AddWithValue("@description", TextBox3.Text);
        cmd3.Parameters.AddWithValue("@amount", TextBox4.Text);
        db6.execute(cmd3);
    }
コード例 #29
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db1  = new dbconnect();
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "update fee_pattern set fname=@fn, description=@des, amount=@am where fee_no=@no";
        cmd1.Parameters.AddWithValue("@no", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@fn", TextBox2.Text);
        cmd1.Parameters.AddWithValue("@des", TextBox3.Text);
        cmd1.Parameters.AddWithValue("@am", TextBox4.Text);
        db1.execute(cmd1);
    }
コード例 #30
0
ファイル: add_dept.ascx.cs プロジェクト: ashikplk9/feedback2
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd1 = new SqlCommand();

        cmd1.CommandText = "insert into tbl_dept values(@did,@crs)";
        cmd1.Parameters.AddWithValue("@did", TextBox1.Text);
        cmd1.Parameters.AddWithValue("@crs", TextBox2.Text);


        db1.execute(cmd1);
        Response.Redirect("adminhome.aspx");
    }