Esempio 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 );
            }
        }
Esempio 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);
        }
Esempio 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 );
                }
            }
        }
Esempio 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 );
                }
            }
        }
Esempio 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 );
            }
        }
Esempio 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);
        }