protected void OnBtnSaveClicked(object sender, EventArgs e)
    {
        ParamFunctionRepository repo = new ParamFunctionRepository();

        ParamFunction saveItem = new ParamFunction();
        saveItem.FunctionFamID = ddlFunctionFam.SelectedValue;
        saveItem.Label = txtLabel.Text.Trim();

        if (string.IsNullOrEmpty(Request.QueryString["FunctionID"]))
        {
            repo.Insert(saveItem);
        }
        else
        {
            saveItem.FunctionID = int.Parse(Request.QueryString["FunctionID"]);
            repo.Update(saveItem);
        }

        string script = "<script type=\"text/javascript\">";
        script += " OnBtnSaveClientClicked();";
        script += " </script>";

        if (!ClientScript.IsClientScriptBlockRegistered("redirectUser"))
            ClientScript.RegisterStartupScript(this.GetType(), "redirectUser", script);
    }
    protected void OnFunctionDeleteClicked(object sender, EventArgs e)
    {
        LinkButton lnkItem = (LinkButton)sender;
        int functionID = int.Parse(lnkItem.CommandArgument);

        ParamFunction deleteItem = new ParamFunction(functionID);
        ParamFunctionRepository repo = new ParamFunctionRepository();
        repo.Delete(deleteItem);

        BindGridData();
        gridFunction.DataBind();
    }