/// <summary>
        /// Responds to the users request to Save
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var             oController = new ScheduledSqlJobsController();
            JobScheduleInfo oInfo;

            if (hfJobId.Value.Equals("-1"))
            {
                oInfo = new JobScheduleInfo();
                oInfo.JobScheduleId = -1;
                oInfo.NextJobRun    = System.DateTime.Now.AddMinutes(2);
                oInfo.LastJobRun    = System.DateTime.Now;
            }
            else
            {
                //Load the values
                oInfo = oController.GetJobScheduleItemById(int.Parse(hfJobId.Value));
            }

            //Load the rest
            oInfo.JobFrequencyType  = ddlJobFrequency.SelectedValue;
            oInfo.JobFrequencyValue = int.Parse(txtJobFrequency.Text);
            oInfo.JobScript         = lblJobScriptDisplay.Text;
            oInfo.JobTitle          = ddlJobType.Text;
            oInfo.JobTypeId         = int.Parse(ddlJobType.SelectedValue);

            //Save it
            oController.SaveJobScheduleItem(oInfo);

            //Update
            BindJobsGrid();

            //Cancel
            btnCancel_Click(sender, e);
        }
示例#2
0
 /// <summary>
 /// Create remote scheduling information
 /// </summary>
 public RemoteJobSchedule(JobScheduleInfo jobScheduleInfo)
 {
     this.Interval  = jobScheduleInfo.IntervalXmlSpecified ? (TimeSpan?)jobScheduleInfo.Interval : null;
     this.StartTime = jobScheduleInfo.StartDate;
     this.StopTime  = jobScheduleInfo.StopDateSpecified ? (DateTime?)jobScheduleInfo.StopDate : null;
     this.Days      = jobScheduleInfo.RepeatOn;
     this.Type      = jobScheduleInfo.Type;
 }
        /// <summary>
        /// Kappt die Verbindung zur aktuellen Aufzeichnung.
        /// </summary>
        private void Disconnect()
        {
            // Process
            var current = m_CurrentSource;

            if (current != null)
            {
                try
                {
                    // Process
                    current.StreamTo(Adaptor.EndPoint, null);
                }
                catch
                {
                    // Actually server may be already done so ignore any error
                }
            }

            // Forget
            m_CurrentSource = null;
        }
        /// <summary>
        /// Wählt eine Aufzeichnung aus.
        /// </summary>
        /// <param name="context">Die gewünschte Aufzeichnung.</param>
        /// <returns>Aktuelle Aufzeichnung samt aktiver Tonspur oder <i>null</i>.</returns>
        public override string SetStation(object context)
        {
            // Stop sending data
            Accessor.Stop();

            // Restart videotext caching from scratch
            Adaptor.VideoText.Deactivate(true);

            // Reset
            Disconnect();

            // Attach to the item
            var item = (JobScheduleInfo)context;

            // Get the signal
            item.StreamTo(Adaptor.EndPoint, Adaptor.Target);

            // Remember
            m_CurrentSource = item;

            // Process
            return(item.ToString());
        }
        /// <summary>
        ///  Create Job for categorize All documents
        /// </summary>
        /// <param name="matterId">Matter Id</param>
        /// <param name="dataSetId">Dataset Id</param>
        /// <param name="projectId">Project Id</param>
        /// <param name="jobScheduleInfo">JobScheduleInfo</param>
        /// <returns></returns>
        public int CreateJobForCategorizeAll(string matterId, string dataSetId, string projectId,
           JobScheduleInfo jobScheduleInfo)
        {
            MockWorkflowState.UpdateState(name: State.PredictSet, createStatus: Status.Completed, reviewStatus: Status.Completed, isCurrent: true);

            return 101; //Job Id
        }
