protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        MenuFunc subMenu = authService.myService.DaoGetVOById<MenuFunc>(int.Parse(ddlSubMenu.SelectedValue));

        if (subMenu.FuncionPaths == null)
        {
            subMenu.FuncionPaths = new List<FunctionPath>();
        }

        FunctionPath fph = new FunctionPath();
        fph.BelongMenuFunc = subMenu;
        fph.Path = txtPath.Text;
        authService.myService.DaoInsert(fph);
        subMenu.FuncionPaths.Add(fph);
        authService.myService.DaoUpdate(subMenu);

        lblMsg.Text = MsgVO.INSERT_OK;
        txtPath.Text = "";
        fillData();
    }
Esempio n. 2
0
    private void AddOtherPath(MenuFunc m1, string p)
    {
        if (m1.FuncionPaths == null)
        {
            m1.FuncionPaths = new List<FunctionPath>();
        }

        FunctionPath path = new FunctionPath();
        path.Path = p;
        path.BelongMenuFunc = m1;
        myService.DaoInsert(path);

        m1.FuncionPaths.Add(path);

        myService.DaoUpdate(m1);
    }