protected void Button1_Click(object sender, EventArgs e)
    {
        int ID = int.Parse(dt.Rows[0]["Ins_id"].ToString());

        if (IsValid)
        {
            obj.TypeName     = "BussniessLayerInstructor";
            obj.UpdateMethod = "UpdateInstructor";
            obj.UpdateParameters.Clear();
            obj.UpdateParameters.Add("Ins_id", ID.ToString());
            obj.UpdateParameters.Add("Ins_name", TextBox1.Text);
            obj.UpdateParameters.Add("Dept_id", DropDownList1.SelectedValue);
            obj.Update();
        }
    }
Пример #2
0
 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     obj = (ObjectDataSource)Session["obj"];
     obj.UpdateMethod = "UpdateCourse";
     obj.UpdateParameters.Clear();
     Label id = (Label)GridView1.Rows[e.RowIndex].FindControl("ID_Lbl_Edit");
     TextBox name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Name_txtbox");
     obj.UpdateParameters.Add("C_ID", id.Text);
     obj.UpdateParameters.Add("C_Name", name.Text);
     obj.Update();
     GridView1.EditIndex = -1;
     GridView1.DataSource = obj;
     GridView1.DataBind();
     Session["obj"] = obj;
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        obj = new ObjectDataSource();
        obj.TypeName = "instructor";
        obj.UpdateMethod = "Edit";
        obj.UpdateParameters.Clear();
        int id =int.Parse(ds.Tables[0].Rows[0][0].ToString());
        string name = ds.Tables[0].Rows[0][1].ToString();
        string userName = ds.Tables[0].Rows[0][3].ToString();
        string Password= ds.Tables[0].Rows[0][4].ToString();
        obj.UpdateParameters.Add("id", id.ToString());
        obj.UpdateParameters.Add("ins_name", name);
        obj.UpdateParameters.Add("UserName", userName);
        obj.UpdateParameters.Add("password", Password);
        obj.Update();

        Session["obj"] = obj;

        Response.Redirect("Instructor.aspx");
    }
 protected void Button4_Click(object sender, EventArgs e)
 {
     if (IsValid)
     {
         string name  = TextBox9.Text;
         string BD    = TextBox10.Text;
         string phone = TextBox11.Text;
         string Addr  = TextBox12.Text;
         obj.TypeName     = "BussniessLayerStudents";
         obj.UpdateMethod = "UpdateAdmin";
         obj.UpdateParameters.Clear();
         obj.UpdateParameters.Add("Admin_id", ID);
         obj.UpdateParameters.Add("Admin_name", name);
         obj.UpdateParameters.Add("Admin_birthdate", BD);
         obj.UpdateParameters.Add("Admin_phone", phone);
         obj.UpdateParameters.Add("Admin_Address", Addr);
         obj.Update();
         Panel4.Enabled  = false;
         Button3.Enabled = true;
     }
 }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        obj = (ObjectDataSource)Session["obj"];
        obj.UpdateMethod = "UpdateStudent";
        obj.UpdateParameters.Clear();
        Label id = (Label)GridView1.Rows[e.RowIndex].FindControl("EditID");
        TextBox F_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_F_Name");
        TextBox L_Name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_L_Name");
        TextBox Address = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Address");
        TextBox Age = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Age");
        DropDownList Dept = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("Edit_Dept");
        DropDownList Leader = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("Edit_Leader");
        TextBox password = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Password");
        TextBox UserName = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_UserName");

        obj.UpdateParameters.Add("St_ID", id.Text);
        obj.UpdateParameters.Add("F_Name", F_name.Text);
        obj.UpdateParameters.Add("L_Name", L_Name.Text);
        obj.UpdateParameters.Add("Address", Address.Text);
        obj.UpdateParameters.Add("Age", Age.Text);
        obj.UpdateParameters.Add("Dept_No", Dept.SelectedValue);
        obj.UpdateParameters.Add("Leader", Leader.SelectedValue);
        obj.UpdateParameters.Add("password", password.Text);
        obj.UpdateParameters.Add("UserName", UserName.Text);
        obj.Update();

        GridView1.EditIndex = -1;
        GridView1.DataSource = obj;
        GridView1.DataBind();
        Session["obj"] = obj;
    }
Пример #6
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        obj = (ObjectDataSource)Session["obj"];
        obj.UpdateMethod = "update";
        obj.UpdateParameters.Clear();
        Label id = (Label)GridView1.Rows[e.RowIndex].FindControl("Edit_ID");
        TextBox name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Name");
        DropDownList Super = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("Edit_Super");
        TextBox Salary = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Salary");
        TextBox Password = (TextBox)GridView1.Rows[e.RowIndex].FindControl("Edit_Password");
        obj.UpdateParameters.Add("id", id.Text);
        obj.UpdateParameters.Add("ins_name", name.Text);
        obj.UpdateParameters.Add("Supins", Super.Text);
        obj.UpdateParameters.Add("salary", Salary.Text);
        obj.UpdateParameters.Add("password", Password.Text);
        obj.Update();

        GridView1.EditIndex = -1;
        GridView1.DataSource = obj;
        GridView1.DataBind();
        Session["obj"] = obj;
    }