示例#1
0
        public CustomerForm(String storeName, String storeDetails, String officeAddress, String shippingAddress, String storeContact, String emailAddress, String phoneNumber
                            , String province, String paymentTerms, String shippingInstructions, string rep)
        {
            InitializeComponent();
            List <ProvinceTax> provinceTaxList = ProvinceTaxDatabase.GetAllProvinces();

            Object[] arr = new Object[provinceTaxList.Count];
            for (int i = 0; i < provinceTaxList.Count; i++)
            {
                arr[i] = provinceTaxList[i].provinceTax + " - GST: " + provinceTaxList[i].gst + "%/PST: " + provinceTaxList[i].pst + "%";
            }
            provinceTax_comboBox.Items.AddRange(arr);

            setTextBoxLimits();
            storeName_textBox.Text    = storeName;
            storeDetails_textBox.Text = storeDetails;
            parseStringToGroup(officeAddress, groupBox1);
            parseStringToGroup(shippingAddress, groupBox2);
            storeContact_textBox.Text         = storeContact;
            email_textBox.Text                = emailAddress;
            phoneNumber_textBox.Text          = phoneNumber;
            paymentTerms_textBox.Text         = paymentTerms;
            shippingInstructions_textBox.Text = shippingInstructions;
            provinceTax_comboBox.Text         = provinceTax_comboBox.Items[provinceTax_comboBox.FindString(province)].ToString();
            rep_textBox.Text = rep;
            editMode         = true;
            storeNumber      = CustomerDatabase.GetStoreID(storeName, shippingAddress);
        }
示例#2
0
        private void CustomerList_DoubleClick(object sender, EventArgs e)
        {
            int         customerID  = CustomerDatabase.GetStoreID(custList.SelectedItems[0].Text, custList.SelectedItems[0].SubItems[3].Text);
            InvoiceForm invoiceForm = new InvoiceForm(customerID);

            invoiceForm.Size = new System.Drawing.Size(900, 700);
            invoiceForm.Show();
            this.Close();
        }
示例#3
0
 private void SelectCustomerButton_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem l in custList.SelectedItems)
     {
         int         customerID  = CustomerDatabase.GetStoreID(l.SubItems[0].Text, l.SubItems[3].Text);
         InvoiceForm invoiceForm = new InvoiceForm(customerID);
         invoiceForm.Size = new System.Drawing.Size(900, 700);
         invoiceForm.Show();
         this.Close();
     }
 }
