public new void EDocumentCommendationDelete(EDocumentCommendation entity)
        {
            // check permission: admin
              PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator");
              permAdmin.Demand();

              TraceCallEnterEvent.Raise();
              try
              {
            base.EDocumentCommendationDelete(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 EDocumentCommendationDelete(EDocumentCommendation entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdEDocumentCommendationDelete(entity.ID);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="IDVal">Value of 'uID' field</param>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public EDocumentCommendation(DBGuid IDVal,
                          EDocumentCommendation origInstance)
     : base(IDVal, origInstance)
 {
 }
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public EDocumentCommendation(EDocumentCommendation origInstance)
     : base(origInstance)
 {
 }
Exemplo n.º 5
0
        /// <summary>
        /// Add a NewsPicture to the list.
        /// </summary>
        private void SaveCommendataion()
        {
            try
              {
            // Validate controls
            if (txtComTitle.Text.Length == 0)
            {
              MessageBox.Show("Az ajánló címe nincs megadva. Adja meg az ajánló címét a beviteli mezõben!",
                          "NDI HelpDesk Adminisztrátor", MessageBoxButtons.OK, MessageBoxIcon.Information);
              txtComTitle.Select();
              return;
            }

            if (txtCommAuthor.Text.Length == 0)
            {
              MessageBox.Show("Az ajánló szerzõje nincs megadva. Adja meg az ajánló szerzõjét a beviteli mezõben!",
                          "NDI HelpDesk Adminisztrátor", MessageBoxButtons.OK, MessageBoxIcon.Information);
              txtCommAuthor.Select();
              return;
            }

            if (txtMessage.Text.Length == 0)
            {
              MessageBox.Show("Az ajánló szövege nincs megadva. Adja meg az ajánló szövegét a beviteli mezõben!",
                          "NDI HelpDesk Adminisztrátor", MessageBoxButtons.OK, MessageBoxIcon.Information);
              txtMessage.Select();
              return;
            }

            bool newItem = true;

            if (m_CurrentCommID == null)
            {
              m_CurrentCommID = new DBGuid(Guid.NewGuid());
            }
            // Add to container
            EDocumentCommendation item =
              (EDocumentCommendation) m_currentDocument.EDocumentCommendations[m_CurrentCommID.Value.ToString()];
            if (item == null)
            {
              item = new EDocumentCommendation(m_CurrentCommID);
            }
            else
            {
              newItem = false;
            }
            item.EDocumentRef = CurrentID;
            item.Title = txtComTitle.Text;
            item.Author = txtCommAuthor.Text;
            item.Message = txtMessage.Text;
            item.Comment = txtComment.Text;

            //item.PicturePath = this.m_strPictureUrlOther;
            if (newItem)
              m_currentDocument.EDocumentCommendations.Add(item);

            // Refresh grid
            FillDatagridComm(item.ID);

            txtComTitle.Text = "";
            txtCommAuthor.Text = "";
            txtMessage.Text = "";
            txtComment.Text = "";
            txtCommCreatedDate.Text = "";
            txtCommModifyDate.Text = "";
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Nem várt hiba lépett fel az ajánló hozzáadása során.", ex);
              }
        }
 public virtual void EDocumentCommendationUpdate(EDocumentCommendation entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       int count;
       m_DataContext.ndihdEDocumentCommendationUpdate(entity.ID,
                                                  entity.EDocumentRef,
                                                  entity.Title,
                                                  entity.Message,
                                                  entity.Author,
                                                  entity.Comment,
                                                  entity.CreatedDate,
                                                  entity.ModifiedDate, 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 EDocumentCommendation EDocumentCommendationSelect(DBGuid IDVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     EDocumentCommendation result = null;
     DataSet entitySet = m_DataContext.ndihdEDocumentCommendationSelect(IDVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new EDocumentCommendation(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }