public virtual void ProgramRegionDelete(ProgramRegion entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdProgramRegionDelete(entity.ProgramRef,
                                          entity.RegionRef);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            try
              {
            if (!Page.IsValid)
            {
              return;
            }

            string orgId = Request["orgid"];
            Guid organisationGuid = new Guid(orgId);
            Guid programGuid = Guid.NewGuid();

            Program program = new Program(programGuid);
            program.Name = txtName.Text;
            program.ProgramCategoryRef = cmbProgramCategory.SelectedValue;
            program.ProgramStatus = cmbProgramStatus.SelectedValue;
            program.StartDate = txtStartDate.Text;
            program.FinishDate = txtFinishDate.Text;
            program.Description = txtDescription.Text;
            program.OrganisationRef = organisationGuid;
            program.NonregisteredPartners = txtNonRegisteredPartners.Text;

            //Megyék
            ProgramRegionContainer programRegions = new ProgramRegionContainer();
            string allRegion = txtSelectedRegion.Text.IndexOf(';') > 0
                             ? txtSelectedRegion.Text.TrimEnd(';')
                             : txtSelectedRegion.Text;
            string[] regions = allRegion.Split(';');
            for (int n = 0; n < regions.Length; n++)
            {
              ProgramRegion region = new ProgramRegion(programGuid, regions[n]);
              if (!programRegions.All.Items.Contains(region))
              {
            programRegions.Add(region);
              }
            }
            program.Regions = programRegions;
            IProgramService srv = ServiceFactory.GetProgramService();
            program.LastModifiedDate = DateTime.Now;
            srv.ProgramInsert(program);
            Response.Redirect("ProgramData.aspx?progId=" + programGuid);
              }
              catch (Exception ex)
              {
            errorPanel.Exception = ex;
              }
        }
Esempio n. 3
0
        // -------------------------------------------------------------------------------------
        /// <summary>
        /// Prepage Save action
        /// </summary>
        // -------------------------------------------------------------------------------------
        private void SaveData()
        {
            IProgramService prgSrv = ServiceFactory.GetProgramService();
              DBGuid ID = new DBGuid(new Guid(m_sCurrentID));
              Program prg = new Program(ID);

              // Get control values

              // First page - tabPageBase
              prg.Name = txtName.Text;
              prg.Description = txtDescription.Text;
              if (cmbResponsible.SelectedIndex > 0)
            prg.ResponsibleRef = new DBGuid(new Guid(cmbResponsible.SelectedValue.ToString()));
              if (cmbCoordinator1.SelectedIndex > 0)
            prg.Coordinator1Ref = new DBGuid(new Guid(cmbCoordinator1.SelectedValue.ToString()));
              if (cmbCoordinator2.SelectedIndex > 0)
            prg.Coordinator2Ref = new DBGuid(new Guid(cmbCoordinator2.SelectedValue.ToString()));
              prg.ProgramStatus = cmbStatus.SelectedValue.ToString();
              if (txtStartDate.Text.Length > 0)
            prg.StartDate = txtStartDate.Text;
              if (txtFinishDate.Text.Length > 0)
            prg.FinishDate = txtFinishDate.Text;
              prg.IsActive = cbxActivate.Checked;

              if (prgSrv.CheckProgramExistByName(prg.Name, prgSrv.ProgramSelect(prg.ID).OrganisationRef, prg.ID))
              {
            MessageBox.Show("Ezzel a névvel már létezik program!",
                        "NDI HelpDesk Adminisztrátor", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            DialogResult = DialogResult.None;
            return;
              }

              //Megyék
              prg.Regions = new ProgramRegionContainer();

              foreach (Region region in lstSelectedRegion.Items)
              {
            ProgramRegion progRegion = new ProgramRegion(prg.ID, region.ID);
            if (prg.Regions[progRegion.HashString()] == null)
            {
              prg.Regions.Add(progRegion);
            }
              }

              // 2nd page - tabPageOrganisation
              prg.Organisations = m_allDataOrg;
              if (txtNonregisteredPartners.Text.Length > 0)
            prg.NonregisteredPartners = txtNonregisteredPartners.Text;

              // 3th page - tabPageExpert
              prg.Experts = m_allDataExp;

              // 4th page - tabPageAttachment
              prg.ProgramAttachments = m_allDataAttachment;

              // 5th Page - tabPageKeyword
              prg.Thesauruses = m_allDataThes;

              // Save values
              prgSrv.ProgramUpdateAdmin(prg);
        }
 public virtual ProgramRegion ProgramRegionSelect(DBGuid ProgramRefVal,
                                              DBString RegionRefVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     ProgramRegion result = null;
     DataSet entitySet = m_DataContext.ndihdProgramRegionSelect(ProgramRefVal,
                                                            RegionRefVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new ProgramRegion(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Esempio n. 5
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public ProgramRegion(ProgramRegion origInstance)
     : base(origInstance)
 {
 }