From c48651e2a37e8af5f1eafff10119eedefa4f96e7 Mon Sep 17 00:00:00 2001 From: ​ Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: customer maintenance --- .../CustomerMaintenance/frmAddCustomer.cs | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 customer_maintenance/CustomerMaintenance/frmAddCustomer.cs (limited to 'customer_maintenance/CustomerMaintenance/frmAddCustomer.cs') diff --git a/customer_maintenance/CustomerMaintenance/frmAddCustomer.cs b/customer_maintenance/CustomerMaintenance/frmAddCustomer.cs new file mode 100644 index 0000000..4021cfd --- /dev/null +++ b/customer_maintenance/CustomerMaintenance/frmAddCustomer.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace CustomerMaintenance +{ + public partial class frmAddCustomer : Form + { + public frmAddCustomer() + { + InitializeComponent(); + } + + Customer customer = null; + + public Customer GetNewCustomer() + { + this.ShowDialog(); + return customer; + } + + private void btnSave_Click(object sender, EventArgs e) + { + string msg = "" + + Validator.IsPresent(txtFirstName.Text, txtFirstName.Tag.ToString()) + + Validator.IsPresent(txtLastName.Text, txtLastName.Tag.ToString()) + + Validator.IsValidEmail(txtEmail.Text, txtEmail.Tag.ToString()); + if (msg != "") { + MessageBox.Show(msg, "Entry Error"); + return; + } + + customer = new Customer(txtFirstName.Text, txtLastName.Text, + txtEmail.Text); + this.Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} -- cgit 1.4.1