コード例 #1
0
 public virtual void TemplateCategoryDelete(TemplateCategory entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdTemplateCategoryDelete(entity.TemplateRef,
                                             entity.ProgramCategoryRef);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
コード例 #2
0
        // -------------------------------------------------------------------------------------
        /// <summary>
        /// Insert a new Template record to the database
        /// </summary>
        // -------------------------------------------------------------------------------------
        private void InsertData()
        {
            try
              {
            ITemplateService srv = ServiceFactory.GetTemplateService();
            m_Template.Name = txtName.Text;
            m_Template.IsActive = cbxActivate.Checked;
            m_Template.PublicityLevel = Convert.ToInt32(cmbPublicityLevel.SelectedValue);

            // set categories:
            if (rbtCategoryOrganisation.Checked)
            {
              TemplateCategory catOrg = new TemplateCategory(m_Template.ID, "ORG");
              m_Template.Categories.Insert(catOrg);
            }
            if (rbtCategoryProgram.Checked)
            {
              if (cbxCategoryOther.Checked)
              {
            TemplateCategory catOth = new TemplateCategory(m_Template.ID, "OTH");
            m_Template.Categories.Insert(catOth);
              }
              if (cbxCategoryPrevention.Checked)
              {
            TemplateCategory catPre = new TemplateCategory(m_Template.ID, "PRE");
            m_Template.Categories.Insert(catPre);
              }
              if (cbxCategoryResearch.Checked)
              {
            TemplateCategory catRes = new TemplateCategory(m_Template.ID, "RES");
            m_Template.Categories.Insert(catRes);
              }
              if (cbxCategoryTreatment.Checked)
              {
            TemplateCategory catTre = new TemplateCategory(m_Template.ID, "TRE");
            m_Template.Categories.Insert(catTre);
              }
            }

            srv.TemplateInsert(m_Template);
              }
              catch (Exception ex)
              {
            throw ex;
              }
        }
コード例 #3
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public TemplateCategory(TemplateCategory origInstance)
     : base(origInstance)
 {
 }
コード例 #4
0
 public virtual TemplateCategory TemplateCategorySelect(DBGuid TemplateRefVal,
                                                    DBString ProgramCategoryRefVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     TemplateCategory result = null;
     DataSet entitySet = m_DataContext.ndihdTemplateCategorySelect(TemplateRefVal,
                                                               ProgramCategoryRefVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new TemplateCategory(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }