Ejemplo n.º 1
0
        private void btn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var txt = (sender as Button).Name;
                switch (txt)
                {
                case "new":
                    var frm = new FormMenuEditPopup();
                    frm.AfterSaveEvent = new AfterSaveEventHandler(() => {
                        FinanceForm_Loaded(datagrid, null);
                    });
                    frm.ShowDialog();
                    break;

                case "modify":
                    Popup();
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                FinanceMessageBox.Error(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void btn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var txt = (sender as Button).Name;
                switch (txt)
                {
                case "new":
                    var frm = new FormMenuEditPopup();
                    frm.AfterSaveEvent = new AfterSaveEventHandler(() => {
                        FinanceForm_Loaded(datagrid, null);
                    });
                    frm.ShowDialog();
                    break;

                case "modify":
                    Popup();
                    break;

                case "delete":
                    var item = datagrid.SelectedItem as MenuTableMap;
                    if (item != null)
                    {
                        DataFactory.Instance.GetSystemProfileExecuter().DeleteMenuItem(item);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                FinanceMessageBox.Error(ex.Message);
            }
        }
Ejemplo n.º 3
0
        void Popup()
        {
            var item = datagrid.SelectedItem as MenuTableMap;

            if (item != null)
            {
                var frm = new FormMenuEditPopup();
                frm.ItemSource     = item;
                frm.AfterSaveEvent = new AfterSaveEventHandler(() => {
                    FinanceForm_Loaded(datagrid, null);
                });
                frm.ShowDialog();
                FinanceForm_Loaded(datagrid, null);
            }
            else
            {
                FinanceMessageBox.Info("请选中一个项目");
            }
        }