Exemplo n.º 1
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            try
              {
            if (!Page.IsValid)
            {
              return;
            }

            string orgID = Request["orgID"];
            Guid orgGuid = new Guid(orgID);

            IKefEventService srvKefEvent = ServiceFactory.GetKefEventService();
            KefEvent item = new KefEvent(Guid.NewGuid());

            item.OrganisationRef = orgGuid;
            item.Name = txtName.Text;
            item.Location = txtLocation.Text;
            item.Date = Convert.ToDateTime(txtDate.Text + " " + txtTime.Text);
            item.Description = txtDescription.Text;
            item.IsActive = cbxActive.Checked;

            srvKefEvent.KefEventInsert(item);

            Response.Redirect("KefOrganisationData.aspx?orgID=" + orgID);
              }
              catch (Exception ex)
              {
            errorPanel.Exception = ex;
              }
        }
Exemplo n.º 2
0
 public virtual void KefEventDelete(KefEvent entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdKefEventDelete(entity.ID);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Exemplo n.º 3
0
        public override void KefEventInsert(KefEvent entity)
        {
            //
              // Esemény beszúrás elõtt frissíteni kell az utolsó módosítás dátumát
              //
              OrganisationService srvOrg = new OrganisationService();
              Organisation org = srvOrg.OrganisationSelect(entity.OrganisationRef);

              org.KefEventsLastModified = DateTime.Now;
              srvOrg.OrganisationUpdateBase(org);

              //
              // Beszúrjuk az eseményt
              //
              base.KefEventInsert(entity);
        }
Exemplo n.º 4
0
 public virtual void KefEventUpdate(KefEvent entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       int count;
       m_DataContext.ndihdKefEventUpdate(entity.OrganisationRef,
                                     entity.ID,
                                     entity.Name,
                                     entity.Location,
                                     entity.Date,
                                     entity.Description,
                                     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;
       }
 }
Exemplo n.º 5
0
 public virtual KefEvent KefEventSelect(DBGuid IDVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     KefEvent result = null;
     DataSet entitySet = m_DataContext.ndihdKefEventSelect(IDVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new KefEvent(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Exemplo n.º 6
0
 public virtual void KefEventInsert(KefEvent entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdKefEventInsert(entity.OrganisationRef,
                                     entity.ID,
                                     entity.Name,
                                     entity.Location,
                                     entity.Date,
                                     entity.Description,
                                     entity.IsActive);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
 private void gridKefEvents_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName.ToLower().Equals("delete"))
       {
     string kefId = e.CommandArgument.ToString();
     Guid kefGuid = new Guid(kefId);
     KefEvent kefEvent = new KefEvent(kefGuid);
     IKefEventService srv = ServiceFactory.GetKefEventService();
     srv.KefEventDelete(kefEvent);
     ShowKefEventGrid();
       }
 }
        ///---------------------------------------------------------------------------------
        /// <summary>
        /// hozzáadunk egy úk KEF eseményt a container -hez
        /// </summary>
        ///---------------------------------------------------------------------------------
        private void KefEventSave()
        {
            KefEvent item = new KefEvent(Guid.NewGuid());
              item.OrganisationRef = CurrentID;
              item.Name = txtKefEventName.Text;
              item.Location = txtKefEventLocation.Text;
              item.Description = txtKefEventDescription.Text;
              item.Date = dtpKefEventDate.Value;
              item.IsActive = cbxKefActive.Checked;

              m_CurrentKefEvents.Add(item);

              //töröljük a beviteli mezõk tartalmát
              txtKefEventName.Text = "";
              txtKefEventLocation.Text = "";
              txtKefEventDescription.Text = "";
              cbxKefActive.Checked = true;

              //frissitjük a gridet
              FillKefEventsDatagrid(item.ID);
        }
Exemplo n.º 9
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="IDVal">Value of 'uID' field</param>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public KefEvent(DBGuid IDVal,
             KefEvent origInstance)
     : base(IDVal, origInstance)
 {
 }
Exemplo n.º 10
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public KefEvent(KefEvent origInstance)
     : base(origInstance)
 {
 }