Ejemplo n.º 1
0
 //添加数据
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     EditAccountWindow edit = new EditAccountWindow();
     edit.IsAddNew = true;
     if (edit.ShowDialog() != true)
     {
         LoadData();
     }
 }
Ejemplo n.º 2
0
        //添加数据
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            EditAccountWindow edit = new EditAccountWindow();

            edit.IsAddNew = true;
            if (edit.ShowDialog() != true)
            {
                LoadData();
            }
        }
Ejemplo n.º 3
0
        //添加支出
        private void menuAddExpense_Click(object sender, RoutedEventArgs e)
        {
            EditAccountWindow editAccountWin = new EditAccountWindow();

            editAccountWin.IsAddNew = true;
            if (editAccountWin.ShowDialog() != true)
            {
                LoadData();
            }
        }
Ejemplo n.º 4
0
        //编辑修改选中行
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            Account account = (Account)dataGridShow.SelectedItem;

            //判断是否选中数据
            if (account == null)
            {
                MessageBox.Show("请选择一条数据!");
                return;
            }
            EditAccountWindow edit = new EditAccountWindow();

            edit.IsAddNew           = false;
            edit.EditingId          = account.Id;
            edit.BeforeEditingMoney = (decimal)account.Money; //编辑前的钱
            edit.BeforeCostType     = account.CostType;       //编辑前的收支类型
            //关闭编辑窗口并更新数据
            if (edit.ShowDialog() != true)
            {
                LoadData();
            }
        }
Ejemplo n.º 5
0
 //添加收入
 private void menuAddIncome_Click(object sender, RoutedEventArgs e)
 {
     EditAccountWindow editAccountWin = new EditAccountWindow();
     editAccountWin.IsAddNew = true;
     if (editAccountWin.ShowDialog() != true)
     {
         LoadData();
     }
 }
Ejemplo n.º 6
0
 //编辑修改选中行
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     Account account = (Account)dataGridShow.SelectedItem;
     //判断是否选中数据
     if (account == null)
     {
         MessageBox.Show("请选择一条数据!");
         return;
     }
     EditAccountWindow edit = new EditAccountWindow();
     edit.IsAddNew = false;
     edit.EditingId = account.Id;
     edit.BeforeEditingMoney = (decimal)account.Money;//编辑前的钱
     edit.BeforeCostType = account.CostType;         //编辑前的收支类型
     //关闭编辑窗口并更新数据
     if (edit.ShowDialog() != true)
     {
         LoadData();
     }
 }