Esempio n. 1
0
 private void btnNewDetail_Click(object sender, EventArgs e)
 {
     frmTemplateDetailEdit frmNew = null;
       try
       {
     frmNew = new frmTemplateDetailEdit(m_CurrentTemplateID, m_Template.Pages, m_Template.Details);
     DialogResult result = frmNew.ShowDialog();
     if (result == DialogResult.OK)
     {
       m_Template.Details.Insert(frmNew.CurrentDetail);
       FillDetailsGrid(frmNew.CurrentDetail.ID);
     }
       }
       catch (Exception ex)
       {
     //	---	Log exception
     ExceptionManager.Publish(ex);
     //	---	Display Exception
     ErrorHandler.DisplayError("Nem várt hiba történt az új kérdés felvétele során.", ex);
       }
       finally
       {
     if (frmNew != null) frmNew.Dispose();
       }
 }
Esempio n. 2
0
        private void btnModifyDetail_Click(object sender, EventArgs e)
        {
            frmTemplateDetailEdit frmEdit = null;
              try
              {
            string detailId = dtgDetails.GetSelectedRowCell("ID").ToString();
            string hash = detailId + "<#>" + m_Template.ID.ToString();

            frmEdit = new frmTemplateDetailEdit((TemplateDetail) m_Template.Details[hash], m_Template.Pages);
            DialogResult result = frmEdit.ShowDialog();
            if (result == DialogResult.OK)
            {
              #region Inaktív oldalhoz nem lehet aktív kérdést beszúrni ...

              int pageIndex = frmEdit.CurrentDetail.PageIndex;
              string hashTemplatePage = m_CurrentTemplateID.ToString() + "<#>" + pageIndex.ToString();

              TemplatePage selectedPage = (TemplatePage) m_Template.Pages[hashTemplatePage];

              if ((cbxActivate.Checked == true) && (selectedPage.IsActive == false))
              {
            selectedPage.IsActive = true;
              }

              #endregion

              FillDetailsGrid(frmEdit.CurrentDetail.ID);
              FillPagesGrid(pageIndex);
            }
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Nem várt hiba történt a kérdés módosítása során.", ex);
              }
              finally
              {
            if (frmEdit != null) frmEdit.Dispose();
              }
        }