Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Results.SelectedIndex == -1)
            {
                MessageBox.Show("Nothing selected!");
                return;
            }
            var customer = new Customer();
            var results  = Results.SelectedItem.ToString().Split('/');

            foreach (var item in results)
            {
                var data = item.Split(':');
                if (data.Length < 2)
                {
                    continue;
                }
                if (data[0] == "ID")
                {
                    customer.ID = int.Parse(data[1]);
                }
                if (data[0] == "Name")
                {
                    customer.Name = data[1];
                }
                if (data[0] == "Phone")
                {
                    customer.Phone = data[1];
                }
                if (data[0] == "ShippingAddress")
                {
                    customer.ShippingAddress = data[1];
                }
                if (data[0] == "Insta")
                {
                    customer.Instagram_user = data[1];
                }
                if (data[0] == "Email")
                {
                    customer.Email = data[1];
                }
            }
            this.Hide();
            var cus = new CustomersForm(customer);

            cus.ShowDialog();
        }
        // Buttons
        private void btnAccounts_Click(object sender, EventArgs e)
        {
            CustomersForm cf = new CustomersForm(this);

            cf.Show();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var cus = new CustomersForm();

            cus.ShowDialog();
        }