Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            String name, lastName;

            try
            {
                name = customerName.Text;
                lastName = customerLastName.Text;

                Customer customer = new Customer();
                customer.setName(name);
                customer.setLastName(lastName);

                cMode.insercik(customer, 3);
                MessageBox.Show("Inserted", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            catch
            {
                MessageBox.Show("Something went wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void FormInterface_Load(object sender, EventArgs e)
        {
            IOperation operation;
            Person p = new Person();

            IPerson person = p as IPerson;
            operation = p as IOperation;

            person.Lastname = "Cajandig";
            person.Firstname = "Mikel";
            //operation.Save();



            Customer c = new Customer();
            Icustomer customer = c as Icustomer;
            operation = c as IOperation;
            customer.LastName = "tininin";
            operation.Save();

             
           
        }
Пример #3
0
 public Form1()
 {
     InitializeComponent();
     selectedCustomer = new Customer() { Id = 2, FirstName = "Jane" };
 }