Create the user interface for the Customer_details form.
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SUP101;
namespace SUP101
{
public partial class Customer_details : Form
{
Customer thisCustomer;
public Customer_details()
{
InitializeComponent();
}
//Click event for Cancel button in Customer_detail screen
private void Cancel_Click(object sender, EventArgs e)
{
Program.getForm1().Visible = true;
Program.getForm2().Visible = false;
}
//Click event for Submit button in Customer_detail screen
private void Submit_Click(object sender, EventArgs e)
{
thisCustomer.Fname = tbFName.Text;
thisCustomer.Lname = tbLName.Text;
thisCustomer.City = tbCity.Text;
thisCustomer.Save();
Program.getForm1().Visible = true;
Program.getForm2().Visible = false;
}
private void AddDataToForm()
{
int id = Int32.Parse(Program.getCustomer());
//Retrieves data from the local database.
thisCustomer = Customer.FindByPrimaryKey(id);
tbFName.Text = thisCustomer.Fname;
tbLName.Text = thisCustomer.Lname;
tbCity.Text = thisCustomer.City;
}
//Load method event for Customer_detail
private void Customer_Details_Load(object sender, EventArgs e)
{
AddDataToForm();
}
//paint method event for Customer_detail
private void Customer_Details_paint(object sender, PaintEventArgs e)
{
AddDataToForm();
}
}
}