public void CreateProfileForm(Customer cust) { if (profileForm == null || profileForm.profileFormClosed) { profileForm = new ProfileForm(cust); profileForm.MdiParent = this; profileForm.StartPosition = FormStartPosition.CenterScreen; profileForm.Show(); } else { profileForm.PopulateForm(cust); } }
public void PopulateForm(Customer cust, Order order, bool newOrder, ProfileForm profileForm) { this.cust = cust; this.order = order; this.newOrder = newOrder; this.profileForm = profileForm; displayNewButtons(newOrder); OrderNumLabel.Text = Convert.ToString(order.OrderNum); DateLabel.Text = DateTime.Now.ToString("yyyy/MM/dd"); CustNumLabel.Text = Convert.ToString(cust.CustomerNum); CustNameLabel.Text = cust.Name; CustAddressLabel.Text = cust.Address; CustPhoneLabel.Text = cust.PhoneNum; if (newOrder) { AddOrderToDB(); } }
public OrderForm(Customer customer, Order order, bool newOrder, ProfileForm profileForm) { InitializeComponent(); PopulateForm(customer, order, newOrder, profileForm); }