public int DeleteCliente(ClienteDST dsCliente) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("delete cliente where cod_cli = @cod_cli", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.Add(new SqlParameter("@cod_cli", dsCliente.Cedula)); int resultado = Command.ExecuteNonQuery(); conn.Close(); return(resultado); }
public int DeleteTurno(TurnoDST dsTurno) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("delete TURNO where id = @id", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.Add(new SqlParameter("@id", dsTurno.Id)); int resultado = Command.ExecuteNonQuery(); conn.Close(); return(resultado); }
public int updateTurnobyEstado(TurnoDST dsTurno) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("UPDATE TURNO SET COD_CE = @Cod_ce WHERE id = @id", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.Add(new SqlParameter("@id", dsTurno.Id)); Command.Parameters.Add(new SqlParameter("@cod_ce", dsTurno.Cod_ce)); int resultado = Command.ExecuteNonQuery(); conn.Close(); return(resultado); }
public void insertTurno(TurnoDST dsTurno) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("INSERT INTO TURNO ( COD_CLI, COD_COLA, FECHA, COD_CE) " + " VALUES ( @cod_cli, @cod_cola, @fecha, @cod_ce)", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.AddWithValue("cod_cli", dsTurno.Cod_cli); Command.Parameters.AddWithValue("cod_cola", dsTurno.Cod_cola); Command.Parameters.AddWithValue("fecha", dsTurno.Fecha); Command.Parameters.AddWithValue("cod_ce", dsTurno.Cod_ce); Command.ExecuteNonQuery(); conn.Close(); }
public void insertCliente(ClienteDST dsCliente) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("INSERT INTO CLIENTE (CEDULA, NOMBRE, TELEFONO, CORREO, CELULAR) " + " VALUES (@cedula, @nombre, @telefono, @correo, @celular)", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.AddWithValue("cedula", dsCliente.Cedula); Command.Parameters.AddWithValue("nombre", dsCliente.Nombre); Command.Parameters.AddWithValue("telefono", dsCliente.Telefono); Command.Parameters.AddWithValue("correo", dsCliente.Correo); Command.Parameters.AddWithValue("celular", dsCliente.Celular); Command.ExecuteNonQuery(); conn.Close(); }
public int updateCliente(ClienteDST dsCliente) { IDbConnection conn = DBComon.Conexion(); conn.Open(); SqlCommand Command = new SqlCommand("UPDATE CLIENTE SET NOMBRE = @nombre, TELEFONO = @telefono, " + "CORREO = @correo, CELULAR = @celular WHERE COD_CLI= @cod_cli", conn as SqlConnection); Command.CommandType = CommandType.Text; Command.Parameters.Add(new SqlParameter("@cod_cli", dsCliente.Cod_cli)); Command.Parameters.Add(new SqlParameter("@cedula", dsCliente.Cedula)); Command.Parameters.Add(new SqlParameter("@nombre", dsCliente.Nombre)); Command.Parameters.Add(new SqlParameter("@telefono", dsCliente.Telefono)); Command.Parameters.Add(new SqlParameter("@correo", dsCliente.Correo)); Command.Parameters.Add(new SqlParameter("@celular", dsCliente.Celular)); int resultado = Command.ExecuteNonQuery(); conn.Close(); return(resultado); }
public DataSet ListarClientebyEstado(int cliente) { IDbConnection conn = DBComon.Conexion(); conn.Open(); DataSet dataSet = null; ClienteDST clientes = new ClienteDST(); DataTable dt = new DataTable(); SqlCommand Command = new SqlCommand("SELECT CEDULA, NOMBRE, TELEFONO, CORREO, CELULAR FROM CLIENTE WHERE COD_CLI'" + cliente + "'", conn as SqlConnection); Command.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(Command); dataSet = new DataSet(); da.Fill(dataSet, "Cliente"); conn.Close(); return(dataSet); }