private void simpleButton2_Click(object sender, EventArgs e)
 {
     if (m_persistence.Cancel())
     {
         Close();
     }
 }
示例#2
0
        private void Init()
        {
            m_uow = Scout.Core.Data.GetUnitOfWork();

            m_persistenceController = new PersistenceController(m_uow);

            m_areaData = Scout.Core.Data.GetList <Site>(m_uow).All();

            areaGrid.DataSource = m_areaData;

            WireEvents();
            colStatus.ColumnEdit       = new AreaStatusComboObserver(m_uow);
            colDomainStatus.ColumnEdit = new AreaStatusComboObserver(m_uow);
            colSflStatus.ColumnEdit    = new AreaStatusComboObserver(m_uow);

            saveButton.Click += (s, e) =>
            {
                if (m_persistenceController.Save())
                {
                    Close();
                }
            };

            cancelButton.Click += (s, e) =>
            {
                if (m_persistenceController.Cancel())
                {
                    Close();
                }
            };
        }