예제 #1
0
    void Search()
    {
        List <String> list = new List <string>();

        if (ddlSearch.SelectedValue.ToString().Equals("Company Name"))
        {
            list.Add(txtSearch.Text);
            list.Add("");
        }
        else
        {
            list.Add("");
            list.Add(txtSearch.Text);
        }
        SqlDataReader dr = new Shipper1().search(list);

        gvShipper.DataSource = null;
        gvShipper.DataSource = dr;
        gvShipper.DataBind();
    }
예제 #2
0
    //Cập nhật Shipper
    protected void btnUpdateShipper_Click(object sender, EventArgs e)
    {
        List <String> list = new List <string>();

        list.Add(this.txtCompanyName.Text);
        list.Add(this.txtPhone.Text);
        bool rs = false;

        if (lblShipperID.Text != "")
        {
            rs = new Shipper1().update(Int32.Parse(lblShipperID.Text), list);
        }
        else
        {
            rs = new Shipper1().insert(list);
        }
        if (rs)
        {
            Response.Write("<script language=\"javascript\">alert(\'Successful\');</script>");
        }

        LoadShipper();
    }