Exemple #1
0
        public TerritoriesUI()
        {
            InitializeComponent();

            tm  = new TerritoriesTableMetadata();
            tpo = new TerritoriesPersistentObject(SharedData.DatabaseServer, SharedData.ConnectionString, tm);
        }
Exemple #2
0
        private void buttonDelete_Click(object sender, System.EventArgs e)
        {
            try
            {
                int selectedIndex = this.dataGrid.CurrentRowIndex;

                if (selectedIndex > -1)
                {
                    TerritoriesTableMetadata tp = this.territoriesList[selectedIndex];
                    this.tpo.Delete(tp, false);
                }
                else
                {
                    MessageBox.Show("Please select a item from the grid");
                    return;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
            }
        }