Ejemplo n.º 1
0
        private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //if ( !(this.ParentForm as mainForm).ContextControls.ContainsKey( "PnlNuevaReceta" ) )
            {
                PnlNuevaReceta pnlRecet = new PnlNuevaReceta( );
                pnlRecet.Dock = DockStyle.Fill;
                DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                tabItem.Controls.Add(pnlRecet);
                tabItem.Text = "Nueva Receta";
                (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
                (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;

                // (this.ParentForm as mainForm).ContextControls.Add( "PnlNuevaReceta" , pnlInsumo );
            }
        }
Ejemplo n.º 2
0
        private void ResetFields()
        {
            int selectedTabIndex = (this.ParentForm as mainForm).xtraTabControl.SelectedTabPageIndex;

            PnlNuevaReceta pnlRecet = new PnlNuevaReceta();

            pnlRecet.Dock = DockStyle.Fill;
            DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage();
            tabItem.Controls.Add(pnlRecet);
            tabItem.Text = "nueva receta";
            (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
            (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;

            (this.ParentForm as mainForm).xtraTabControl.TabPages.RemoveAt(selectedTabIndex);
        }
Ejemplo n.º 3
0
        private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            CommonUtils.Receta recipe = (CommonUtils.Receta)gridViewListaRecetas.GetFocusedRow();
            //PnlNuevaReceta pnlReceta = new PnlNuevaReceta((CommonUtils.Receta)((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaRecetas.Views[0]).GetFocusedRow());
            if (recipe != null)
            {
                if (!(this.ParentForm as mainForm).ContextControlsForRecetas.ContainsKey(recipe.idReceta.ToString()))
                {
                    PnlNuevaReceta pnlReceta = new PnlNuevaReceta(recipe);
                    (this.ParentForm as mainForm).ContextControlsForRecetas.Add(recipe.idReceta.ToString(), pnlReceta);

                    pnlReceta.Dock = DockStyle.Fill;
                    DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                    tabItem.Controls.Add(pnlReceta);
                    tabItem.Text = pnlReceta.Receta.nombre;
                    (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
                    (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;

                    // ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevaReceta" , pnlReceta );
                }
            }
        }
Ejemplo n.º 4
0
        private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            CommonUtils.Receta recipe = (CommonUtils.Receta)gridViewListaRecetas.GetFocusedRow();
            //PnlNuevaReceta pnlReceta = new PnlNuevaReceta((CommonUtils.Receta)((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaRecetas.Views[0]).GetFocusedRow());
            if (recipe != null)
            {
                if (!(this.ParentForm as mainForm).ContextControlsForRecetas.ContainsKey(recipe.idReceta.ToString()))
                {
                    PnlNuevaReceta pnlReceta = new PnlNuevaReceta( recipe );
                    (this.ParentForm as mainForm).ContextControlsForRecetas.Add(recipe.idReceta.ToString(), pnlReceta);

                    pnlReceta.Dock = DockStyle.Fill;
                    DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                    tabItem.Controls.Add( pnlReceta );
                    tabItem.Text = pnlReceta.Receta.nombre;
                    ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem );
                    ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem;

                   // ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevaReceta" , pnlReceta );
                }
            }
        }
Ejemplo n.º 5
0
        private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //if ( !(this.ParentForm as mainForm).ContextControls.ContainsKey( "PnlNuevaReceta" ) )
            {
                PnlNuevaReceta pnlRecet = new PnlNuevaReceta( );
                pnlRecet.Dock = DockStyle.Fill;
                DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                tabItem.Controls.Add(pnlRecet);
                tabItem.Text = "Nueva Receta";
                ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem );
                ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem;

              // (this.ParentForm as mainForm).ContextControls.Add( "PnlNuevaReceta" , pnlInsumo );
            }
        }
Ejemplo n.º 6
0
        private void ResetFields()
        {
            int selectedTabIndex = (this.ParentForm as mainForm).xtraTabControl.SelectedTabPageIndex;

            PnlNuevaReceta pnlRecet = new PnlNuevaReceta();
            pnlRecet.Dock = DockStyle.Fill;
            DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage();
            tabItem.Controls.Add(pnlRecet);
            tabItem.Text = "nueva receta";
            (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
            (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;
           
            (this.ParentForm as mainForm).xtraTabControl.TabPages.RemoveAt(selectedTabIndex);
        }