Ejemplo n.º 1
0
        /// <summary>
        /// Azione di stop del servizio di pubblicazione
        /// </summary>
        /// <param name="e"></param>
        private void PerformActionStopChannelService(DataGridCommandEventArgs e)
        {
            using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
            {
                Publisher.Proxy.ChannelRefInfo instance = ws.GetChannel(this.GetChannelId(e.Item));

                ws.StopChannel(instance);

                this.grdChannels.EditItemIndex = -1;
                this.Fetch();

                this.SelectedChannel = null;
                this.SelectedDetail  = SelectedDetailsEnum.None;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        private void PerformActionDeleteChannel(DataGridCommandEventArgs e)
        {
            this.SelectedChannel = null;

            using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
            {
                Publisher.Proxy.ChannelRefInfo instance = ws.GetChannel(this.GetChannelId(e.Item));

                ws.RemoveChannel(instance);

                this.grdChannels.CurrentPageIndex = 0;
                this.grdChannels.EditItemIndex    = -1;
                this.Fetch();

                this.PerformActionCloseEvents();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        private void PerformActionDeleteEvent(DataGridCommandEventArgs e)
        {
            Publisher.Proxy.EventInfo eventInfo = this.GetEvent(this.GetEventId(e.Item));

            using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
            {
                eventInfo = ws.RemoveEvent(eventInfo);
            }

            this.SelectedChannel = this.GetChannel(this.SelectedChannel.Id);

            // Reperimento id del canale di pubblicazione selezionato
            //int idChannel = this.GetChannelId(this.grdChannels.SelectedItem);

            this.grdEvents.CurrentPageIndex = 0;
            this.grdEvents.EditItemIndex    = -1;
            this.grdEvents.SelectedIndex    = -1;

            this.FetchEvents(this.SelectedChannel.Id);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Azione di salvataggio dei dati
        /// </summary>
        public Publisher.Proxy.ChannelRefInfo SaveData()
        {
            this.Channel.SubscriberServiceUrl = this.txtSubscriberUrl.Text;
            this.Channel.ChannelName          = this.cboSubscribers.SelectedItem.Text;

            DateTime date;

            if (DateTime.TryParse(this.txtComputeFrom.Text, out date))
            {
                date = date.Add(this.txtComputeFromTime.GetTimeSpan());

                this.Channel.StartLogDate = date;
            }

            this.Channel.ExecutionConfiguration = this.GetExecutionConfigurations();

            using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
            {
                this.Channel = ws.SaveChannel(this.Channel);
            }

            return(this.Channel);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Reperimento dati canale di pubblicazione
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 private Publisher.Proxy.ChannelRefInfo GetChannel(int id)
 {
     using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
         return(ws.GetChannel(id));
 }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        private void PerformActionUpdateEvent(DataGridCommandEventArgs e)
        {
            int eventId = this.GetEventId(e.Item);

            Publisher.Proxy.EventInfo eventInfo = null;

            if (eventId > 0)
            {
                // Reperimento evento
                eventInfo = this.SelectedChannel.Events.Where(itm => itm.Id == eventId).First();
            }
            else
            {
                // Nuovo evento
                eventInfo = new Publisher.Proxy.EventInfo {
                    IdChannel = this.SelectedChannel.Id
                };
            }

            eventInfo.ObjectType         = this.GetObjectTypesDropDown(e.Item).SelectedValue;
            eventInfo.ObjectTemplateName = this.GetObjectTemplatesDropDown(e.Item).SelectedValue;
            eventInfo.EventName          = this.GetObjectLogsDropDown(e.Item).SelectedValue;

            if (eventInfo.ObjectType == ObjectTypes.DOCUMENTO)
            {
                CheckBox chkLoadFile = (CheckBox)e.Item.FindControl("chkLoadFile");
                eventInfo.LoadFileIfDocumentType = chkLoadFile.Checked;
            }

            // Aggiornamento dati
            using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
                eventInfo = ws.SaveEvent(eventInfo);

            this.SelectedChannel = this.GetChannel(this.SelectedChannel.Id);

            // Aggiornamento eventi

            this.grdEvents.EditItemIndex = -1;
            this.grdEvents.SelectedIndex = -1;

            // Caricamento eventi
            this.FetchEvents(this.SelectedChannel.Id);


            //int idChannel = this.GetChannelId(this.grdChannels.SelectedItem);

            //int eventId = this.GetEventId(e.Item);

            //Publisher.Proxy.EventInfo eventInfo = null;

            //if (eventId > 0)
            //{
            //    // Reperimento evento
            //    eventInfo = this.GetEvent(this.GetEventId(e.Item));
            //}
            //else
            //{
            //    // Nuovo evento
            //    eventInfo = new Publisher.Proxy.EventInfo { IdChannel = idChannel };
            //}

            //eventInfo.ObjectType = this.GetObjectTypesDropDown(e.Item).SelectedValue;
            //eventInfo.ObjectTemplateName = this.GetObjectTemplatesDropDown(e.Item).SelectedValue;
            //eventInfo.EventName = this.GetObjectLogsDropDown(e.Item).SelectedValue;

            //if (eventInfo.ObjectType == ObjectTypes.DOCUMENTO)
            //{
            //    CheckBox chkLoadFile = (CheckBox) e.Item.FindControl("chkLoadFile");
            //    eventInfo.LoadFileIfDocumentType = chkLoadFile.Checked;
            //}

            //// Aggiornamento dati
            //using (Publisher.Proxy.PublisherWebService ws = PublisherServiceFactory.Create())
            //    eventInfo = ws.SaveEvent(eventInfo);

            //// Aggiornamento eventi



            //this.grdEvents.EditItemIndex = -1;
            //this.grdEvents.SelectedIndex = -1;

            //// Caricamento eventi
            //this.FetchEvents(idChannel);
        }