public object Clone()
        {
            var customer = new Customer();
            customer.id = this.id;
            customer.name = this.name;
            customer.cpf = this.cpf;

            return customer;
        }
 public FormOrder(string customerId)
 {
     InitializeComponent();
     persister = new SalePersister(saleRepo, prodRepo, validator, caster);
     this.customer = custRepo.FindById(customerId);
 }
        private void usersGridView_SelectionChanged(object sender, EventArgs e)
        {
            if (!radioActives.Checked)
            {
                btnEdit.Enabled = false;
                btnInactive.Enabled = false;
                btnNewOrder.Enabled = false;
                return;
            }

            if (customersGridView.SelectedRows.Count == 1)
            {
                btnEdit.Enabled = true;
                btnInactive.Enabled = true;
                btnNewOrder.Enabled = true;
                this.selectedCustomer = (Customer)customersGridView.SelectedRows[0].DataBoundItem;
            }
            else
            {
                btnEdit.Enabled = false;
                btnInactive.Enabled = false;
                btnNewOrder.Enabled = false;
            }
        }