Exemple #1
0
        public void saveJob(string data)
        {
            JobRecord job = new JobRecord(data);

            job.insertOb();
            //if (job.name == "") job.name = "Default";
            //saveJob(job);
        }
        public static string updateJob(string userID, string jobName, string data)
        {
            JobRecord job    = new JobRecord(data);
            JobRecord oldJob = (JobRecord)job.selectOb("WHERE Name = '" + job.name + "'");

            if (oldJob == null)
            {
                return("Error: Job Record not found");
            }
            else
            {
                job.updateOb();
            }
            return(job.serialize()); /// should include ID field.
        }
Exemple #3
0
        //string serializeActiveJobs()
        //{
        //    string s = "";
        //    for (int i = 0; i < activeJobs.Count; ++i)
        //    {
        //        Job job = activeJobs[i];
        //        if (job.start < DateTime.Now && job.end > DateTime.Now && job.active)
        //        {
        //            string js = job.serialize();
        //            if (s != "") s += ",";
        //            s += js;
        //        }
        //    }
        //    s = "{" + s + "}";
        //    return s;

        //}

        public string getAllJobs()
        {
            List <object> oblist = RTDB.selectObList("SELECT * FROM JobRecord", new JobRecord(), "TrainTasker");

            string s = "";

            for (int i = 0; i < oblist.Count; ++i)
            {
                JobRecord job = (JobRecord)oblist[i];
                if (i > 0)
                {
                    s += ",";
                }
                s += job.serialize();
            }
            return("{" + s + "}");
        }
Exemple #4
0
        public string getUserJobs(string userID)
        {
            List <object> oblist = RTDB.selectObList("SELECT * FROM JobRecord WHERE userID= '" + userID + "'", new JobRecord(), "TrainTasker");

            string s = "";

            for (int i = 0; i < oblist.Count; ++i)
            {
                JobRecord job = (JobRecord)oblist[i];
                if (i > 0)
                {
                    s += ",";
                }
                s += job.serialize();
            }
            return("[" + s + "]");
        }
        public static string publishJob1(string userID, string jobName, string data)
        {
            JobRecord job = new JobRecord(data);


            job.active = true;
            job.type   = "ImageRegion";
            JobRecord oldjob = (JobRecord)job.selectOb("WHERE name='" + jobName + "'");

            if (oldjob != null)
            {
                return("Error: Job name, " + jobName + " already in use.");
            }
            else
            {
                job.insertOb();
            }
            return(job.serialize()); /// should include ID field.
        }
        public static string publishJob2(string userID, string jobName, string data)
        {
            JobRecord job = new JobRecord(data);


            job.active = true;
            job.type   = "ImageRegion";
            JobRecord oldjob = (JobRecord)job.selectOb("WHERE name='" + jobName + "'");

            if (oldjob != null)
            {
                job.ID = oldjob.ID;
                job.updateOb();
            }
            else
            {
                job.insertOb();
            }
            createTaskRecords(userID, job.ID);
            return(job.serialize()); /// should include ID field.
        }
Exemple #7
0
 public void saveJob(JobRecord job)
 {
     job.insertOb();
 }