Exemplo n.º 1
0
        private void canceBtn_Click(object sender, EventArgs e)
        {
            this.Close();
            CustomerScreen customerScreen = new CustomerScreen();

            customerScreen.Show();
        }
        private void saveBtn_Click(object sender, EventArgs e)
        {
            var tempId   = 0;
            var name     = nameIn.Text;
            var address  = addressIn.Text;
            var address2 = address2In.Text;
            var city     = cityIn.Text;

            switch (city)
            {
            case "Phoenix":
                city = "1";
                break;

            case "New York":
                city = "2";
                break;

            case "London":
                city = "3";
                break;
            }
            var postal  = postalIn.Text;
            var country = countryIn.Text;

            switch (country)
            {
            case "USA":
                country = "1";
                break;

            case "United Kingdom":
                country = "2";
                break;
            }
            var phone = phoneIn.Text.ToString();

            Customers add = new Customers(tempId, name, address, address2, postal, city, country, phone);

            if (Repo.AddCustomer(add))
            {
                CultureInfo ci = new CultureInfo(CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
                MessageBox.Show(rm.GetString("cust add", ci));
                ci.ClearCachedData();
                this.Close();
                CustomerScreen customerScreen = new CustomerScreen();
                customerScreen.Show();
                ci.ClearCachedData();
            }
            else
            {
                CultureInfo ci = new CultureInfo(CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
                MessageBox.Show(rm.GetString("cust not added", ci));
                ci.ClearCachedData();
            }
        }
Exemplo n.º 3
0
        private void customerRecords_Click(object sender, EventArgs e)
        {
            CustomerScreen customerScreen = new CustomerScreen();

            customerScreen.Show();
        }