Esempio n. 1
0
        private void NewGroup_Click(object sender, EventArgs e)
        {
            frmGroup fGroup = new frmGroup();

            fGroup.Action  = "NEW";
            fGroup.Profile = new SynapseProfile();
            if (fGroup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                SynapseProfile _profile = fGroup.Profile;
                olvGroups.AddObject(_profile);
                olvGroups2.AddObject(_profile);

                switch (tabControl1.SelectedIndex)
                {
                case 0:
                    olvGroups.SelectedObject = _profile;
                    break;

                case 1:
                    olvGroups2.SelectedObject = _profile;
                    break;
                }
                AllProfileCollection = SynapseProfile.Load();
            }
        }
Esempio n. 2
0
        private void EditGroup_Click(object sender, EventArgs e)
        {
            if (tsbEditGroup.Visible || tsbEditGroup2.Visible)
            {
                SynapseProfile _profile = new SynapseProfile();
                switch (tabControl1.SelectedIndex)
                {
                case 0:
                    _profile = (SynapseProfile)olvGroups.SelectedObject;
                    break;

                case 1:
                    _profile = (SynapseProfile)olvGroups2.SelectedObject;
                    break;
                }
                if (_profile != null)
                {
                    frmGroup fGroup = new frmGroup();
                    fGroup.Action  = "EDIT";
                    fGroup.Profile = _profile;
                    if (fGroup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        _profile = fGroup.Profile;
                        olvGroups.RefreshObject(_profile);
                        olvGroups2.RefreshObject(_profile);

                        switch (tabControl1.SelectedIndex)
                        {
                        case 0:
                            olvGroups.SelectedObject  = _profile;
                            olvGroups2.SelectedObject = null;
                            break;

                        case 1:
                            olvGroups.SelectedObject  = null;
                            olvGroups2.SelectedObject = _profile;
                            break;
                        }
                        AllProfileCollection = SynapseProfile.Load();
                    }
                }
            }
        }