예제 #1
0
 public void CreateCustomer()
 {
     Group_Cust_Properties.Visible = false;
     Group_Cust_Properties.SendToBack();
     Group_CreateCustomer.Visible = true;
     Group_CreateCustomer.BringToFront();
 }
예제 #2
0
        public void ViewCustomer(int customerID)
        {
            currentMode = Mode.View;
            EnableAll(true);
            Customer c = CustomerContainer.S.Find(customerID);

            Group_CreateCustomer.Visible = false;
            Group_CreateCustomer.SendToBack();
            Group_Cust_Properties.Visible = true;
            Group_Cust_Properties.BringToFront();
            Button_DeleteCustomer.Enabled = false;
            Button_DeleteCustomer.Visible = false;
            try
            {
                Label_Num_Cust_ID.Text  = c.CustomerID.ToString();
                Label_TextName.Text     = c.Name;
                Label_Text_Address.Text = c.Address;
                Label_Date_Dob.Text     = c.dob.ToString();
                Label_Date_DOR.Text     = c.dor.ToString();
                listView1.Enabled       = true;
                InitItemList();
                SetCustomerItemList(c);
                label_text_highestPrice.Text = c.GetHighestPrice().ToString();
                label_text_Total.Text        = c.GetTotalAmount().ToString();
                Button_AddToPayment.Enabled  = true;

                if (c is VipCustomer)
                {
                    Label_Customer_isVIP.Text = "Yes";
                    VipCustomer v = c as VipCustomer;
                    Label_Discount.Enabled = true;
                    Combo_Discount.Enabled = false;
                    Console.WriteLine("Discount: " + v.Discount);
                    Combo_Discount.SelectedIndex         = (int)(v.Discount * 10);
                    Input_RegCustomerScore.SelectedIndex = 3;
                    Input_RegCustomerScore.Enabled       = false;
                }

                else if (c is RegCustomer)
                {
                    Label_Customer_isVIP.Text    = "No";
                    Label_Discount.Enabled       = false;
                    Combo_Discount.Enabled       = false;
                    Combo_Discount.SelectedIndex = 0;
                    RegCustomer r = c as RegCustomer;
                    Console.WriteLine(((int)r.RegType).ToString());
                    Input_RegCustomerScore.SelectedIndex = (int)r.RegType;
                    Input_RegCustomerScore.Enabled       = false;
                }
            }
            catch (NullReferenceException e)
            {
                DialogResult d = MessageBox.Show("Customer not found", "No ID found", MessageBoxButtons.OK);
            }
        }