Exemplo n.º 1
0
 private static void SeedCustomers(int num)
 {
     for (int i = 1; i < num; i++)
     {
         CustomerDatabase.AddCustomer("ExBusiness" + i, "Details" + i, "SpecialNotes" + i, "email" + i + "@gmail.com", "address" + i, "city" + i, "PR", "PostCo",
                                      "contact" + i, "6041111111", "terms" + i, "shipping" + i, "TA" + i, "rep" + i);
     }
 }
Exemplo n.º 2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Boolean err           = false;
            String  officeAddress = (officeUnit_textBox.Text != String.Empty ? officeUnit_textBox.Text + " - " : "") + officeStreet_textBox.Text + ", " +
                                    officeCity_textBox.Text + ", " + provinceConverter(officeProvince_comboBox.Text) + "  " + officePostal_textBox.Text;


            String shippingAddress = (shippingUnit_textBox.Text != String.Empty ? shippingUnit_textBox.Text + " - " : "") + shippingStreet_textBox.Text + ", " +
                                     shippingCity_textBox.Text + ", " + provinceConverter(shippingProvince_comboBox.Text) + "  " + shippingPostal_textBox.Text;

            if (storeName_textBox.Text == String.Empty)
            {
                label1.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                label1.ForeColor = Color.Black;
            }

            if (shippingAddress.Length < 10)
            {
                groupBox2.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                groupBox2.ForeColor = Color.Black;
            }

            if (provinceTax_comboBox.Text == String.Empty)
            {
                label18.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                label18.ForeColor = Color.Black;
            }
            if (err)
            {
                return;
            }
            if (editMode)
            {
                CustomerDatabase.EditCustomer(storeNumber, storeName_textBox.Text, storeDetails_textBox.Text, email_textBox.Text, officeAddress,
                                              shippingAddress, storeContact_textBox.Text, phoneNumber_textBox.Text, paymentTerms_textBox.Text,
                                              shippingInstructions_textBox.Text, provinceTax_comboBox.Text.Split(' ')[0], rep_textBox.Text);
            }
            else
            {
                CustomerDatabase.AddCustomer(storeName_textBox.Text, storeDetails_textBox.Text, email_textBox.Text, officeAddress,
                                             shippingAddress, storeContact_textBox.Text, phoneNumber_textBox.Text, paymentTerms_textBox.Text,
                                             shippingInstructions_textBox.Text, provinceTax_comboBox.Text.Split(' ')[0], rep_textBox.Text);
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 3
0
        private void okButton_Click(object sender, EventArgs e)
        {
            Boolean err = false;


            if (storeName_textBox.Text == String.Empty)
            {
                label1.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                label1.ForeColor = Color.Black;
            }

            if (shippingStreet_textBox.Text.Length == 0 || shippingCity_textBox.Text.Length == 0 || shippingPostal_textBox.Text.Length == 0 || shippingProvince_comboBox.Text.Length == 0)
            {
                groupBox2.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                groupBox2.ForeColor = Color.Black;
            }

            if (provinceTax_comboBox.Text == String.Empty)
            {
                label18.ForeColor = Color.Red;
                err = true;
            }
            else
            {
                label18.ForeColor = Color.Black;
            }
            if (err)
            {
                return;
            }

            if (editMode)
            {
                CustomerDatabase.EditCustomer(storeNumber, storeName_textBox.Text, storeDetails_textBox.Text, storeSpecialNotes_textBox.Text, email_textBox.Text, shippingStreet_textBox.Text,
                                              shippingCity_textBox.Text, provinceConverter(shippingProvince_comboBox.Text), shippingPostal_textBox.Text, storeContact_textBox.Text, phoneNumber_textBox.Text, paymentTerms_textBox.Text,
                                              shippingInstructions_textBox.Text, provinceTax_comboBox.Text.Split(' ')[0], rep_textBox.Text);
            }
            else
            {
                CustomerDatabase.AddCustomer(storeName_textBox.Text, storeDetails_textBox.Text, storeSpecialNotes_textBox.Text, email_textBox.Text, shippingStreet_textBox.Text,
                                             shippingCity_textBox.Text, provinceConverter(shippingProvince_comboBox.Text), shippingPostal_textBox.Text, storeContact_textBox.Text, phoneNumber_textBox.Text, paymentTerms_textBox.Text,
                                             shippingInstructions_textBox.Text, provinceTax_comboBox.Text.Split(' ')[0], rep_textBox.Text);
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 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, "");
        }