示例#4
0
        static void SeedData()
        {
            ProvinceTaxDatabase.AddProvinceTax("ON1", 7, 5);
            ProvinceTaxDatabase.AddProvinceTax("ON2", 0, 5);
            ProvinceTaxDatabase.AddProvinceTax("BC1", 7, 12);
            ProvinceTaxDatabase.AddProvinceTax("BC2", 0, 5);
            ProvinceTaxDatabase.AddProvinceTax("BC3", 7, 5);
            ProvinceTaxDatabase.AddProvinceTax("AB1", 7, 5);


            ProductDatabase.AddProduct("12121", "Bouncy Ball", 1, "TSBK", 1.70, 2.50, 3242343, "may7");
            ProductDatabase.AddProduct("34523", "PlayDough", 6, "TS", 3.90, 4.99, 3453453, "discontinued");
            ProductDatabase.AddProduct("78666", "U-Fidget", 15, "TS", 1.25, 2.00, 5645334, "discontinued");
            ProductDatabase.AddProduct("34513", "Kaleidoscope", 20, "TS", 5.50, 6.50, 6433423, "jn9");
            ProductDatabase.AddProduct("89798", "PlayDough", 8, "TS", 1.20, 2.50, 2565443, "discontinued");
            ProductDatabase.AddProduct("45323", "Sidewalk Chalk", 12, "TS00", 5.50, 7.00, 4534634);
            ProductDatabase.AddProduct("89675", "Rubber Duck", 5, "TSD", 1.90, 2.20, 9678565);
            ProductDatabase.AddProduct("34921", "Baseball", 20, "TS2", 3.00, 3.50, 3527657);
            ProductDatabase.AddProduct("90243", "SuperSoaker", 1, "TS3", 10.50, 12.50, 7687432);
            ProductDatabase.AddProduct("43424", "Diving Sub", 10, "TS1", 3.50, 4.00, 1787424);
            ProductDatabase.AddProduct("42131", "Geo Twister", 4, "TS1", 1.50, 2.00, 2437583);
            ProductDatabase.AddProduct("14513", "Chicken Flingers", 16, "TS1", 8.50, 10.00, 5898275);
            ProductDatabase.AddProduct("24235", "Stunt Flyer", 18, "TS1", 4.00, 4.50, 4980240);



            CustomerDatabase.AddCustomer("Splash Toys", "", "*****@*****.**", "1201 Main st, Vancouver, BC  V6G9K7", "1201 Main st, Vancouver, BC  V6G9K7", "Nicole", "6047990643", "net30", "fedex", "BC2", "Kyle");
            CustomerDatabase.AddCustomer("Kaboodles", "", "*****@*****.**", "5601 Broadway st, Vancouver, BC  L6G9K7", "5601 Broadway st, Vancouver, BC  L6G9K7", "Ben", "6047342643", "credit", "canpar", "BC3", "Jake");
            CustomerDatabase.AddCustomer("Childrens Hospital", "Gift Shop", "*****@*****.**", "8901 Cambie st, Vancouver, BC  H7J9K0", "8901 Cambie st, Vancouver, BC  H7J9K0", "Sammy", "6045690643", "net30", "canpar", "BC1", "Kyle");
            CustomerDatabase.AddCustomer("Science World Edmonton", "Gift Shop", "*****@*****.**", "4745 Main st, Edmonton, AB  K7G5F4", "4745 Main st, Edmonton, AB  K7G5F4", "Julie", "6047670643", "net30", "canpar", "AB1", "Mike");

            int custID;

            custID = CustomerDatabase.GetStoreID("Splash Toys", "1201 Main st, Vancouver, BC  V6G9K7");
            InvoiceDatabase.AddInvoice(custID, "2312343", "", "", 0, 0, 0, 0, 1);
            InvoiceDatabase.UpdateBackorderSpecialNotes(custID, "monday only not friday");
            InvoiceContentsDatabase.AddInvoiceContent(1, "12121", 10, "2 Red");
            InvoiceContentsDatabase.AddInvoiceContent(1, "24235", 8, "");
            InvoiceContentsDatabase.AddInvoiceContent(1, "89675", 12, "1 Pink");
            InvoiceContentsDatabase.AddInvoiceContent(1, "90243", 2, "");
            InvoiceContentsDatabase.AddInvoiceContent(1, "43424", 5, "");

            custID = CustomerDatabase.GetStoreID("Kaboodles", "5601 Broadway st, Vancouver, BC  L6G9K7");
            InvoiceDatabase.AddInvoice(custID, "2312343", "", "", 0, 0, 0, 0, 2);
            InvoiceContentsDatabase.AddInvoiceContent(2, "45323", 10, "3 blue");
            InvoiceContentsDatabase.AddInvoiceContent(2, "34523", 8, "");
            InvoiceContentsDatabase.AddInvoiceContent(2, "34513", 12, "1 Pink");
            InvoiceContentsDatabase.AddInvoiceContent(2, "89798", 2, "");
            InvoiceContentsDatabase.AddInvoiceContent(2, "42131", 5, "");
        }
示例#5
0
 private void DeleteCustomer_Click(object sender, EventArgs e)
 {
     if (custList.SelectedItems.Count > 0)
     {
         var confirmResult = MessageBox.Show("Are you sure to delete this item ??",
                                             "Confirm Delete!!",
                                             MessageBoxButtons.YesNo);
         if (confirmResult == DialogResult.Yes)
         {
             foreach (ListViewItem l in custList.SelectedItems)
             {
                 Debug.Print("storeID" + CustomerDatabase.GetStoreID(l.SubItems[0].Text, l.SubItems[3].Text));
                 CustomerDatabase.DeleteCustomer(CustomerDatabase.GetStoreID(l.SubItems[0].Text, l.SubItems[3].Text));
             }
             RefreshView();
         }
         else
         {
             // If 'No', do something here.
         }
     }
 }