/// <summary> /// Updates the cassette. /// </summary> /// <param name="conn">The connection.</param> /// <param name="cst">The CST.</param> public void updateCassette(DBConnection_EF conn, ACASSETTE cst) { try { conn.SaveChanges(); } catch (Exception ex) { logger.Warn(ex); throw; } }
/// <summary> /// Inserts the cassette. /// </summary> /// <param name="conn">The connection.</param> /// <param name="cst">The CST.</param> public void insertCassette(DBConnection_EF conn, ACASSETTE cst) { try { conn.ACASSETTE.Add(cst); conn.SaveChanges(); } catch (Exception ex) { logger.Warn(ex); throw; } }
/// <summary> /// Gets the cassette. /// </summary> /// <param name="conn">The connection.</param> /// <param name="readLock">The read lock.</param> /// <param name="cst_id">The cst_id.</param> /// <returns>Cassette.</returns> public ACASSETTE getCassette(DBConnection_EF conn, Boolean readLock, string cst_id) { ACASSETTE rtnCST = null; try { var query = from cst in conn.ACASSETTE where cst.CST_ID == cst_id.Trim() select cst; rtnCST = query.SingleOrDefault(); } catch (Exception ex) { logger.Warn(ex); throw; } return(rtnCST); }
/// <summary> /// Gets the cassette by port identifier. /// </summary> /// <param name="conn">The connection.</param> /// <param name="port_id">The port_id.</param> /// <returns>Cassette.</returns> public ACASSETTE getCassetteByPortID(DBConnection_EF conn, string port_id) { ACASSETTE rtnCST = null; try { var query = from cst in conn.ACASSETTE where cst.PORT_ID == port_id.Trim() select cst; rtnCST = query.SingleOrDefault(); } catch (Exception ex) { logger.Warn(ex); throw; } return(rtnCST); }
/// <summary> /// Deletes the cassette. /// </summary> /// <param name="conn">The connection.</param> /// <param name="cst_id">The cst_id.</param> public void deleteCassette(DBConnection_EF conn, string cst_id) { ACASSETTE CSTTemp = null; try { var query = from cst in conn.ACASSETTE where cst.CST_ID == cst_id.Trim() select cst; CSTTemp = query.SingleOrDefault(); conn.ACASSETTE.Remove(CSTTemp); conn.SaveChanges(); } catch (Exception ex) { logger.Warn(ex); throw; } }
/// <summary> /// Loads the cassette. /// </summary> /// <param name="cassette">The cassette.</param> public void loadCassette(ACASSETTE cassette) { BCFUtility.setValueToPropety(ref cassette, ref cassetteItem); OnPropertyChanged(BCFUtility.getPropertyName(() => this.CassetteItem)); }