Beispiel #1
0
 public static void AddJob(JTSDataContext dc, string mac, long n)
 {
     dc.JOBs.InsertOnSubmit(new JOB
     {
         JOB_ID      = Guid.NewGuid(),
         MAC         = mac,
         N           = n,
         ASSIGN_DATE = DateTime.Now,
         STATUS      = 0
     });
     dc.SubmitChanges();
 }
Beispiel #2
0
        private static void AddJob(JTSDataContext dc, string mac, long n)
        {
            dc.jobs.InsertOnSubmit(new job
            {
                job_id      = Guid.NewGuid(),
                mac         = mac,
                n           = n,
                assign_date = DateTime.Now,
                status      = 0
            });

            dc.SubmitChanges();
        }
Beispiel #3
0
 public static void SaveResult(string mac, long n, bool isPrime)
 {
     using (JTSDataContext dc = new JTSDataContext())
     {
         var item = (from c in dc.JOBs
                     where c.MAC == mac &&
                     c.N == n && c.STATUS == 0
                     orderby c.ASSIGN_DATE descending
                     select c).FirstOrDefault();
         if (item == null)
         {
             return;
         }
         item.STATUS        = isPrime ? (byte)1 : (byte)2;
         item.COMPLETE_DATE = DateTime.Now;
         dc.SubmitChanges();
     }
 }
Beispiel #4
0
        public static void SaveResult(string mac, long n, bool isPrime)
        {
            using (JTSDataContext dc = new JTSDataContext())
            {
                var item = (from c in dc.jobs
                            where c.mac == mac && c.n == n && c.status == 0
                            orderby c.assign_date descending
                            select c).FirstOrDefault();

                if (item != null)
                {
                    item.status        = isPrime ? (byte)1 : (byte)2;
                    item.complete_date = DateTime.Now;

                    dc.SubmitChanges();
                }
            }
        }