Ejemplo n.º 1
0
        private void MostrarCliente(DataRow row)
        {
            if (row == null)
            {
                return;
            }

            Modelo.Ventas.Cliente c = ctrlClientes.GetById((int)row["IdCliente"]);

            if (c == null)
            {
                return;
            }

            this.IdCliente = c.IdCliente;

            this.TxtIdCliente.EditValue = c.IdCliente;
            this.TxtNombre.EditValue    = c.Nombre;
            this.txtTelefono.EditValue  = c.Telefono;
            this.txtCorreo.EditValue    = c.CorreoElectronico;
            this.txtCalle.EditValue     = c.Calle;
            this.txtNumero.EditValue    = c.Numero;
            this.txtColonia.EditValue   = c.Colonia;
            this.txtRfc.EditValue       = c.RFC;
            this.CmbRegimen.EditValue   = (int)c.RegimenFiscal;

            this.lst.IdListaContactos = c.ListaContactos.IdListaContactos;
            foreach (Modelo.Contacto contacto in c.ListaContactos)
            {
                this.lst.Add(contacto);
            }

            GcContactos.RefreshDataSource();
        }
Ejemplo n.º 2
0
        private void GuardarCambios(bool Estatus = true)
        {
            Modelo.Ventas.Cliente cliente = GenerarCliente();
            cliente.Estatus = Estatus;
            ctrlClientes.UpdateCliente(cliente);

            MessageBox.Show("Cambios guardados con éxito");
        }
Ejemplo n.º 3
0
        private Modelo.Ventas.Cliente GenerarCliente()
        {
            Modelo.Ventas.Cliente c = new Modelo.Ventas.Cliente();
            c.IdCliente         = this.IdCliente;
            c.Nombre            = (string)TxtNombre.EditValue;
            c.Calle             = (string)txtCalle.EditValue;
            c.Colonia           = (string)txtColonia.EditValue;
            c.CorreoElectronico = (string)txtCorreo.EditValue;
            c.Estatus           = true;
            c.ListaContactos    = lst;
            c.Numero            = (string)txtNumero.EditValue;
            c.RegimenFiscal     = (Modelo.Ventas.Cliente.RegimenesFiscales)CmbRegimen.EditValue;
            c.RFC      = (string)txtRfc.EditValue;
            c.Telefono = (string)txtTelefono.EditValue;

            return(c);
        }
Ejemplo n.º 4
0
 private void GuardarNuevo()
 {
     Modelo.Ventas.Cliente cliente = GenerarCliente();
     ctrlClientes.InsertarCliente(cliente);
 }