コード例 #1
0
        private void barButtonItemSaveLayout_ItemClick(object sender, ItemClickEventArgs e)
        {
            Pivot.XtraFormSave save = new Pivot.XtraFormSave();
            save.Init(ConfigurazioneCaricata);

            if (save.ShowDialog(this) == DialogResult.OK)
            {
                MemoryStream stream = new MemoryStream();
                this.pivotGridControlStampe.SaveLayoutToStream(stream, OptionsLayoutBase.FullLayout);
                stream.Seek(0, SeekOrigin.Begin);

                StreamReader reader = new StreamReader(stream);
                string       text   = reader.ReadToEnd();

                if (save.SalvaNuovo || ConfigurazioneCaricata == null)
                {
                    ConfigurazionePivot pivot = new ConfigurazionePivot(new Session());
                    pivot.Tipo        = STR_PivotRigaVenditaVariante;
                    pivot.Descrizione = save.SalvaNome;
                    pivot.XML         = text;

                    pivot.Save();
                }
                else
                {
                    ConfigurazioneCaricata.XML         = text;
                    ConfigurazioneCaricata.Descrizione = save.SalvaNome;
                    ConfigurazioneCaricata.Save();
                }
            }
        }
コード例 #2
0
        private void gridControlElenco_DoubleClick(object sender, EventArgs e)
        {
            target = this.gridView1.GetFocusedRow() as ConfigurazionePivot;

            if (target != null)
            {
                DialogResult = DialogResult.OK;
            }
        }
コード例 #3
0
        private void ribbonGalleryBarItemLayout_Gallery_ItemClick(object sender, DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs e)
        {
            string nome = e.Item.Caption;

            ConfigurazioneCaricata = this.unitOfWork1.FindObject <ConfigurazionePivot>(new GroupOperator(GroupOperatorType.And, new CriteriaOperator[] {
                new BinaryOperator("Descrizione", nome),
                new BinaryOperator("Tipo", STR_PivotRigaVenditaVariante)
            }));

            if (ConfigurazioneCaricata != null)
            {
                LoadLayout();
            }
        }
コード例 #4
0
        public void Init(ConfigurazionePivot cfg)
        {
            target = cfg;
            if (target == null)
            {
                this.checkEditSaveNew.Checked = true;
            }
            else
            {
                this.textEdit1.Text = target.Descrizione;
            }

            UpdateInfo();
        }
コード例 #5
0
        private void gridControlElenco_EmbeddedNavigator_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.ButtonType == NavigatorButtonType.Custom)
            {
                e.Handled = true;

                target = this.gridView1.GetFocusedRow() as ConfigurazionePivot;
                if (target != null)
                {
                    string msg = string.Format("Vuoi veramente eleminare la voce: {0}", target.Descrizione);
                    if (XtraMessageBox.Show(msg, "Conferma", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        target.Delete();

                        this.xpCollection1.Reload();
                    }
                }
            }
        }