예제 #1
0
    protected void lbtnOpen_Click(object sender, EventArgs e)
    {
        string     queryName  = ((LinkButton)sender).CommandArgument;
        NamedQuery namedQuery = TheNamedQueryMgr.LoadNamedQuery(this.CurrentUser, queryName);

        if (namedQuery == null)
        {
            this.ShowErrorMessage("MasterData.NamedQuery.QueryNameNotExist", queryName);
        }
        else
        {
            string url = "~/Main.aspx?mid=" + namedQuery.UserControlPath
                         + "__mp--" + namedQuery.ModuleParameter;
            //+ "__act--" + BusinessConstants.PAGE_LIST_ACTION;
            this.Session["ACT"] = BusinessConstants.PAGE_LIST_ACTION;

            if (namedQuery.ActionParameter != null && namedQuery.ActionParameter.Trim() != string.Empty)
            {
                this.Session["AP"] = namedQuery.ActionParameter;
                //url += "__ap--" + namedQuery.ActionParameter;
            }

            this.Page.Response.Redirect(url);
        }
    }
예제 #2
0
    protected void lbtnDelete_Click(object sender, EventArgs e)
    {
        string queryName = ((LinkButton)sender).CommandArgument;

        try
        {
            TheNamedQueryMgr.DeleteNamedQuery(this.CurrentUser, queryName);
            this.ShowErrorMessage("MasterData.NamedQuery.DeleteSuccessful", queryName);
            this.UpdateView();
        }
        catch (BusinessErrorException ex)
        {
            this.ShowErrorMessage(ex);
        }
    }