Exemple #1
0
    protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Details")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView2.SelectedIndex = row.RowIndex;
            Guid id = new Guid(e.CommandArgument.ToString());
            GridView3.DataSource = bom.Query_BOMDetail(id);
            GridView3.DataBind();
            Label3.Text = id.ToString();
            Label4.Text = row.Cells[1].Text;

            Panel4.Visible  = true;
            Panel31.Visible = false;
            Panel41.Visible = false;
            Panel5.Visible  = false;
            Panel51.Visible = false;
            Panel6.Visible  = false;
            Panel8.Visible  = false;
            UpdatePanel8.Update();
            UpdatePanel4.Update();
            GridView3.SelectedIndex = -1;
            UpdatePanel3.Update();
            UpdatePanel5.Update();
            UpdatePanel6.Update();
        }
        if (e.CommandName == "Modify")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView2.SelectedIndex     = row.RowIndex;
            Label13.Text                = e.CommandArgument.ToString();
            Label12.Text                = row.Cells[1].Text;
            TextBox10.Text              = Label12.Text;
            DropDownList2.SelectedIndex = DropDownList2.Items.IndexOf(DropDownList2.Items.FindByText(row.Cells[2].Text));
            Label11.Text                = "修改";
            Panel4.Visible              = false;
            Panel31.Visible             = true;
            Panel41.Visible             = false;
            Panel5.Visible              = false;
            Panel51.Visible             = false;
            Panel6.Visible              = false;
            Panel8.Visible              = false;
            UpdatePanel8.Update();
            UpdatePanel6.Update();
            UpdatePanel4.Update();
            UpdatePanel5.Update();
        }
        if (e.CommandName == "Delete")
        {
            Guid id = new Guid(e.CommandArgument.ToString());
            bom.Delete_BOM(id);
            Guid BDF = new Guid(Label1.Text);
            GridView2.DataSource = bom.Query_BOM(BDF);
            GridView2.DataBind();
            Panel31.Visible = false;
            Panel4.Visible  = false;
            Panel41.Visible = false;
            Panel5.Visible  = false;
            Panel51.Visible = false;
            Panel6.Visible  = false;
            Panel8.Visible  = false;
            UpdatePanel8.Update();
            UpdatePanel6.Update();
            UpdatePanel5.Update();
            UpdatePanel4.Update();
        }
        if (e.CommandName == "Copy")
        {
            Guid id = new Guid(e.CommandArgument.ToString());
            Label3.Text = id.ToString();
            Guid BDF = new Guid(Label1.Text);
            GridView2.DataSource = bom.Query_BOM(BDF);
            GridView2.DataBind();
            Panel31.Visible      = false;
            Panel4.Visible       = false;
            Panel41.Visible      = false;
            Panel5.Visible       = false;
            Panel51.Visible      = false;
            Panel6.Visible       = true;
            GridView7.DataSource = bom.SeachBom(TextBox11.Text);
            GridView7.DataBind();
            Panel8.Visible = false;
            UpdatePanel8.Update();
            UpdatePanel6.Update();
            UpdatePanel5.Update();
            UpdatePanel4.Update();
        }
    }