private async void CashReturnSaveButton_Click(object sender, RoutedEventArgs e)
        {
            employee_cash emp_cash = getEmployee_CashReturn();

            if (Employee_CashService.InsertEmployee_cash(emp_cash) == 1)
            {
                await MainWindow.Instance.ShowMessageAsync("Employe_cash Return Success", "Transaction Added Success!");

                clearReturnForm();
                CashBorrow.Instance.setTodayTransactionList();
                //await controller.CloseAsync();
            }
            else
            {
                await MainWindow.Instance.ShowMessageAsync("Employe_cash Insert Error", "Please check Deatails", MessageDialogStyle.Affirmative);
            }
        }
Beispiel #2
0
        private async void DeleteTodayTransactionButton_Click(object sender, RoutedEventArgs e)
        {
            Button     button = (Button)sender;
            StackPanel sp     = (StackPanel)button.Content;
            Label      lbl    = sp.Children.OfType <Label>().FirstOrDefault();

            if (lbl.Content.ToString() != "")
            {
                if (Employee_CashService.DeleteEmployee_cash_ByID(lbl.Content.ToString()) == 1)
                {
                    await MainWindow.Instance.ShowMessageAsync("Transaction", "Transaction Deleted..", MessageDialogStyle.Affirmative);

                    setTodayTransactionList();
                }
                else
                {
                    await MainWindow.Instance.ShowMessageAsync("Transaction", "Transaction Delete Fail..Retry..", MessageDialogStyle.Affirmative);
                }
            }
            else
            {
                await MainWindow.Instance.ShowMessageAsync("Transaction", "Transaction Selecting Error..", MessageDialogStyle.Affirmative);
            }
        }