public void update(EmployeStockHisto empStock) { try { empStockHistoDAO.update(empStock); } catch (Exception e) { throw new Exception("Erreur dans EmployeStockHistoService => update:" + e.Message); } }
public void insert(EmployeStockHisto empStock) { try { empStockHistoDAO.insert(empStock); } catch (Exception e) { throw new Exception("Erreur dans EmployeStockHistoService => insert:" + e.Message); } }
public void remove(EmployeStockHisto empStock) { conn = new DB().getConn(); try { string query = "delete * from employe_stock_histo where id = " + empStock.Id; cmd = new NpgsqlCommand(query, conn); cmd.ExecuteNonQuery(); } catch (Exception e) { throw new Exception("Erreur dans EmployeStockHistoDAO=>remove " + e.Message); } finally { conn.Close(); } }
public void update(EmployeStockHisto empStock) { conn = new DB().getConn(); try { string query = "update employe_stock_histo set"; if (empStock.Stock != null) { query += " stock = " + empStock.Stock; } query += " where employe = " + empStock.Employe + " and carte = " + empStock.Carte; cmd = new NpgsqlCommand(query, conn); cmd.ExecuteNonQuery(); } catch (Exception e) { throw new Exception("Erreur dans EmployeStockHistoDAO=>update " + e.Message); } }
public void insert(EmployeStockHisto empStock) { conn = new DB().getConn(); try { string query = "insert into employe_stock_histo (id, employe, stock, carte) " + " values (nextval('seq_employe_stock_histo')," + empStock.Employe + "," + empStock.Stock + "," + empStock.Carte + ")"; Debug.WriteLine("insert" + query); cmd = new NpgsqlCommand(query, conn); cmd.ExecuteNonQuery(); } catch (Exception e) { throw new Exception("Erreur dans EmployeStockHistoDAO=>insert" + e.Message); } finally { conn.Close(); } }