/// <summary>
 /// Deprecated Method for adding a new object to the ClienteDefactura EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClienteDefactura(ClienteDefactura clienteDefactura)
 {
     base.AddObject("ClienteDefactura", clienteDefactura);
 }
Пример #2
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            try
                {
                    if (this.txtIdentificacion .Text == "")
                    {
                        MessageBox.Show("Ingrese Identificaion.", "Modulo de Facturacion",
                MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    if (this.txtNombreRazonSocial.Text == "")
                    {
                        MessageBox.Show("Ingrese Ingrese Nombre o Razón social para el registro.", "Modulo de Facturacion",
                MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    if (this.txtDireccion.Text == "")
                    {
                        MessageBox.Show("Ingrese Ingrese la direccion para el registro.", "Modulo de Facturacion",
                MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    ClienteDefactura obj = new ClienteDefactura();
                    obj.IdNumeroCliente = Int32.Parse(txtNumeroCliente.Text);
                    obj.Identificacion = Int32.Parse(txtIdentificacion.Text);
                    obj.Fecha = this.dtpFecha.Value;
                    obj.FechaNacimiento = this.dtpFechaNacimiento.Value;
                    obj.NombreRazonSocial = this.txtNombreRazonSocial.Text;
                    obj.Apellido = this.txtApellido.Text;
                    obj.Genero = cmbGenero.SelectedItem.ToString();
                    obj.Direccion = this.txtDireccion.Text;
                    obj.Telefono = Int32.Parse(txtTelefono.Text);
                    obj.Celular = Int32.Parse(txtCelular.Text);
                    obj.CorreoElectronico = this.txtCorreo.Text;

                    obj.IdEmpresa = Seguridad.empresa;
                    obj.idUsuario = Seguridad.usuario;
                    obj.idEstado = Int32.Parse(cmbEstado.SelectedValue.ToString());

                    da.AddToClienteDefactura(obj);
                    int respuesta = da.SaveChanges();
                    if (respuesta > 0)
                    {
                        MessageBox.Show("Registro Ingresado con exito.", "Modulo de Facturacion",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                        cargarClientes();
                        limpiar();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Ingrese Correctamente los valores. " + ex.Message, "Modulo de Facturacion",
            MessageBoxButtons.OK, MessageBoxIcon.Error);

                }
        }
 /// <summary>
 /// Create a new ClienteDefactura object.
 /// </summary>
 /// <param name="idEmpresa">Initial value of the IdEmpresa property.</param>
 /// <param name="idUsuario">Initial value of the idUsuario property.</param>
 /// <param name="idNumeroCliente">Initial value of the IdNumeroCliente property.</param>
 /// <param name="identificacion">Initial value of the Identificacion property.</param>
 /// <param name="fecha">Initial value of the Fecha property.</param>
 /// <param name="nombreRazonSocial">Initial value of the NombreRazonSocial property.</param>
 /// <param name="direccion">Initial value of the Direccion property.</param>
 /// <param name="telefono">Initial value of the Telefono property.</param>
 /// <param name="celular">Initial value of the Celular property.</param>
 /// <param name="idEstado">Initial value of the idEstado property.</param>
 public static ClienteDefactura CreateClienteDefactura(global::System.Int32 idEmpresa, global::System.Int32 idUsuario, global::System.Int32 idNumeroCliente, global::System.Int32 identificacion, global::System.DateTime fecha, global::System.String nombreRazonSocial, global::System.String direccion, global::System.Int32 telefono, global::System.Int32 celular, global::System.Int32 idEstado)
 {
     ClienteDefactura clienteDefactura = new ClienteDefactura();
     clienteDefactura.IdEmpresa = idEmpresa;
     clienteDefactura.idUsuario = idUsuario;
     clienteDefactura.IdNumeroCliente = idNumeroCliente;
     clienteDefactura.Identificacion = identificacion;
     clienteDefactura.Fecha = fecha;
     clienteDefactura.NombreRazonSocial = nombreRazonSocial;
     clienteDefactura.Direccion = direccion;
     clienteDefactura.Telefono = telefono;
     clienteDefactura.Celular = celular;
     clienteDefactura.idEstado = idEstado;
     return clienteDefactura;
 }