protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
                case "btnAdd":
                    FormsHelper.ClearControls(tblControls, new DTO.IdentAtencionDTO());
                    FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);
                    pnlControls.Visible = true;
                    pnlControls.HeaderText = "Agregar Registro";

                    break;

                case "btnEdit":
                    if (FormsHelper.GetSelectedId(gv) != null)
                    {
                        FormsHelper.ClearControls(tblControls, new DTO.IdentAtencionDTO());
                        var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion));
                        FormsHelper.FillControls(entity, tblControls);
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);
                        pnlControls.Attributes.Add("RecId", entity.RecId.ToString());
                        pnlControls.Visible = true;
                        pnlControls.HeaderText = "Modificar Registro";

                        TipIdentifChanged();
                    }
                    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;
            }
        }
示例#2
0
 private void LoadEmptyFile(object sender, MenuItemEventArgs <int> args)
 {
     Log("Empty save file, cancel");
     Cancel  = true;
     _update = true;
     BackToCredits();
 }
示例#3
0
 void ASPxMenuControl_ItemClick(object source, MenuItemEventArgs e)
 {
     if (e.Item != null && MenuItemToWrapperMap.ContainsKey(e.Item))
     {
         MenuItemToWrapperMap[e.Item].ExecuteAction();
     }
 }
示例#4
0
        private void PluginItemClicked(object sender, MenuItemEventArgs e)
        {
            switch (e.ItemKey)
            {
            case MenuKeys.QueryBuilder:
                FormHelper.ShowQueryBuilder(_context);
                break;

            case MenuKeys.Categories:
                FormHelper.ShowCategories(_context);
                break;

            case MenuKeys.LabelMover:
                _context.Map.CustomCursor = LabelMoverCursor.Instance;
                break;

            case MenuKeys.SymbolRotator:
                _context.Map.CustomCursor = SymbolRotaterCursor.Instance;
                break;

            case MenuKeys.Labels:
                FormHelper.ShowLabels(_context);
                break;

            case MenuKeys.Charts:
                FormHelper.ShowCharts(_context);
                break;
            }

            if (e.ItemKey == MenuKeys.LayerProperties)
            {
                FormHelper.ShowLayerProperties(_context);
            }
        }
示例#5
0
        private void MainChoice(object sender, MenuItemEventArgs <int> args)
        {
            switch (args.Value)
            {
            case 0:                     // Settings
                CloseMenus();
                SettingsMenu();
                break;

            case 1:                     // Patches
                CloseMenus();
                PatchesMenu();
                return;

            case 2:                     // Mods: Not yet implemented
                return;

            case 3:
                Destroy();
                return;

            case 4:
                Destroy();
                Runtime.Quit();
                return;
            }
        }
示例#6
0
    protected void dxMenu_OnItemDataBound(object sender, MenuItemEventArgs e)
    {
        var itm = e.Item;

        SQL_utils sql = new SQL_utils("backend");

        int mastertitleID = sql.IntScalar_from_SQLstring("select mastertitleID from vwStudyMastertitle where studyID = " + Master_studyID.ToString());

        sql.Close();

        List <string> nodes_to_hide = new List <string>();

        if (mastertitleID != 1)
        {
            nodes_to_hide.AddRange(new List <string> {
                "Clinic", "Calendar", "Other ID's", "Bernier Lab", "Tadpole", "PATH", "IBIS", "ESS"
                , "Sleep Pilot", "(old) Data Projects", "IntHx Data Summary", "IntHx Tx Types & Categories", "Reliability Tracking"
            });
        }

        if (mastertitleID != 2)
        {
            nodes_to_hide.Add("AVH");
        }

        itm.Visible = (nodes_to_hide.Contains(itm.Text)) ? false : true;
    }