示例#6
0
        public int PostCreateJobForCategorizeAll(long orgId, long matterId, long datasetId, long projectId, JobScheduleInfo jobScheduleInfo)
        {
            var client = GetAnalyticsRestClient();

            return(client.CreateJobForCategorizeAll(matterId.ToString(CultureInfo.InvariantCulture),
                                                    datasetId.ToString(CultureInfo.InvariantCulture),
                                                    projectId.ToString(CultureInfo.InvariantCulture),
                                                    jobScheduleInfo));
        }
 public int PostCreateJobForCategorizeAll(long orgId, long matterId, long datasetId, long projectId, JobScheduleInfo jobScheduleInfo)
 {
     var client = GetAnalyticsRestClient();
     return client.CreateJobForCategorizeAll(matterId.ToString(CultureInfo.InvariantCulture),
         datasetId.ToString(CultureInfo.InvariantCulture),
         projectId.ToString(CultureInfo.InvariantCulture),
         jobScheduleInfo);
 }
        /// <summary>
        /// Ermittelt die Liste der verfügbaren Aufzeichnungen.
        /// </summary>
        public override void LoadStations()
        {
            // Index to set default upon
            int startupIndex = -1;

            // Special
            if (m_StartupStation != null)
            {
                if (m_StartupStation.StartsWith("dvbnet:"))
                {
                    // Get the index
                    startupIndex = int.Parse(m_StartupStation.Substring(7));

                    // No direct default
                    m_StartupStation = null;
                }
            }

            // Reset current channel
            m_DefaultStation = m_StartupStation;
            m_StartupStation = null;

            // Forbid restriction on channels
            Favorites.DisableFavorites();

            // All names already in use
            var duplicates = new Dictionary <string, int>();

            // Find all current activities
            foreach (var activity in VCRNETRestProxy.GetActivitiesForProfile(Adaptor.EndPoint, Profile))
            {
                // Create the information record
                var item = new JobScheduleInfo(activity);
                var name = activity.name;

                // Read counter
                int cnt;
                if (duplicates.TryGetValue(name, out cnt))
                {
                    name = string.Format("{0} ({1})", name, cnt);
                }
                else
                {
                    cnt = 0;
                }

                // Store back
                duplicates[name] = ++cnt;

                // Add to list
                Favorites.AddChannel(name, item);

                // Remember
                if (m_DefaultStation == null)
                {
                    if ((startupIndex < 0) || (startupIndex == activity.streamIndex))
                    {
                        m_DefaultStation = name;
                    }
                }
            }

            // Finish
            Favorites.FillChannelList();
        }
        /// <summary>
        /// Kappt die Verbindung zur aktuellen Aufzeichnung.
        /// </summary>
        private void Disconnect()
        {
            // Process
            var current = m_CurrentSource;
            if (current != null)
                try
                {
                    // Process
                    current.StreamTo( Adaptor.EndPoint, null );
                }
                catch
                {
                    // Actually server may be already done so ignore any error
                }

            // Forget
            m_CurrentSource = null;
        }
        /// <summary>
        /// Wählt eine Aufzeichnung aus.
        /// </summary>
        /// <param name="context">Die gewünschte Aufzeichnung.</param>
        /// <returns>Aktuelle Aufzeichnung samt aktiver Tonspur oder <i>null</i>.</returns>
        public override string SetStation( object context )
        {
            // Stop sending data
            Accessor.Stop();

            // Restart videotext caching from scratch
            Adaptor.VideoText.Deactivate( true );

            // Reset
            Disconnect();

            // Attach to the item
            var item = (JobScheduleInfo) context;

            // Get the signal    
            item.StreamTo( Adaptor.EndPoint, Adaptor.Target );

            // Remember
            m_CurrentSource = item;

            // Process
            return item.ToString();
        }
        /// <summary>
        /// Ermittelt die Liste der verfügbaren Aufzeichnungen.
        /// </summary>
        public override void LoadStations()
        {
            // Index to set default upon
            int startupIndex = -1;

            // Special
            if (m_StartupStation != null)
                if (m_StartupStation.StartsWith( "dvbnet:" ))
                {
                    // Get the index
                    startupIndex = int.Parse( m_StartupStation.Substring( 7 ) );

                    // No direct default
                    m_StartupStation = null;
                }

            // Reset current channel
            m_DefaultStation = m_StartupStation;
            m_StartupStation = null;

            // Forbid restriction on channels
            Favorites.DisableFavorites();

            // All names already in use
            var duplicates = new Dictionary<string, int>();

            // Find all current activities
            foreach (var activity in VCRNETRestProxy.GetActivitiesForProfile( Adaptor.EndPoint, Profile ))
            {
                // Create the information record
                var item = new JobScheduleInfo( activity );
                var name = activity.name;

                // Read counter
                int cnt;
                if (duplicates.TryGetValue( name, out cnt ))
                    name = string.Format( "{0} ({1})", name, cnt );
                else
                    cnt = 0;

                // Store back
                duplicates[name] = ++cnt;

                // Add to list
                Favorites.AddChannel( name, item );

                // Remember
                if (m_DefaultStation == null)
                    if ((startupIndex < 0) || (startupIndex == activity.streamIndex))
                        m_DefaultStation = name;
            }

            // Finish
            Favorites.FillChannelList();
        }