Esempio 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();
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio n. 5
0
 public void update(CajaEnt caja)
 {
     objetoCaja.update(caja);
 }
Esempio n. 6
0
 public int getNumber(CajaEnt caja)
 {
     return objetoCaja.getNumber(caja);
 }
Esempio n. 7
0
 public int getId(CajaEnt caja)
 {
     return objetoCaja.getId(caja);
 }
Esempio n. 8
0
 public DataTable getById(CajaEnt caja)
 {
     return objetoCaja.getById(caja);
 }
Esempio n. 9
0
 public int exists(CajaEnt caja)
 {
     return objetoCaja.exists(caja);
 }
Esempio n. 10
0
 public void delete(CajaEnt caja)
 {
     objetoCaja.delete(caja);
 }
Esempio n. 11
0
 public int authenticateNumber(CajaEnt caja)
 {
     return objetoCaja.authenticateNumber(caja);
 }
Esempio n. 12
0
 public int add(CajaEnt caja)
 {
     return objetoCaja.add(caja);
 }
Esempio 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;
 }