protected void ASPxMenu2_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        SiteMapNode node = e.Item.DataItem as SiteMapNode;

        if (node != null)
        {
            e.Item.Text        = "<div><b>" + e.Item.Text + "</b> <br />" + node["description"] + "</div>"; // or some another tags like <a href=''>
            e.Item.NavigateUrl = node["url"];
        }
    }
Пример #2
0
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     FormsHelper.ToolBarClick(ucABM1, e.Item.Name, gv, ASPxGridViewExporter1);
 }
Пример #3
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnAdd":
                    FormsHelper.ClearControls(tblControls, new DTO.MonedasDTO());
                    FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);

                    TipoCambio = new List <DTO.TipoCambioDTO>();
                    RefreshAbmGrid(gvABM);

                    pnlControls.Visible    = true;
                    pnlControls.HeaderText = "Agregar Registro";
                    trDias.Visible         = true;
                    break;

                case "btnEdit":
                    if (FormsHelper.GetSelectedId(gv) != null)
                    {
                        FormsHelper.ClearControls(tblControls, new DTO.MonedasDTO());

                        var entity = Business.Monedas.Read(FormsHelper.GetSelectedId(gv).Value);

                        FormsHelper.FillControls(entity, tblControls);
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);

                        TipoCambio = Business.Monedas.ReadAllTiposCambio((string)entity.IdentifMon);

                        spDuracion0.Value = null;
                        deVigDesde0.Value = DateTime.Now;

                        gvABM.Attributes.Add("IdentifMon", entity.IdentifMon);

                        trDias.Visible = true;

                        RefreshAbmGrid(gvABM);

                        pnlControls.Attributes.Add("RecId", entity.RecId.ToString());
                        pnlControls.Visible    = true;
                        pnlControls.HeaderText = "Modificar Registro";
                    }
                    else
                    {
                        pnlControls.Visible = false;
                    }
                    break;

                case "btnDelete":
                    if (FormsHelper.GetSelectedId(gv) != null)
                    {
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete);
                        pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString());
                        pnlControls.Visible    = true;
                        pnlControls.HeaderText = "Eliminar Registros";
                    }
                    else
                    {
                        pnlControls.Visible = false;
                    }
                    break;

                case "btnExport":
                case "btnExportXls":
                    if (ASPxGridViewExporter1 != null)
                    {
                        ASPxGridViewExporter1.WriteXlsToResponse();
                    }
                    break;

                case "btnExportPdf":
                    if (ASPxGridViewExporter1 != null)
                    {
                        ASPxGridViewExporter1.WritePdfToResponse();
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblError, ex);
            }
        }