trakker/Forms/MainForm.cs

42 lines
1.4 KiB
C#

using trakker.Forms;
using trakker.Models;
namespace trakker
{
public partial class MainForm : Form
{
/// <summary>
/// Initializes a new instance of the <see cref="MainForm"/> class.
/// Sets up the form's controls and event handlers by calling
/// <see cref="InitializeComponent"/> which is generated by the designer.
/// </summary>
public MainForm()
{
InitializeComponent();
}
/// <summary>
/// Handles the Click event of the Exit menu item. When invoked, this
/// method terminates the application.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">Event data associated with the click event.</param>
private void MainForm_Exit_MenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void button1_Click(object sender, EventArgs e)
{
Client client = new Client();
client.ClientId = Guid.NewGuid().ToString();
var dialog = new ClientForm(client);
dialog.ShowDialog(this);
client = dialog.Client;
MessageBox.Show($"Client Name: {client.Name}\nCompany: {client.Company}\nEmail: {client.Email}\nPhone: {client.Phone}\nAddress: {client.Address}\nIs Active: {client.IsActive}\nNotes: {client.Notes}");
}
}
}