Пример #1
0
 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);
     }
 }
Пример #2
0
 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();
     }
 }
Пример #3
0
 public OrderForm(Customer customer, Order order, bool newOrder, ProfileForm profileForm)
 {
     InitializeComponent();
     PopulateForm(customer, order, newOrder, profileForm);
 }