コード例 #1
0
        private void GrabarNuevoRegistro()
        {
            //Crear el Objeto producto.
            ClassCustomer   customer        = new ClassCustomer();
            CustomerManager customerManager = new CustomerManager();

            customer.CustomerID   = txt_customer_id.Text;
            customer.CustomerName = txt_CustomerName.Text;
            customer.Category     = txt_category.Text;
            customer.direcc       = txt_customers_direcc.Text;
            customer.email        = txt_customer_email.Text;
            customer.phone        = txt_phone.Text;
            customer.Anulado      = false;
            // Validar la entidad Producto.
            if (customer.CustomerID == string.Empty)
            {
                MessageBox.Show("Introduzca el ID del cliente...");
                return;
            }
            if (customer.CustomerName == string.Empty)
            {
                MessageBox.Show("Introduzca el nombre del Cliente.");
                return;
            }
            customerManager.Add(customer);
            OpcionesMenu(0);
            OpcionesForms(0);
            CHK_ANULADO.DataBindings.Add("checked", bs, "anulado");
            ContadorRegistros();
            EditMode = 0;
        }
コード例 #2
0
        private void GrabarUpdateRegistro()
        {
            ClassCustomer customer = new ClassCustomer();

            customer.CustomerID   = txt_customer_id.Text;
            customer.CustomerName = txt_CustomerName.Text;
            customer.Category     = txt_category.Text;
            customer.direcc       = txt_customers_direcc.Text;
            customer.email        = txt_customer_email.Text;
            customer.Anulado      = CHK_ANULADO.Checked;
            customer.phone        = txt_phone.Text;
            CustomerManager customerManager = new CustomerManager();

            customerManager.Update(customer);
            OpcionesMenu(0);
            OpcionesForms(0);
            CHK_ANULADO.Enabled = false;
            EditMode            = 0;
        }