示例#1
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();
    }
示例#2
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);
    }
示例#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)
    {
        if (!IsPostBack)
        {
            String nm;
            nm = Convert.ToString(Session["us"]);
            dbconnect  db33  = new dbconnect();
            SqlCommand cmd11 = new SqlCommand();
            cmd11.CommandText = "select dept_id from tbl_account where account_id=@id";
            cmd11.Parameters.AddWithValue("@id", nm);
            SqlDataReader dr11 = db33.executeread(cmd11);
            dr11.Read();
            TextBox1.Text = dr11.GetString(0);

            dbconnect  db34 = new dbconnect();
            SqlCommand cmd5 = new SqlCommand();
            cmd5.CommandText = "select * from tbl_account where dept_id=@did";
            cmd5.Parameters.AddWithValue("@did", TextBox1.Text);
            SqlDataReader dr1 = db34.executeread(cmd5);
            dr1.Read();
            while (dr1.Read())
            {
                DropDownList1.Items.Add(dr1.GetString(0));
            }
        }
    }
示例#6
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);*/
    }
示例#7
0
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox1.Enabled = true;
        TextBox2.Enabled = true;
        TextBox3.Enabled = true;
        TextBox4.Enabled = true;

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

        cmd5.CommandText = "select * from tbl_account where account_id=@aid";
        cmd5.Parameters.AddWithValue("@aid", DropDownList1.SelectedValue);
        SqlDataReader dr1 = db19.executeread(cmd5);

        dr1.Read();
        TextBox1.Text = dr1.GetString(1);
        TextBox2.Text = dr1.GetString(3);
        TextBox3.Text = dr1.GetString(4);
        TextBox4.Text = dr1.GetString(5);

        string des = dr1.GetString(2);
        string d   = "HOD";

        if (des == d)
        {
            RadioButtonList1.Items[1].Selected = true;
        }
        else
        {
            RadioButtonList1.Items[0].Selected = true;
        }
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String     s    = Convert.ToString(Session["us"]);
        dbconnect  db21 = new dbconnect();
        SqlCommand cmd5 = new SqlCommand();

        cmd5.CommandText = "select * from tbl_account where account_id=@cid";
        cmd5.Parameters.AddWithValue("@cid", s);
        SqlDataReader dr11 = db21.executeread(cmd5);

        dr11.Read();
        TextBox5.Text = dr11.GetString(3);

        if (!IsPostBack)
        {
            dbconnect  db1  = new dbconnect();
            SqlCommand cmd1 = new SqlCommand();
            cmd1.CommandText = "select branch_id from tbl_course";
            SqlDataReader dr1 = db1.executeread(cmd1);
            while (dr1.Read())
            {
                DropDownList4.Items.Add(dr1.GetString(0));
            }
        }
    }
示例#9
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox3.Enabled = false;
        dbconnect  db3  = new dbconnect();
        SqlCommand cmd3 = new SqlCommand();

        cmd3.CommandText = "select subject from tbl_sem where sub_code=@code";
        cmd3.Parameters.AddWithValue("@code", DropDownList2.SelectedValue);
        SqlDataReader dr10 = db3.executeread(cmd3);

        dr10.Read();
        TextBox3.Text = dr10.GetString(0);


        String     d    = TextBox5.Text;
        dbconnect  db4  = new dbconnect();
        SqlCommand cmd4 = new SqlCommand();

        cmd4.CommandText = "select * from tbl_account where dept_id=@id";
        cmd4.Parameters.AddWithValue("@id", d);
        SqlDataReader dr14 = db4.executeread(cmd4);

        while (dr14.Read())
        {
            DropDownList3.Items.Add(dr14.GetString(0));
        }
    }
示例#10
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);
    }
示例#11
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();
    }
示例#12
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");
        }
    }
示例#13
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbconnect  db24 = new dbconnect();
        SqlCommand cmd5 = new SqlCommand();

        db24.execute(cmd5);
    }
示例#14
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);
    }
示例#15
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);
    }
示例#16
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (textBox2.Text != "")
     {
         if (MessageBox.Show("Are you sure you want to Print Year wise Patient History??", "Patient History Print??", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             opd       opd = new opd();
             dbconnect db  = new dbconnect();
             medicineCount = 0;
             opd.getPatientOPDHistory(textBox1.Text, comboBox2.Text + "0101", (Convert.ToInt32(comboBox2.Text) + 1).ToString() + "0101", db);
             while (opd.dr.Read())
             {
                 medicine_id    = opd.dr[2].ToString().Split(',');
                 medicineCount += medicine_id.Length;
             }
             db.dbclose();
             try
             {
                 j = 1;
                 printDocument2.PrinterSettings.PrinterName = comboBox3.SelectedItem.ToString();
                 printDocument2.Print();
             }
             catch (Exception Ex)
             {
                 MessageBox.Show(Ex.Message + "\n\nPrinter Not Connected Properly!! Please Check that and then Print!!");
             }
         }
     }
     else
     {
         MessageBox.Show("Please Select a Patient from the list!!!");
     }
 }
示例#17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String sub, tchr, f;
        int    m, y;

        sub         = Convert.ToString(Session["subject"]);
        tchr        = Convert.ToString(Session["teacher"]);
        m           = Convert.ToInt32(Session["month"]);
        y           = Convert.ToInt32(Session["year"]);
        f           = Convert.ToString(Session["code"]);
        Label1.Text = Convert.ToString(m);
        Label2.Text = Convert.ToString(y);
        Label8.Text = Convert.ToString(f);
        Label3.Text = sub;
        Label4.Text = tchr;


        if (!IsPostBack)
        {
            dbconnect  db1 = new dbconnect();
            dbconnect  db2 = new dbconnect();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select * from tbl_qstn where qno=" + i + "";
            SqlCommand cmd1 = new SqlCommand();
            cmd1.CommandText = "select count(*) from tbl_qstn";
            count            = db2.id(cmd1);
            SqlDataReader dr = db1.executeread(cmd);

            while (dr.Read())
            {
                Label5.Text   = dr[0].ToString();
                TextBox1.Text = dr[1].ToString();
            }
        }
    }
示例#18
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);
    }
示例#19
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);
        }
    }
示例#20
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));
        }
    }
示例#21
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);
        }
    }
示例#22
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);
    }
示例#23
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);
    }
示例#24
0
    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);
    }
示例#25
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);
    }
示例#26
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);
    }
示例#27
0
    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);
    }
示例#28
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;
    }
示例#29
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);
    }
示例#30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbconnect  db  = new dbconnect();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from faculty";
        SqlDataReader dr = db.executeread(cmd);

        DataList1.DataSource = dr;
        DataList1.DataBind();
    }