Exemplo n.º 1
0
 public VariantVersionAppObject(VdbVariantVersionDef version)
 {
     m_version = version;
     VdbFile   = version.Version.Db.FileName;
     Variant   = IOTool.RelativePathTo(Path.GetDirectoryName(VdbFile), version.VariantFile.DiskPath);
     Version   = version.Version.Name;
 }
Exemplo n.º 2
0
        public void RefreshJobs()
        {
            lsvJobs.Items.Clear();
            int index = 0;

            foreach (string file in Directory.GetFiles(Core.JobsDirectory, "*.djb", SearchOption.AllDirectories))
            {
                var job = Job.LoadFromFile(file);
                var rec = new JobWithFile {
                    Job = job, File = IOTool.RelativePathTo(Core.JobsDirectory, file), FullFile = file
                };
                m_loadedJobs.Add(rec);
                var item = lsvJobs.Items.Add(rec.File);
                item.SubItems.Add(job.GetAllElementaryCommands().Count().ToString());
                item.SubItems.Add(job.GetAllReportConfigs().CreateDelimitedText(";"));
                item.Tag = rec;
                if (index == 0)
                {
                    item.Selected       = item.Focused = true;
                    lsvJobs.FocusedItem = item;
                }
                if (JobPlanner.Instance.Connection.JobFileScheduled(file))
                {
                    item.ImageIndex = m_imgCache.GetImageIndex(CoreIcons.clock);
                }
                index++;
            }
            FillCommands();
        }
Exemplo n.º 3
0
        public bool JobFileScheduled(string fullJobFile)
        {
            string relfile = IOTool.RelativePathTo(Core.JobsDirectory, fullJobFile);
            int    cnt     = Int32.Parse(JobPlanner.Instance.Connection.ExecuteScalar(String.Format("select count(*) from Job where JobFile='{0}'", relfile.Replace("'", "''"))).ToString());

            return(cnt > 0);
        }
Exemplo n.º 4
0
        internal static string RelativeFile(this ITreeNode node)
        {
            var jnode = node as JobTreeNode;

            if (jnode != null)
            {
                string file    = jnode.FileSystemPath;
                string relfile = IOTool.RelativePathTo(Core.JobsDirectory, file);
                return(relfile);
            }
            return(null);
        }
Exemplo n.º 5
0
        public void ScheduleJobDialog(string fullJobFile)
        {
            string relfile = IOTool.RelativePathTo(Core.JobsDirectory, fullJobFile);
            int    cnt     = Int32.Parse(ExecuteScalar(String.Format("select count(*) from Job where JobFile='{0}'", relfile.Replace("'", "''"))).ToString());

            if (cnt == 0)
            {
                ExecuteNonQuery(String.Format("insert into Job (JobFile, CreatedAt) values ('{0}', '{1}')", relfile.Replace("'", "''"), DateTime.Now.ToString("s")));
            }
            int id = Int32.Parse(ExecuteScalar(String.Format("select id from Job where JobFile='{0}'", relfile.Replace("'", "''"))).ToString());

            ScheduleForm.Run(this, id);
        }
Exemplo n.º 6
0
 public override bool SaveAs()
 {
     if (!Directory.Exists(Core.ChartsDirectory))
     {
         Directory.CreateDirectory(Core.ChartsDirectory);
     }
     saveFileDialog1.InitialDirectory = Core.ChartsDirectory;
     saveFileDialog1.CustomPlaces.Add(Core.ChartsDirectory);
     if (saveFileDialog1.ShowDialogEx() == DialogResult.OK)
     {
         m_file = new DiskFile(saveFileDialog1.FileName);
         ChangedWinId();
         Save();
         UpdateTitle();
         m_modified = false;
         if (!IOTool.RelativePathTo(Core.ScriptsDirectory, saveFileDialog1.FileName).StartsWith(".."))
         {
             HTree.CallRefreshRoot();
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 7
0
 public VersionAppObject(VersionDef version)
 {
     m_version = version;
     VdbFile   = IOTool.RelativePathTo(Core.DataDirectory, m_version.Db.FileName);
     Version   = m_version.Name;
 }
Exemplo n.º 8
0
        public void DeleteSchedule(string fullJobFile)
        {
            string relfile = IOTool.RelativePathTo(Core.JobsDirectory, fullJobFile);

            ExecuteNonQuery("delete from Job where JobFile='" + relfile + "'");
        }