示例#7
0
        private void SettingsChoice(object sender, MenuItemEventArgs <int> args)
        {
            CloseMenus();
            switch (args.Value)
            {
            case 0:                     // Graphics Mode
                GraphicsModeMenu();
                break;

            case 1:                     // Full Screen
                FullScreenMenu();
                break;

            case 2:                     // Scale
                WindowScaleMenu();
                break;

            case 3:                     // Aspect Ratio
                AspectRatioMenu();
                break;

            case 4:                     // Back
                MainMenu();
                break;
            }
        }
        /// <summary>
        /// Handles the Click event of the importContentTypesMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.MenuItemEventArgs"/> instance containing the event data.</param>
        void importContentTypesMenuItem_Click(object sender, MenuItemEventArgs e)
        {
            IExplorerNode contentTypeGroupNode = e.Owner as IExplorerNode;

            if (contentTypeGroupNode != null &&
                contentTypeGroupNode.ChildNodes != null &&
                contentTypeGroupNode.ChildNodes.Count() > 0)
            {
                //This will be valid if a user has already expanded the group node
                foreach (IExplorerNode childNode in contentTypeGroupNode.ChildNodes)
                {
                    ContentTypeNodeExtension.ImportContentType(childNode);
                }
            }
            else if (contentTypeGroupNode != null &&
                     contentTypeGroupNode.ChildNodes != null)
            {
                //This is valid if the user has not expanded the group node but we still need the ct's
                ContentTypeNodeInfo[] contentTypes = contentTypeGroupNode.Context.SharePointConnection.ExecuteCommand <string, ContentTypeNodeInfo[]>(ContentTypeSharePointCommandIds.GetContentTypesFromGroup, contentTypeGroupNode.Text);

                if (contentTypes != null)
                {
                    foreach (ContentTypeNodeInfo contentTypeNodeInfo in contentTypes)
                    {
                        ContentTypeInfo contentTypeInfo = contentTypeGroupNode.Context.SharePointConnection.ExecuteCommand <string, ContentTypeInfo>(ContentTypeSharePointCommandIds.GetContentTypeImportProperties, contentTypeNodeInfo.Name);

                        ContentTypeNodeExtension.ImportContentType(contentTypeInfo);
                    }
                }
            }
        }
        protected void UsuarioSeleccionaOpcionDeVista_ItemClick(object source, MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            try
            {
                switch (e.Item.Name)
                {
                case "UiBotonGenerarReporte":
                    if (UiVistaConsignacion.VisibleRowCount == 0)
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: No hay registros para mostrar. Por favor, verifique y vuelva a intentar.');", true);
                    }
                    else
                    {
                        GenerarReporte();
                        ASPxPopupControl1.ShowOnPageLoad = true;
                    }
                    break;

                case "btnExcel":
                    UIVistaReporteExportar.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
示例#10
0
        void MenuView_MenuSelected(object sender, MenuItemEventArgs e)
        {
            var id = e.SelectedItem?.Id;

            if (_currentPage == id)
            {
                IsPresented = false; return;
            }

            _currentPage = id;

            switch (id)
            {
            case "home":
                MainNavigation.PushAsync(new MainPage());
                break;

            case "about":
                Device.OpenUri(new Uri("https://www.github.com/ksivamuthu/XamAI"));
                break;

            case "settings":
                MainNavigation.PushAsync(new SettingsPage());
                break;
            }
            IsPresented = false;
        }
        /// <summary>
        /// Saves the file menu item click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="MenuItemEventArgs" /> instance containing the event data.</param>
        protected virtual void SaveFileMenuItemClick(object sender, MenuItemEventArgs e)
        {
            IExplorerNode parentNode   = e.Owner as IExplorerNode;
            var           fileNodeInfo = parentNode.Annotations.GetValue <FileNodeInfo>();

            DTEManager.SetStatus(CKSProperties.FileUtilities_SavingFile);

            Document      file      = DTEManager.DTE.ActiveDocument;
            TextSelection selection = file.Selection as TextSelection;

            selection.SelectAll();
            fileNodeInfo.Contents = selection.Text;
            selection.StartOfDocument();

            bool result = parentNode.Context.SharePointConnection.ExecuteCommand <FileNodeInfo, bool>(FileSharePointCommandIds.SaveFileCommand, fileNodeInfo);

            if (result)
            {
                DTEManager.SetStatus(CKSProperties.FileUtilities_FileSuccessfullySaved);
            }
            else
            {
                MessageBox.Show(CKSProperties.FileUtilities_FileSaveError, CKSProperties.FileUtilities_FileSaveErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#12
0
 public async Task OnTableContextMenuClick(MenuItemEventArgs args)
 {
     if (args.MenuItem.Key == "create-file")
     {
         await CreateFile().ConfigureAwait(true);
     }
 }
示例#13
0
        /// <summary>
        /// Handles the <see cref="E:Click" /> event.
        /// </summary>
        /// <param name="args">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
        public async Task OnClick(MouseEventArgs args)
        {
            if (Parent != null)
            {
                var eventArgs = new MenuItemEventArgs
                {
                    Text     = Text,
                    Path     = Path,
                    Value    = Value,
                    AltKey   = args.AltKey,
                    Button   = args.Button,
                    Buttons  = args.Buttons,
                    ClientX  = args.ClientX,
                    ClientY  = args.ClientY,
                    CtrlKey  = args.CtrlKey,
                    Detail   = args.Detail,
                    MetaKey  = args.MetaKey,
                    ScreenX  = args.ScreenX,
                    ScreenY  = args.ScreenY,
                    ShiftKey = args.ShiftKey,
                    Type     = args.Type,
                };
                await Parent.Click.InvokeAsync(eventArgs);

                if (Click.HasDelegate)
                {
                    await Click.InvokeAsync(eventArgs);
                }
            }
        }
示例#14
0
        protected void mMainRooms_ItemClick(object source, MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "mitNew":
                clearfields();
                divClasses.Visible = true;
                break;

            case "mitExportxls":
                expRooms.WriteCsvToResponse(new CsvExportOptionsEx()
                {
                    ExportType = ExportType.WYSIWYG
                });
                break;

            case "mitReport":
                Session["fromwhere"] = "~/abcclass.aspx";
                Session["report"]    = new mySmis.reports.rptProgramsLevels();
                Response.Redirect("~/documentviewer.aspx");
                break;
            }

            uPanel.Update();
        }
        public async Task MenuClicked(MenuItemEventArgs menuItem)
        {
            await CloseSideBar.InvokeAsync();

            switch (menuItem.Text)
            {
            case var _ when(Localizer.GetString("Home")) == menuItem.Text:
                NavManager.NavigateTo("/");

                break;

            case var _ when(Localizer.GetString("Login with WG.net ID")) == menuItem.Text:
                await Mediator.Publish(new LoginToWgMessage());

                break;

            case var _ when(Localizer.GetString("Search player")) == menuItem.Text:
                await Mediator.Publish(new OpenSearchDialogMessage(DialogType.FindPlayer));

                //await SearchDialogService.OpenSearchDialog(DialogType.FindPlayer);
                break;

            case var _ when(Localizer.GetString("Search clan")) == menuItem.Text:
                await Mediator.Publish(new OpenSearchDialogMessage(DialogType.FindClan));

                break;
            }
        }
        protected void UiMenuDetalle_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnExcel":
                    ASPxGridViewExporter2.WriteXlsxToResponse();
                    break;

                case "btnReport":
                    ReportViewDetalle();
                    ASPxPopupControl2.ShowOnPageLoad = true;
                    break;

                case "btnBill":
                    ValidarPickinFacturacion();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        protected void UiMenuOpcionesMapa_ItemClick(object source, MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            try
            {
                switch (e.Item.Name)
                {
                case "UiBotonExcelPoligonos":
                    UIVistaExportar.GridViewID = "UiVistaPolignos";
                    UIVistaExportar.WriteXlsxToResponse();
                    break;

                case "UiBotonExcelClientes":
                    UIVistaExportar.GridViewID = "UiVistaCliente";
                    UIVistaExportar.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
示例#18
0
        protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnExport":
                {
                    ASPxGridViewExporter1.GridViewID = "gv";

                    XlsExportOptions xlsOpciones = new XlsExportOptions(TextExportMode.Text, true, false);
                    ASPxGridViewExporter1.DataBind();
                    ASPxGridViewExporter1.WriteXlsToResponse(xlsOpciones);

                    break;
                }

                case "btnLimpiar":
                {
                    gv.DataSource = null;
                    gv.DataBind();

                    mnuPrincipal.Items[0].Enabled = false;

                    break;
                }

                default: break;
                }
            }
            catch (Exception ex)
            {
                string a = ex.Message;
            }
        }
        protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            try
            {
                switch (e.Item.Name)
                {
                case "btnReport":
                    ReportView();
                    ASPxPopupControl1.ShowOnPageLoad = true;
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnRefresh":
                    GetValorizationInventory();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
示例#20
0
        protected void InfoMenu_OnItemDataBound(object sender, MenuItemEventArgs e)
        {
            IHierarchyData itemHierarchyData = (IHierarchyData)e.Item.DataItem;
            var            element           = (XmlElement)itemHierarchyData.Item;

            var classAttr = element.Attributes["SpriteClassName"];

            if (classAttr != null)
            {
                e.Item.Image.SpriteProperties.CssClass = classAttr.Value;
            }

            if (e.Item.Parent.Name == "theme" && e.Item.Name == Utils.CurrentTheme)
            {
                e.Item.Selected = true;
            }

            if (e.Item.Name == "print")
            {
                var url = GetPrintItemNavigationUrl();
                if (string.IsNullOrEmpty(url))
                {
                    e.Item.Visible = false;
                }
                else
                {
                    e.Item.NavigateUrl = url;
                }
            }
        }
示例#21
0
        private void Plugin_ItemClicked(object sender, MenuItemEventArgs e)
        {
            if (HandleGroupOperation(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            if (HandleMapCursorChange(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            if (HandleSnapSetting(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            if (HandleLayerKeys(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            if (HandleUndoRedo(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            _context.View.Update();
        }
示例#22
0
        protected void ASpxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnReport":
                    ASPxPopupControl2.ShowOnPageLoad = true;
                    ReportView();
                    break;

                case "btnRefresh":
                    LoadGridView(Convert.ToInt32(Session["IDINCOME"]));
                    break;

                case "btnBill":
                    ValidarPickinFacturacion();
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        //</Snippet3>

        void MenuItemExtension_Click(object sender, MenuItemEventArgs e)
        {
            ISharePointProjectItem projectItem = (ISharePointProjectItem)e.Owner;

            projectItem.Project.ProjectService.Logger.WriteLine(
                String.Format("This message was written from a shortcut menu for {0}.", projectItem.Name),
                LogCategory.Status);
        }
示例#24
0
 private void MenuItemClick(object sender, MenuItemEventArgs e)
 {
     ISharePointProjectItem projectItem = (ISharePointProjectItem)e.Owner;
     string message = String.Format("You clicked the menu on the {0} item. " +
         "You could perform some related task here, such as displaying a designer " +
         "for the custom action.", projectItem.Name);
     System.Windows.Forms.MessageBox.Show(message, "Contoso Custom Action");
 }
示例#25
0
        public void FireItemClicked(object sender, MenuItemEventArgs e)
        {
            var handler = ItemClicked;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
示例#26
0
        private void BroadcastPluginItemClicked(object sender, MenuItemEventArgs e)
        {
            var item = sender as IMenuItem;

            if (item != null)
            {
                BroadcastEvent(p => p.ItemClicked_, sender, e, item.PluginIdentity);
            }
        }
        /// <summary>
        /// Import the selected content type into the currently selected project.
        /// </summary>
        /// <param name="e">The MenuItemEventArgs object.</param>
        void ImportContentType(MenuItemEventArgs e)
        {
            IExplorerNode owner = (IExplorerNode)e.Owner;

            if (owner != null)
            {
                ImportContentType(owner);
            }
        }
示例#28
0
 private void PluginItemClicked(object sender, MenuItemEventArgs e)
 {
     switch (e.ItemKey)
     {
     case MenuKeys.ShowTable:
         ShowTableEditor();
         break;
     }
 }
示例#29
0
        private void MenuItemClick(object sender, MenuItemEventArgs e)
        {
            ISharePointProjectItem projectItem = (ISharePointProjectItem)e.Owner;
            string message = String.Format("You clicked the menu on the {0} item. " +
                                           "You could perform some related task here, such as displaying a designer " +
                                           "for the custom action.", projectItem.Name);

            System.Windows.Forms.MessageBox.Show(message, "Contoso Custom Action");
        }
示例#30
0
        protected void mMaineditpermissions_ItemClick(object source, MenuItemEventArgs e)
        {
            if (e.Item.Name == "mitCancel")
            {
                div_editpermissions.Visible = false;
            }

            uPanel.Update();
        }
示例#31
0
        private void SetCompetition(object sender, MenuItemEventArgs <int> args)
        {
            _competition = (7 - args.Value);
            CloseMenus();
            Log("Competition: {0} Civilizations", _competition);

            _tribesAvailable = Common.Civilizations.Where(c => c.PreferredPlayerNumber > 0 && c.PreferredPlayerNumber <= _competition).ToArray();
            _menuItemsTribes = _tribesAvailable.Select(c => c.Name).ToArray();
        }
示例#32
0
 protected void ASPxMenu2_ItemClick(object source, MenuItemEventArgs e)
 {
     if (e.Item.Name == "HelpItem")
     {
         getAssemblyVersionInfo();
         getBuildInfo();
         ASPxPopupControl1.ShowOnPageLoad = true;
     }
 }
        void ImportListInstanceExplorerExtension_Click(object sender, MenuItemEventArgs e)
        {
            IExplorerNode listNode = e.Owner as IExplorerNode;

            if (listNode != null) {
                try {
                    IListNodeInfo listInfo = listNode.Annotations.GetValue<IListNodeInfo>();

                    string listInstanceContents = listNode.Context.SharePointConnection.ExecuteCommand<Guid, string>(CommandIds.GetListInstanceXmlCommandId, listInfo.Id);
                    XNamespace xn = "http://schemas.microsoft.com/sharepoint/";
                    string moduleContents = new XElement(xn + "Elements",
                        XElement.Parse(listInstanceContents)).ToString().Replace(" xmlns=\"\"", String.Empty);

                    EnvDTE.Project activeProject = Utils.GetActiveProject();
                    if (activeProject != null) {
                        ISharePointProjectService projectService = listNode.ServiceProvider.GetService(typeof(ISharePointProjectService)) as ISharePointProjectService;
                        ISharePointProject activeSharePointProject = projectService.Projects[activeProject.FullName];
                        if (activeSharePointProject != null) {
                            string spiName = listInfo.Title;
                            ISharePointProjectItem listInstanceProjectItem = null;
                            bool itemCreated = false;
                            int counter = 0;

                            do {
                                try {
                                    listInstanceProjectItem = activeSharePointProject.ProjectItems.Add(spiName, "Microsoft.VisualStudio.SharePoint.ListInstance");
                                    itemCreated = true;
                                }
                                catch (ArgumentException) {
                                    spiName = String.Format("{0}{1}", listInfo.Title, ++counter);
                                }
                            }
                            while (!itemCreated);

                            string elementsXmlFullPath = Path.Combine(listInstanceProjectItem.FullPath, "Elements.xml");
                            System.IO.File.WriteAllText(elementsXmlFullPath, moduleContents);
                            ISharePointProjectItemFile elementsXml = listInstanceProjectItem.Files.AddFromFile("Elements.xml");
                            elementsXml.DeploymentType = DeploymentType.ElementManifest;
                            elementsXml.DeploymentPath = String.Format(@"{0}\", spiName);
                            listInstanceProjectItem.DefaultFile = elementsXml;

                            Utils.OpenFile(Path.Combine(elementsXmlFullPath));
                        }
                    }
                }
                catch (Exception ex) {
                    listNode.Context.ShowMessageBox(String.Format("The following exception occured while exporting List Instance: {0}", ex.Message), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#34
0
        protected void menuInner_ItemDataBound(object sender, MenuItemEventArgs e)
        {
            if (e.Item.Name != "")
            {
                var doc = XmlDataSourceMenuInner.GetXmlDocument();
                foreach (XmlNode xmlNode in doc.GetElementsByTagName(NameNode))
                {
                    if (xmlNode.Attributes != null && xmlNode.Attributes[IdAttribute] != null && xmlNode.Attributes[IdAttribute].Value == e.Item.Name)
                    {
                        if (xmlNode.Attributes[IsReportAttribute] != null)
                        {
                            string nameReport = "";
                            var paramsStringBuilder = new StringBuilder();
                            foreach (XmlAttribute xmlAttribute in xmlNode.Attributes)
                            {
                                if (xmlAttribute.Name != IdAttribute && xmlAttribute.Name != IsReportAttribute &&
                                    xmlAttribute.Name != TextAttribute)
                                {
                                    switch (xmlAttribute.Name)
                                    {
                                        case ReportNameAttribute:
                                            {
                                                nameReport = xmlAttribute.Value;
                                                break;
                                            }
                                        case Constants.SsrsSetting.NameParamMonth:
                                            {
                                                paramsStringBuilder.Append(Constants.SsrsSetting.NameParamMonth);

                                                if (xmlAttribute.Value == IsParamValue)
                                                {
                                                    paramsStringBuilder.Append("=");
                                                    paramsStringBuilder.Append(
                                                        Session[Constants.SessionVariables.NameParamMonth]);
                                                }
                                                else
                                                {
                                                    if (xmlAttribute.Value != "")
                                                    {
                                                        paramsStringBuilder.Append("=");
                                                        paramsStringBuilder.Append(xmlAttribute.Value);
                                                    }
                                                    else
                                                        paramsStringBuilder.Append(":isnull=true");

                                                }
                                                paramsStringBuilder.Append("&");
                                                break;
                                            }
                                        case Constants.SsrsSetting.NameParamYear:
                                            {
                                                paramsStringBuilder.Append(Constants.SsrsSetting.NameParamYear);

                                                if (xmlAttribute.Value == IsParamValue)
                                                {
                                                    paramsStringBuilder.Append("=");
                                                    paramsStringBuilder.Append(
                                                        Session[Constants.SessionVariables.NameParamYear]);
                                                }
                                                else
                                                {
                                                    if (xmlAttribute.Value != "")
                                                    {
                                                        paramsStringBuilder.Append("=");
                                                        paramsStringBuilder.Append(xmlAttribute.Value);
                                                    }
                                                    else
                                                        paramsStringBuilder.Append(":isnull=true");

                                                }
                                                paramsStringBuilder.Append("&");
                                                break;
                                            }
                                        case Constants.SsrsSetting.NameParamArm:
                                            {
                                                paramsStringBuilder.Append(Constants.SsrsSetting.NameParamArm);

                                                if (xmlAttribute.Value == IsParamValue)
                                                {
                                                    paramsStringBuilder.Append("=");
                                                    paramsStringBuilder.Append(
                                                        Session[Constants.SessionVariables.NameParamArm]);
                                                }
                                                else
                                                {
                                                    if (xmlAttribute.Value != "")
                                                    {
                                                        paramsStringBuilder.Append("=");
                                                        paramsStringBuilder.Append(xmlAttribute.Value);
                                                    }
                                                    else
                                                        paramsStringBuilder.Append(":isnull=true");

                                                }
                                                paramsStringBuilder.Append("&");
                                                break;
                                            }
                                        default:
                                            {
                                                paramsStringBuilder.Append(xmlAttribute.Name);
                                                
                                                if (xmlAttribute.Value != IsParamValue)
                                                {
                                                    if (xmlAttribute.Value != "")
                                                    {
                                                        paramsStringBuilder.Append("=");
                                                        paramsStringBuilder.Append(xmlAttribute.Value);
                                                    }
                                                    else
                                                        paramsStringBuilder.Append(":isnull=true");
                                                }
                                                paramsStringBuilder.Append("&");
                                                break;
                                            }

                                    }


                                }
                            }
                            if (paramsStringBuilder.Length!=0 &&paramsStringBuilder[paramsStringBuilder.Length-1] == '&') 
                                paramsStringBuilder.Remove(paramsStringBuilder.Length - 1, 1);
                            e.Item.NavigateUrl = UrlHandlerUtility.GetPageSsrsUrl(nameReport, paramsStringBuilder.ToString());


                        }
                    }
                }

            }

        }
        protected void mnuDetalle_ItemClick(object source, MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
                case "btnInsert":
                    InsertItems();
                    break;

                case "btnEdit":
                    EditItem();
                    break;

                case "btnDelete":
                    DeleteItems();
                    break;

                case "btnSelectAll":
                    {
                        int PosicionActual = gv.VisibleStartIndex;

                        int Maximo = PosicionActual + gv.SettingsPager.PageSize - 1;

                        for (int i = PosicionActual; i <= Maximo; i++)
                        {

                            gv.Selection.SelectRow(i);
                        }

                        break;
                    }
                case "btnSelect0":
                    {
                        for (int i = 0; i <= gv.SettingsPager.PageSize - 1; i++)
                        {
                            gv.Selection.SelectRow(i);
                        }

                        break;
                    }

                case "btnCopy":
                    CopyItems();
                    break;

                case "btnReplace":
                    ReplaceItems();
                    break;

                default:
                    break;
            }
        }
        protected void mnuDetalle_ItemClick(object source, MenuItemEventArgs e)
        {
            string msg = string.Empty;

            if (!ValidarFranjaHoraria(ref msg))
                lblErrorLineas.Text = msg;

            switch (e.Item.Name)
            {
                case "btnInsert": InsertItems(); break;
                case "btnEdit": EditItem(); break;
                case "btnDelete": DeleteItems(); break;
                case "btnCopy": CopyItems(); break;
                case "btnReplace": ReplaceItems(); break;
                case "btnSKU": QuerySKU(); break;
                default: break;
            }
        }
 protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
 {
     FormsHelper.ToolBarClick(ucABM1, e.Item.Name, gv, null);
 }
        //------------------------------------------------------------------------------
        // Class: OptionBSelected
        // Author: nholmes
        // Summary: triggered if the user selcects option B
        //------------------------------------------------------------------------------
        void OptionBSelected(object sender, MenuItemEventArgs e)
        {
            // call the question box option selected event handler with option B selected
            OptionSelected(this, new QuestionBoxEventArgs(SelectedOption.optionB));

            // close the question box
            CloseState();
        }
 protected void ASPxMenu1_ItemClick1(object source, MenuItemEventArgs e)
 {
 }
        protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                    case "btnExport":
                        {
                            ASPxGridViewExporter1.GridViewID = "gv";

                            XlsExportOptions xlsOpciones = new XlsExportOptions(TextExportMode.Text, true, false);
                            ASPxGridViewExporter1.DataBind();
                            ASPxGridViewExporter1.WriteXlsToResponse(xlsOpciones);

                            break;
                        }
                    case "btnLimpiar":
                        {
                            gv.DataSource = null;
                            gv.DataBind();

                            mnuPrincipal.Items[0].Enabled = false;

                            break;
                        }

                    default: break;
                }

            }
            catch (Exception ex)
            {
                string a = ex.Message;
            }
        }
        protected void mnuDetalle_ItemClick(object source, MenuItemEventArgs e)
        {
            string msg = string.Empty;

            if (!ValidarFranjaHoraria(ref msg))
                lblErrorLineas.Text = msg;

            switch (e.Item.Name)
            {
                case "btnInsert": InsertItems(); break;
                case "btnEdit": EditItem(); break;
                case "btnDelete": DeleteItems(); break;
                case "btnSelectAll":
                    {
                        int PosicionActual = gv.VisibleStartIndex;

                        int Maximo = PosicionActual + gv.SettingsPager.PageSize - 1;

                        for (int i = PosicionActual; i <= Maximo; i++)
                        {

                            gv.Selection.SelectRow(i);
                        }

                        break;
                    }
                case "btnSelect0":
                    {
                        for (int i = 0; i <= gv.SettingsPager.PageSize - 1; i++)
                        {
                            gv.Selection.SelectRow(i);
                        }

                        break;
                    }

                case "btnCopy": CopyItems(); break;
                case "btnReplace": ReplaceItems(); break;
                case "btnSKU": QuerySKU(); break;
                default: break;
            }
        }
 void ContextMenuClicked(object sender, MenuItemEventArgs e)
 {
     MessageBox.Show("Hello From a SharePoint project extension");
 }
示例#43
0
    protected void mnExport_ItemClick(object source, MenuItemEventArgs e)
    {
        try
        {
            DataTable listdata = ObjectUtils.getExportSetting(pageModuleID);
            if (listdata.Rows.Count > 0)
            {
                baseGVExport.ReportHeader = listdata.Rows[0]["reportheader"].ToString();
                if (Session["strdatetime"] != null)
                {
                    string[] arrDate = Session["strdatetime"].ToString().Split('#');
                    baseGVExport.ReportHeader = baseGVExport.ReportHeader.Replace(@"\~\{0\}", arrDate[0]).Replace(@"\~\{1\}}", arrDate[1]);
                }

                baseGVExport.ReportFooter = listdata.Rows[0]["ReportFooter"].ToString();
                baseGVExport.Landscape = bool.Parse(listdata.Rows[0]["Landscape"].ToString());

                //baseGVExport.PaperKind =
                //    (PaperKind)
                //    Enum.Parse(typeof(PaperKind), listdata.Rows[0]["PaperKind"].ToString());
                baseGVExport.FileName = listdata.Rows[0]["FileName"].ToString();

            }
            if (gv == null)
                baseGVExport.GridViewID = "grid";
            else
                baseGVExport.GridViewID = gv.ID;

            if (e.Item.Name != "")
            {
                if (treelist == null)
                {
                    baseGVExport.ExportedRowType = DevExpress.Web.ASPxGridView.Export.GridViewExportedRowType.All;

                    switch (e.Item.Name)
                    {
                        case "PDF":
                            baseGVExport.WritePdfToResponse();
                            break;
                        case "DOC":
                            baseGVExport.WriteRtfToResponse();
                            break;
                        case "XLS":
                            baseGVExport.WriteXlsToResponse();
                            break;
                        case "CVS":
                            baseGVExport.WriteCsvToResponse();
                            break;
                        case "XLS2007":
                            baseGVExport.WriteXlsxToResponse();
                            break;
                        default:
                            baseGVExport.WriteCsvToResponse();
                            break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            LogAction(0, ex.ToString());
            throw new Exception(ex.ToString());
        }
    }
        //------------------------------------------------------------------------------
        // Function: QuitMenuItemSelected
        // Author: nholmes
        // Summary: event handler for when the Quit menu item is selected
        //------------------------------------------------------------------------------
        void QuitMenuItemSelected(object sender, MenuItemEventArgs e)
        {
            // create a question box game state
            QuestionBox questionBox = new QuestionBox(game, e.PlayerIndex, "EXIT GAME", "Are you sure?", "No", "Yes");

            // hook up event handlers for the question box
            questionBox.OptionSelected += QuestionBoxOptionSelected;

            // add a qustion box state to check if the user is really sure they want to exit
            gameStateManager.AddGameState(questionBox);
        }
 protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
 {
     mnuPrincipal_ItemClick1(source, e);
 }
 private void ASPxMenuControl_ItemClick(object source, MenuItemEventArgs e){
     if (e.Item != null && MenuItemToWrapperMap.ContainsKey(e.Item)){
         MenuItemToWrapperMap[e.Item].ExecuteAction();
     }
 }
 //------------------------------------------------------------------------------
 // Function: OnCancel
 // Author: nholmes
 // Summary: helper overload makes it easy to use OnCancel as a MenuItem event handler
 //------------------------------------------------------------------------------
 protected void OnCancel(object sender, MenuItemEventArgs e)
 {
     OnCancel(e.PlayerIndex);
 }
 //------------------------------------------------------------------------------
 // Function: AchievementsMenuItemSelected
 // Author: nholmes
 // Summary: event handler for when the achievements menu item is selected
 //------------------------------------------------------------------------------
 void AchievementsMenuItemSelected(object sender, MenuItemEventArgs e)
 {
     // add the options menu state to the top of the stack
     gameStateManager.AddGameState(new AchievementsMenu(game, e.PlayerIndex));
 }
        protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                    case "btnAdd":

                        FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO());
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);

                        pnlDias.Visible         = false;
                        Detalles                = new List<DTO.FrecuenciaDetDTO>();

                        RefreshAbmGrid(gvABM);

                        pnlControls.Visible     = true;
                        pnlControls.HeaderText  = "Agregar Registro";
                        trDias.Visible          = true;
                        rbSemMes.Enabled        = true;

                        break;

                    case "btnEdit":

                        if (FormsHelper.GetSelectedId(gv) != null)
                        {
                            FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO());
                            var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.Frecuencia));
                            FormsHelper.FillControls(entity, tblControls);
                            FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);

                            Detalles = CRUDHelper.ReadAll(string.Format("IdentifFrecuencia = '{0}'", entity.IdentifFrecuencia), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.FrecuenciaDet));

                            rbSemMes.Enabled = (Detalles.Count == 0);

                            rbSemMesChanged();

                            gvABM.Attributes.Add("IdentifFrecuencia", entity.IdentifFrecuencia);
                            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":
                        rbSemMes.Enabled = (Detalles.Count == 0);
                        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.GridViewID = "gv";
                            ASPxGridViewExporter1.WriteXlsToResponse();
                        break;

                    case "btnExportPdf":
                        if (ASPxGridViewExporter1 != null)
                            ASPxGridViewExporter1.GridViewID = "gv";
                            ASPxGridViewExporter1.WritePdfToResponse();
                        break;

                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblError, ex);
            }
        }
 //------------------------------------------------------------------------------
 // Function: PlayGameMenuItemSelected
 // Author: nholmes
 // Summary: event handler for when the Play Game menu item is selected
 //------------------------------------------------------------------------------
 void PlayGameMenuItemSelected(object sender, MenuItemEventArgs e)
 {
     // load the main game!
     gameStateManager.LoadNewStates(game, LoadingTexture, e.PlayerIndex, new MainGame(game, e.PlayerIndex));
 }
        protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
                case "btnQuerySKU":

                    QuerySKU();

                    break;

                case "btnOP":

                    if (gvHome.Selection.Count == 1)
                    {

                        string Pauta = string.Empty;

                        Pauta = "OP CERTIFICADO " + gvHome.GetSelectedFieldValues("año")[0].ToString() + gvHome.GetSelectedFieldValues("mes")[0].ToString() + " " + gvHome.GetSelectedFieldValues("IdentifEspacio")[0].ToString() + " - " + gvHome.GetSelectedFieldValues("IdentifOrigen")[0].ToString();

                        string filename = Pauta + System.DateTime.Now.Hour.ToString().PadLeft(2, '0') +
                                                  System.DateTime.Now.Minute.ToString().PadLeft(2, '0') +
                                                  System.DateTime.Now.Second.ToString().PadLeft(2, '0') + ".xlsx";

                        TextBox1.Text = Server.MapPath("~/Excel/");

                        switch (TextBox1.Text)
                        {
                            case "": { break; }

                            default:
                                {
                                    try
                                    {
                                        System.IO.FileInfo fileinfo = new FileInfo(@TextBox1.Text);
                                        bool dExiste = fileinfo.Directory.Exists;

                                        if (dExiste)
                                        {
                                            lblErrorLineas.Text = "";

                                            string[] dirs = Directory.GetFiles(@TextBox1.Text);

                                            if (dirs.Length > 0)
                                            {
                                                filename = @TextBox1.Text + filename;

                                                dExiste = false;

                                                for (int i = 0; i <= dirs.Length - 1; i++)
                                                {
                                                    if (dirs[i].ToString() == filename)
                                                    {
                                                        dExiste = true;

                                                        break;
                                                    }
                                                }
                                            }

                                            if (dExiste == false)
                                            {
                                                //ACA VA LA LLAMADA A LA FUNCION DEL HELPER
                                                // ES EL CORE, YA TENEMOS EL NOMBRE DE ARCHIVO Y LA RUTA

                                                CertificadoCabDTO Cabecera      = Certificados.Read( gvHome.GetSelectedFieldValues("PautaId")[0].ToString(),gvHome.GetSelectedFieldValues("IdentifOrigen")[0].ToString());
                                                List<CertificadoDetDTO> Detalle = Certificados.ReadAllLineas(Cabecera);
                                                List<CertificadoSKUDTO> SKUS    = Certificados.GetSKUs(Cabecera.PautaId,Cabecera.IdentifOrigen);
                                                EspacioContDTO Espacio          = CRUDHelper.Read(string.Format("IdentifEspacio = '{0}'", Cabecera.IdentifEspacio), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.EspacioCont));

                                                csOP_Helper Helper = new csOP_Helper("CERTIFICADO", "", CertificadoCab.PautaId,Cabecera, Detalle, SKUS, Espacio,filename);

                                                System.IO.FileInfo toDownload = new FileInfo(filename);

                                                if (toDownload.Exists == true)
                                                {
                                                    Response.Clear();
                                                    Response.AddHeader("Content-Disposition", "attachment; filename=" + toDownload.Name);
                                                    Response.AddHeader("Content-Length", toDownload.Length.ToString());
                                                    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
                                                    Response.WriteFile(filename);
                                                    Response.End();
                                                }

                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        string a = string.Empty;

                                        a = ex.Message;

                                        lblErrorLineas.Text = "Ruta no válida.";
                                    }

                                    break;
                                }
                        }
                    }
                    else
                    {
                        lblErrorHome.Text = "Debe seleccionar una línea";
                    }

                    break;

                case "btnCost":

                    Business.Certificados.CalcularCosto(CertificadoCab, Costos, mycert, ((Accendo)this.Master).Usuario.UserName);

                    lblErrorLineas.Text = "Se calculo correctamente";

                    break;

                case "btnExport":

                case "btnExportXls":
                    {
                        if (ASPxGridViewExporter1 != null)
                       {
                            XlsExportOptions xlsExportOptions = new XlsExportOptions(TextExportMode.Text, true, false);

                            ASPxGridViewExporter1.WriteXlsToResponse(xlsExportOptions);
                        }
                        break;
                    }
                case "btnExportPdf":

                    if (ASPxGridViewExporter1 != null)

                        ASPxGridViewExporter1.WritePdfToResponse();

                    break;

                default: break;
            }
        }
        //------------------------------------------------------------------------------
        // Function: DecreaseMusicVolume
        // Author: nholmes
        // Summary: decrease the music volume
        //------------------------------------------------------------------------------
        public void DecreaseMusicVolume(object sender, MenuItemEventArgs e)
        {
            // decrease the option and set the new music volume
            int currentMusicVolume = musicVolumeItem.DecreaseValue();

            // todo - set the correct music mode
        }
 protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
 {
     FormsHelper.ToolBarClick(ucABM1, e.Item.Name, gv, ASPxGridViewExporter1);
 }
示例#54
0
        protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                    case "btnAdd":
                        FormsHelper.ClearControls(tblControls, new DTO.AvisosDTO());
                        cbIdentifIdentAte.SelectedIndex = -1;
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);

                        Atencion = new List<DTO.AvisosIdAtenDTO>();
                        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.AvisosDTO());
                            cbIdentifIdentAte.SelectedIndex = -1;
                            var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, DAO);
                            FormsHelper.FillControls(entity, tblControls);
                            FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);

                            Atencion = Business.Avisos.ReadAllAtencion((string)entity.IdentifAviso);

                            gvABM.Attributes.Add("IdentifAviso", entity.IdentifAviso);
                            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);
            }
        }
        //------------------------------------------------------------------------------
        // Function: IncreaseScreenMode
        // Author: nholmes
        // Summary: increase the currently selected screen mode
        //------------------------------------------------------------------------------
        public void IncreaseScreenMode(object sender, MenuItemEventArgs e)
        {
            // increase the option and get the new selection
            int currentSelection = screenModeItem.IncreaseSelection();

            // set full screen or windowed mode according to the current selection
            if ((ScreenMode)currentSelection == ScreenMode.FullScreen)
            {
                displayManager.SetScreenMode(ScreenMode.FullScreen);
            }
            else
            {
                displayManager.SetScreenMode(ScreenMode.Windowed);
            }
        }
示例#56
0
        protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {

                ASPxPageControl1.TabPages[3].ClientEnabled = e.Item.Name == "btnAdd";

                switch (e.Item.Name)
                {
                    case "btnAdd":

                        if (ASPxPageControl1.ActiveTabPage.Index == 3)
                        {
                            //for costosCopy only
                            UcIdentifEspacio0.ComboBox.Text = "";
                            deVigDesde0.Text                = "";
                            deVigHasta0.Text                = "";
                        }

                        FormsHelper.ClearControls(tblCosto, new DTO.CostosDTO());
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);

                        CostosFrecuencia = new List<DTO.CostosFrecuenciaDTO>();
                        CostosProveedor  = new List<DTO.CostosProveedorDTO>();

                        RefreshAbmGrid(gvABMFrecuencia);
                        RefreshAbmGrid(gvABMProveedor);

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

                    case "btnEdit":

                        if (FormsHelper.GetSelectedId(gv) != null)
                        {
                            FormsHelper.ClearControls(tblCosto, new DTO.CostosDTO());
                            var entity = Business.Costos.Read(FormsHelper.GetSelectedId(gv).Value);
                            FormsHelper.FillControls(entity, tblCosto);
                            FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);

                            CostosFrecuencia = Business.Costos.ReadAllFrecuencia(entity);
                            CostosProveedor = Business.Costos.ReadAllProveedor(entity);

                            ucEspacioChanged();
                            rbFrecuenciaChanged();

                            RefreshAbmGrid(gvABMFrecuencia);
                            RefreshAbmGrid(gvABMProveedor);

                            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 "btnCommit":

                        if (FormsHelper.GetSelectedId(gv) != null)
                        {
                            pnlCommit.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).Value.ToString());
                            pnlControls.Visible = false;
                            pnlCommit.Visible   = true;
                        }
                        else
                        {
                            pnlCommit.Visible = false;
                        }
                        break;

                    case "btnQuery":

                        if (FormsHelper.GetSelectedId(gv) != null)
                        {
                            pnlVersiones.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).Value.ToString());
                            RefreshGrid(gvVersiones);
                            pnlVersiones.Visible = true;
                        }
                        else
                        {
                            pnlVersiones.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);
            }
        }
        protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                    case "btnExport":
                        {
                            ASPxGridViewExporter1.GridViewID = "gv";

                            gv.DataSource = Tabla;

                            ASPxGridViewExporter1.DataBind();

                            if (ASPxGridViewExporter1 != null)
                            {
                                XlsExportOptions xlsExportOptions = new XlsExportOptions(TextExportMode.Text, true, false);

                                string Titulo = ucEstado.Text.Trim() + " - " + ucOrigen.Text.Trim() + " " + deAnoMes.Text;

                                xlsExportOptions.SheetName = Titulo;

                                ASPxGridViewExporter1.WriteXlsToResponse(xlsExportOptions);
                            }
                            break;
                        }
                    case "btnLimpiar":
                        {
                            gv.DataSource = null;
                            gv.DataBind();

                            break;
                        }

                    default: break;
                }

            }
            catch(Exception ex)
            {
            }
        }
 //------------------------------------------------------------------------------
 // Function: OptionsMenuItemSelected
 // Author: nholmes
 // Summary: event handler for when the Options menu item is selected
 //------------------------------------------------------------------------------
 void OptionsMenuItemSelected(object sender, MenuItemEventArgs e)
 {
     // add the exit game stete to check if the user is really sure they want to exit
     gameStateManager.AddGameState(new OptionsMenu(game, e.PlayerIndex));
 }
        //------------------------------------------------------------------------------
        // Function: IncreaseSfxVolume
        // Author: nholmes
        // Summary: increase the music volume
        //------------------------------------------------------------------------------
        public void IncreaseSfxVolume(object sender, MenuItemEventArgs e)
        {
            // increase the option and set the new music volume
            int currentSfxVolume = sfxVolumeItem.IncreaseValue();

            // todo - set the correct music mode
        }
        //------------------------------------------------------------------------------
        // Function: PressStartMenuItemSelected
        // Author: nholmes
        // Summary: event handler for when press start is selected
        //------------------------------------------------------------------------------
        void PressStartMenuItemSelected(object sender, MenuItemEventArgs e)
        {
            // add the main menu state
            gameStateManager.AddGameState(new MainMenu(game, e.PlayerIndex));

            // set isExiting so that the player can't return to the title screen
            isExiting = true;
        }