public int add(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.StoredProcedure;
     sqlCommand.CommandText = "insertarEgreso";
     sqlCommand.Parameters.AddWithValue("@Id_Usuario", egreso.ID_USUARIO);
     sqlCommand.Parameters.AddWithValue("@Id_Caja", egreso.ID_CAJA);
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     sqlCommand.Parameters.AddWithValue("@Id_Cliente", egreso.ID_CLIENTE);
     sqlCommand.Parameters.AddWithValue("@Hora", egreso.HORA);
     sqlCommand.Parameters.AddWithValue("@Tipo", egreso.TIPO);
     sqlCommand.Parameters.AddWithValue("@Numero_De_Registro", egreso.NUMERO_DE_REGISTRO);
     sqlCommand.Parameters.AddWithValue("@Metodo_De_Pago", egreso.METODO_DE_PAGO);
     sqlCommand.Parameters.AddWithValue("@Monto", egreso.MONTO);
     sqlCommand.Parameters.AddWithValue("@Monto_De_Cupon", egreso.MONTO_DE_CUPON);
     sqlCommand.Parameters.AddWithValue("@Monto_Extra", egreso.MONTO_EXTRA);
     sqlCommand.Parameters.AddWithValue("@Monto_Pagado", egreso.MONTO_PAGADO);
     sqlCommand.Parameters.AddWithValue("@Cambio", egreso.CAMBIO);
     sqlCommand.Parameters.AddWithValue("@Observaciones", egreso.OBSERVACIONES);
     sqlCommand.Parameters.AddWithValue("@Facturado", egreso.FACTURADO);
     sqlCommand.Parameters.AddWithValue("@Cerrado", egreso.CERRADO);
     sqlCommand.Parameters.AddWithValue("@Estado", egreso.ESTADO);
     sqlConnection.Open();
     int id = Convert.ToInt32(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return id;
 }
 public void close(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Update Egreso Set Cerrado = 1 Where Estado = 'VIGENTE' And Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     sqlConnection.Open();
     sqlCommand.ExecuteNonQuery();
     sqlConnection.Close();
 }
 public void cancel(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Update Egreso Set Estado = 'ANULADO' Where Id = @Id";
     sqlCommand.Parameters.AddWithValue("@Id", egreso.ID);
     sqlConnection.Open();
     sqlCommand.ExecuteNonQuery();
     sqlConnection.Close();
 }
 public int add(EgresoEnt egreso)
 {
     int id = objetoEgreso.add(egreso);
     DetalleDeEgresoBss objetoDetalleDeEgreso = new DetalleDeEgresoBss();
     foreach (DetalleDeEgresoEnt invoiceLine in invoiceLines)
     {
         invoiceLine.ID_EGRESO = id;
         objetoDetalleDeEgreso.add(invoiceLine);
     }
     invoiceLines.Clear();
     return id;
 }
 public int existsMinorSales(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select COUNT(Id) As 'Exists' From Egreso "
         + "Where Id_Cliente = 1 And Tipo = 'VENTA MENOR' And Facturado = 0 And Cerrado = 0 And Estado = 'VIGENTE' "
         + "And Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     sqlConnection.Open();
     int exists = Convert.ToInt32(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return exists;
 }
 public DataTable getById(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select E.Id_Cliente, C.Ci_O_Nit, C.Nombre As Cliente, E.Numero_De_Registro, E.Fecha, E.Monto, "
         + "E.Monto_Pagado, E.Cambio, E.Tipo From Cliente C, Egreso E Where C.Id = E.Id_Cliente And C.Estado = 1 And E.nd Facturado = 0 "
         + "And Cerrado = 0 And Estado = 'VIGENTE' And Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
     sqlDataAdapter.SelectCommand = sqlCommand;
     DataTable dataTable = new DataTable("EgresosMenores");
     sqlDataAdapter.Fill(dataTable);
     return dataTable;
 }
 public DataTable getMinorSalesDetail(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select P.Id, P.Alias, DdE.Cantidad, DdE.Precio_Total "
         + "From Producto P, Egreso E, Detalle_De_Egreso DdE Where P.Id = DdE.Id_Producto And P.Estado = 1 "
         + "And E.Id = DdE.Id_Egreso And E.Id_Cliente = 1 And E.Tipo = 'VENTA MENOR' And E.Facturado = 0 And E.Cerrado = 0 "
         + "And E.Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
     sqlDataAdapter.SelectCommand = sqlCommand;
     DataTable dataTable = new DataTable("Detalle de Egreso Egresos Menores");
     sqlDataAdapter.Fill(dataTable);
     return dataTable;
 }
 public void updateFacturadoById(EgresoEnt egreso)
 {
     objetoEgreso.updateFacturadoById(egreso);
 }
 public DataTable getMinorSalesDetail(EgresoEnt egreso)
 {
     return objetoDetalleDeEgreso.getMinorSalesDetail(egreso);
 }
示例#10
0
 public bool isClosed(EgresoEnt egreso)
 {
     return objetoEgreso.isClosed(egreso);
 }
示例#11
0
 public void update(EgresoEnt egreso)
 {
     objetoEgreso.update(egreso);
 }
示例#12
0
 public DataTable getMinorSales(EgresoEnt egreso)
 {
     return objetoEgreso.getMinorSales(egreso);
 }
示例#13
0
 public decimal getSalesTotalAmount(EgresoEnt egreso)
 {
     return objetoEgreso.getSalesTotalAmount(egreso);
 }
示例#14
0
 public void close(EgresoEnt egreso)
 {
     objetoEgreso.close(egreso);
 }
示例#15
0
 public int existsMinorSales(EgresoEnt egreso)
 {
     return objetoEgreso.existsMinorSales(egreso);
 }
示例#16
0
 public void cancel(EgresoEnt egreso)
 {
     objetoEgreso.cancel(egreso);
 }
示例#17
0
 public DataTable getMinorSales(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select ISNULL(SUM(Monto), 0) As Monto, ISNULL(SUM(Monto_Pagado), 0) As Monto_Pagado, "
         + "ISNULL(SUM(Cambio), 0) As Cambio From Egreso Where Id_Cliente = 1 And Tipo = 'VENTA MENOR' And Facturado = 0 "
         + "And Cerrado = 0 And Estado = 'VIGENTE' And Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
     sqlDataAdapter.SelectCommand = sqlCommand;
     DataTable dataTable = new DataTable("EgresosMenores");
     sqlDataAdapter.Fill(dataTable);
     return dataTable;
 }
示例#18
0
 public decimal getSalesTotalAmount(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select ISNULL(SUM(Monto), 0) As Monto_De_Ventas From Egreso Where Estado = 'VIGENTE' "
         + "And Id_Apertura_De_Caja = @Id_Apertura_De_Caja";
     sqlCommand.Parameters.AddWithValue("@Id_Apertura_De_Caja", egreso.ID_APERTURA_DE_CAJA);
     sqlConnection.Open();
     decimal salesTotalAmount = Convert.ToDecimal(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return salesTotalAmount;
 }
示例#19
0
 public bool isClosed(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select Cerrado From Egreso Where Id = @Id";
     sqlCommand.Parameters.AddWithValue("@Id", egreso.ID);
     sqlConnection.Open();
     bool cerrado = Convert.ToBoolean(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return cerrado;
 }
示例#20
0
 public void update(EgresoEnt egreso)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Update Egreso Set Id_Cliente = @Id_Cliente, Tipo = @Tipo, Metodo_De_Pago = @Metodo_De_Pago, "
         + "Monto = @Monto, Monto_Pagado = @Monto_Pagado, Cambio = @Cambio, Observaciones = @Observaciones, Facturado = @Facturado, "
         + "Estado = @Estado Where Id = @Id";
     sqlCommand.Parameters.AddWithValue("@Id_Cliente", egreso.ID_CLIENTE);
     sqlCommand.Parameters.AddWithValue("@Tipo", egreso.TIPO);
     sqlCommand.Parameters.AddWithValue("@Metodo_De_Pago", egreso.METODO_DE_PAGO);
     sqlCommand.Parameters.AddWithValue("@Monto", egreso.MONTO);
     sqlCommand.Parameters.AddWithValue("@Monto_Pagado", egreso.MONTO_PAGADO);
     sqlCommand.Parameters.AddWithValue("@Cambio", egreso.CAMBIO);
     sqlCommand.Parameters.AddWithValue("@Observaciones", egreso.OBSERVACIONES);
     sqlCommand.Parameters.AddWithValue("@Facturado", egreso.FACTURADO);
     sqlCommand.Parameters.AddWithValue("@Estado", egreso.ESTADO);
     sqlCommand.Parameters.AddWithValue("@Id", egreso.ID);
     sqlConnection.Open();
     sqlCommand.ExecuteNonQuery();
     sqlConnection.Close();
 }