Exemplo n.º 1
0
 public void delete(CajaEnt caja)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Update Caja Set Estado = 'INACTIVA' From Caja Where Id = @Id";
     sqlCommand.Parameters.AddWithValue("@Id", caja.ID);
     sqlConnection.Open();
     sqlCommand.ExecuteNonQuery();
     sqlConnection.Close();
 }
Exemplo n.º 2
0
 public int exists(CajaEnt caja)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select Count(Id) From Caja Where Estado = 'ACTIVA' And Nombre_De_Equipo = @Nombre_De_Equipo";
     sqlCommand.Parameters.AddWithValue("@Nombre_De_Equipo", caja.NOMBRE_DE_EQUIPO);
     sqlConnection.Open();
     int exists = Convert.ToInt32(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return exists;
 }
Exemplo n.º 3
0
 public int authenticateNumber(CajaEnt caja)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select Count(Id) From Caja Where Estado = 'ACTIVA' And Numero = @Numero And Id <> @Id";
     sqlCommand.Parameters.AddWithValue("@Numero", caja.NUMERO);
     sqlCommand.Parameters.AddWithValue("@Id", caja.ID);
     sqlConnection.Open();
     int exists = Convert.ToInt32(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return exists;
 }
Exemplo n.º 4
0
 public int add(CajaEnt caja)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.StoredProcedure;
     sqlCommand.CommandText = "insertarCaja";
     sqlCommand.Parameters.AddWithValue("@Nombre_De_Equipo", caja.NOMBRE_DE_EQUIPO);
     sqlCommand.Parameters.AddWithValue("@Numero", caja.NUMERO);
     sqlConnection.Open();
     int id = Convert.ToInt32(sqlCommand.ExecuteScalar());
     sqlConnection.Close();
     return id;
 }
Exemplo n.º 5
0
 public void update(CajaEnt caja)
 {
     objetoCaja.update(caja);
 }
Exemplo n.º 6
0
 public int getNumber(CajaEnt caja)
 {
     return objetoCaja.getNumber(caja);
 }
Exemplo n.º 7
0
 public int getId(CajaEnt caja)
 {
     return objetoCaja.getId(caja);
 }
Exemplo n.º 8
0
 public DataTable getById(CajaEnt caja)
 {
     return objetoCaja.getById(caja);
 }
Exemplo n.º 9
0
 public int exists(CajaEnt caja)
 {
     return objetoCaja.exists(caja);
 }
Exemplo n.º 10
0
 public void delete(CajaEnt caja)
 {
     objetoCaja.delete(caja);
 }
Exemplo n.º 11
0
 public int authenticateNumber(CajaEnt caja)
 {
     return objetoCaja.authenticateNumber(caja);
 }
Exemplo n.º 12
0
 public int add(CajaEnt caja)
 {
     return objetoCaja.add(caja);
 }
Exemplo n.º 13
0
 public DataTable getById(CajaEnt caja)
 {
     SqlConnection sqlConnection = new SqlConnection(ConexionDal.connectionString);
     SqlCommand sqlCommand = sqlConnection.CreateCommand();
     sqlCommand.CommandType = CommandType.Text;
     sqlCommand.CommandText = "Select Numero From Caja Where Id = @Id";
     sqlCommand.Parameters.AddWithValue("@Id", caja.ID);
     SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
     DataTable dataTable = new DataTable("Caja");
     sqlDataAdapter.SelectCommand = sqlCommand;
     sqlDataAdapter.Fill(dataTable);
     return dataTable;
 }