private void btnPay_Click(object sender, RoutedEventArgs e) { if (!AllowPay()) { return; } D05F2141 frmPayment = new D05F2141(); frmPayment.TotalMoney = Convert.ToDecimal(seTotalMoney.EditValue); frmPayment.WindowStartupLocation = WindowStartupLocation.CenterScreen; frmPayment.ShowDialog(); if (!frmPayment.bClicked) { return; } btnPay.IsEnabled = false; txtItem.IsEnabled = false; AmountPayment = frmPayment.TotalMoney; DoSaveSQL(); Close(); }
private void mnsPay_Click(object sender, RoutedEventArgs e) { string VoucherID = ""; DataTable dt = BLTable.SelectPayment(GridTable.GetFocusedRowCellValue("TableID").ToString(), GridTable.GetFocusedRowCellValue("Status").ToString()); if (dt.Rows.Count > 0) { VoucherID = dt.Rows[dt.Rows.Count - 1]["VoucherID"].ToString(); } D05F2141 frmPayment = new D05F2141(); frmPayment.TotalMoney = Convert.ToDecimal(dt.Rows[dt.Rows.Count - 1]["Amount"]); frmPayment.WindowStartupLocation = WindowStartupLocation.CenterScreen; frmPayment.ShowDialog(); if (!frmPayment.bClicked) { return; } decimal AmountPayment = frmPayment.TotalMoney; BLTable.UpdateMoney(L3SQLClient.SQLMoney(GridTable.GetFocusedRowCellValue("TotalMoney"), "n0"), L3SQLClient.SQLMoney(GridTable.GetFocusedRowCellValue("People"), "n0"), GridTable.GetFocusedRowCellValue("TableID")); BLTable.UpdateVoucherD91T2140(L3SQLClient.SQLMoney(AmountPayment, "n0"), VoucherID); LoadSimple(); }