public static HealthDataEN Convert(HealthDataDTO dto) { HealthDataEN newinstance = null; try { if (dto != null) { newinstance = new HealthDataEN(); newinstance.Id = dto.Id; newinstance.Description = dto.Description; newinstance.Language = dto.Language; newinstance.System = dto.System; newinstance.Code = dto.Code; newinstance.Display = dto.Display; } } catch (Exception ex) { throw ex; } return(newinstance); }
public HealthDataEN ReadOIDDefault(int id ) { HealthDataEN healthDataEN = null; try { SessionInitializeTransaction(); healthDataEN = (HealthDataEN)session.Get(typeof(HealthDataEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is MoSIoTGenNHibernate.Exceptions.ModelException) { throw ex; } throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in HealthDataCAD.", ex); } finally { SessionClose(); } return(healthDataEN); }
public void Destroy(int id ) { try { SessionInitializeTransaction(); HealthDataEN healthDataEN = (HealthDataEN)session.Load(typeof(HealthDataEN), id); session.Delete(healthDataEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is MoSIoTGenNHibernate.Exceptions.ModelException) { throw ex; } throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in HealthDataCAD.", ex); } finally { SessionClose(); } }
public int New_(HealthDataEN healthData) { try { SessionInitializeTransaction(); session.Save(healthData); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is MoSIoTGenNHibernate.Exceptions.ModelException) { throw ex; } throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in HealthDataCAD.", ex); } finally { SessionClose(); } return(healthData.Id); }
public void Modify(int p_HealthData_OID, string p_description, MoSIoTGenNHibernate.Enumerated.MosIoT.LanguageCodeEnum p_language, string p_system, string p_code, string p_display) { HealthDataEN healthDataEN = null; //Initialized HealthDataEN healthDataEN = new HealthDataEN(); healthDataEN.Id = p_HealthData_OID; healthDataEN.Description = p_description; healthDataEN.Language = p_language; healthDataEN.System = p_system; healthDataEN.Code = p_code; healthDataEN.Display = p_display; //Call to HealthDataCAD _IHealthDataCAD.Modify(healthDataEN); }
// Modify default (Update all attributes of the class) public void ModifyDefault(HealthDataEN healthData) { try { SessionInitializeTransaction(); HealthDataEN healthDataEN = (HealthDataEN)session.Load(typeof(HealthDataEN), healthData.Id); healthDataEN.Description = healthData.Description; healthDataEN.Language = healthData.Language; healthDataEN.System = healthData.System; healthDataEN.Code = healthData.Code; healthDataEN.Display = healthData.Display; session.Update(healthDataEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is MoSIoTGenNHibernate.Exceptions.ModelException) { throw ex; } throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in HealthDataCAD.", ex); } finally { SessionClose(); } }
public int New_(string p_description, MoSIoTGenNHibernate.Enumerated.MosIoT.LanguageCodeEnum p_language, string p_system, string p_code, string p_display) { HealthDataEN healthDataEN = null; int oid; //Initialized HealthDataEN healthDataEN = new HealthDataEN(); healthDataEN.Description = p_description; healthDataEN.Language = p_language; healthDataEN.System = p_system; healthDataEN.Code = p_code; healthDataEN.Display = p_display; //Call to HealthDataCAD oid = _IHealthDataCAD.New_(healthDataEN); return(oid); }