76 lines
2.0 KiB
C#
76 lines
2.0 KiB
C#
using DIDemoLib;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WinFormDi;
|
|
|
|
namespace WinFormDiApp
|
|
{
|
|
public partial class MainWindow : Form
|
|
{
|
|
private readonly IMessages _messages;
|
|
private readonly frmPayments _payments;
|
|
private readonly frmReadPayments _readPayments;
|
|
private readonly frmSearchData _searchData;
|
|
private readonly frmEditPayment _editPayment;
|
|
|
|
public MainWindow(
|
|
IMessages messages,
|
|
frmPayments payments,
|
|
frmReadPayments readPayments,
|
|
frmSearchData searchData,
|
|
frmEditPayment editPayment
|
|
)
|
|
{
|
|
InitializeComponent();
|
|
_messages = messages;
|
|
_payments = payments;
|
|
_readPayments = readPayments;
|
|
_searchData = searchData;
|
|
_editPayment = editPayment;
|
|
}
|
|
|
|
private void MainWindow_Load(object sender, EventArgs e)
|
|
{
|
|
helloText.Text = _messages.SayHello();
|
|
}
|
|
|
|
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
goodbyeText.Text = _messages.SayGoodBye();
|
|
MessageBox.Show("Closing...", "Warning", MessageBoxButtons.OK);
|
|
}
|
|
|
|
private void btnCheckPayments_Click(object sender, EventArgs e)
|
|
{
|
|
_payments.ShowDialog();
|
|
}
|
|
|
|
private void btnLoadPayments_Click(object sender, EventArgs e)
|
|
{
|
|
_readPayments.ShowDialog();
|
|
}
|
|
|
|
private void btnSearchPayments_Click(object sender, EventArgs e)
|
|
{
|
|
_searchData.ShowDialog();
|
|
}
|
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void btnEdit_Click(object sender, EventArgs e)
|
|
{
|
|
_editPayment.ShowDialog();
|
|
}
|
|
}
|
|
}
|