Exemplo n.º 1
0
    protected void OnConfigurationRowCommand(object sender, GridViewCommandEventArgs e)
    {
        //Event handler for row command event
        switch (e.CommandName)
        {
        case "Insert":
            Label            lblApplication = (Label)this.grdConfig.FooterRow.FindControl("lblApplication");
            Label            lblUserName    = (Label)this.grdConfig.FooterRow.FindControl("lblUserName");
            TextBox          txtKey         = (TextBox)this.grdConfig.FooterRow.FindControl("txtKey");
            TextBox          txtValue       = (TextBox)this.grdConfig.FooterRow.FindControl("txtValue");
            Argix.AppService config         = new Argix.AppService();
            bool             created        = config.CreateConfigurationEntry(lblApplication.Text, lblUserName.Text, txtKey.Text, txtValue.Text, "1");
            this.grdConfig.DataBind();
            this.grdConfig.ShowFooter = false;
            break;

        case "Cancel":
            this.grdConfig.ShowFooter = false;
            break;
        }
    }