public new void DesignerDrogAttachmentDelete( DesignerDrogAttachment entity ) { // check permission: admin PrincipalPermission permReg = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Registered" ); PrincipalPermission permAdmin = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Administrator" ); permReg.Union( permAdmin ).Demand(); TraceCallEnterEvent.Raise(); try { FileDataContext fileDataContext = new FileDataContext(); string ext = Path.GetExtension( entity.Path ).ToLower(); string fileName = entity.ID.ToString() + ext; fileDataContext.DesignerDrogAttachmentDelete( entity.ItemRef, fileName ); base.DesignerDrogAttachmentDelete( entity ); BusinessAuditEvent.Success(); TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish( ex ); BusinessAuditEvent.Fail( new EventParameter( "Exception", ex.ToString() ) ); TraceCallReturnEvent.Raise( false ); throw; } }
public virtual void DesignerDrogAttachmentDelete(DesignerDrogAttachment entity) { TraceCallEnterEvent.Raise(); try { m_DataContext.BeginNestedTran(); try { m_DataContext.ndihdDesignerDrogAttachmentDelete(entity.ID); m_DataContext.CommitNested(); } catch { m_DataContext.RollbackNested(); throw; } TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
public new void DesignerDrogAttachmentUpdate( DesignerDrogAttachment entity ) { // check permission: admin PrincipalPermission permReg = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Registered" ); PrincipalPermission permAdmin = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Administrator" ); permReg.Union( permAdmin ).Demand(); TraceCallEnterEvent.Raise(); try { base.DesignerDrogAttachmentUpdate( entity ); BusinessAuditEvent.Success( new EventParameter( "DesignerDrogAttachmentID", entity.ID ) ); TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish( ex ); BusinessAuditEvent.Fail( new EventParameter( "Exception", ex.ToString() ), new EventParameter( "ContinuativeID", entity.ID ) ); TraceCallReturnEvent.Raise( false ); throw; } }
public new void DesignerDrogAttachmentInsert( DesignerDrogAttachment entity ) { // check permission: admin PrincipalPermission permReg = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Registered" ); PrincipalPermission permAdmin = new PrincipalPermission( Thread.CurrentPrincipal.Identity.Name, "Administrator" ); permReg.Union( permAdmin ).Demand(); TraceCallEnterEvent.Raise(); try { // check required fields: if (entity.Name.Length == 0) throw new ArgumentNullException( "DesignerDrogAttachment.Name", "A csatolt fájl aláírása nincs megadva." ); if (entity.Path.Length == 0) throw new ArgumentNullException( "DesignerDrogAttachment.Path", "A csatolt fájl neve nincs megadva." ); if (entity.FileData == null || entity.FileData.Length == 0) throw new ArgumentNullException( "DesignerDrogAttachment.FileData", "A csatolt fájl nincs megadva, vagy nem létezik." ); // logical checks: string ext = Path.GetExtension( entity.Path ).ToLower(); FileDataContext fileDataContext = new FileDataContext(); string fileName = entity.ID.ToString() + ext; fileDataContext.DesignerDrogAttachmentInsert( entity.ItemRef, fileName, entity.FileData ); entity.FileSize = entity.FileData.Length; entity.CreatedDate = DateTime.Now; base.DesignerDrogAttachmentInsert( entity ); BusinessAuditEvent.Success(); TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish( ex ); BusinessAuditEvent.Fail( new EventParameter( "Exception", ex.ToString() ) ); TraceCallReturnEvent.Raise( false ); throw; } }
public virtual void DesignerDrogAttachmentUpdate(DesignerDrogAttachment entity) { TraceCallEnterEvent.Raise(); try { m_DataContext.BeginNestedTran(); try { int count; m_DataContext.ndihdDesignerDrogAttachmentUpdate(entity.ID, entity.ItemRef, entity.Path, entity.Name, entity.Description, entity.CreatedDate, entity.FileSize, entity.IsActive, out count); if (count == 0) throw new ServiceUpdateException(); m_DataContext.CommitNested(); } catch { m_DataContext.RollbackNested(); throw; } TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
public virtual DesignerDrogAttachment DesignerDrogAttachmentSelect(DBGuid IDVal) { TraceCallEnterEvent.Raise(); try { DesignerDrogAttachment result = null; DataSet entitySet = m_DataContext.ndihdDesignerDrogAttachmentSelect(IDVal); if (entitySet.Tables[0].Rows.Count != 0) { result = new DesignerDrogAttachment(entitySet); } TraceCallReturnEvent.Raise(); return result; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
// ------------------------------------------------------------------------------------- /// <summary> /// Copy constructor. /// </summary> /// <param name="origInstance">Original document data to copy.</param> // ------------------------------------------------------------------------------------- public DesignerDrogAttachment(DesignerDrogAttachment origInstance) : base(origInstance) { }
// ------------------------------------------------------------------------------------- /// <summary> /// Copy constructor. /// </summary> /// <param name="IDVal">Value of 'uID' field</param> /// <param name="origInstance">Original document data to copy.</param> // ------------------------------------------------------------------------------------- public DesignerDrogAttachment(DBGuid IDVal, DesignerDrogAttachment origInstance) : base(IDVal, origInstance) { }