示例#1
0
 public static int GetRunning(int id)
 {
     using (ALSIEntities ctx = new ALSIEntities())
     {
         job_running running = (from c in ctx.job_running where c.ID == id select c).FirstOrDefault();
         if (running != null)
         {
             return((int)running.running_number + 1);
         }
         return(-1);
     }
 }
示例#2
0
 public static void IncrementRunning(int id)
 {
     using (ALSIEntities ctx = new ALSIEntities())
     {
         job_running running = (from c in ctx.job_running where c.ID == id select c).FirstOrDefault();
         if (running != null)
         {
             running.running_number = running.running_number + 1;
             ctx.SaveChanges();
         }
     }
 }
示例#3
0
        public void Update()
        {
            job_running existing = _repository.Find(x => x.ID == this.ID).FirstOrDefault();

            if (existing != null)
            {
                _repository.Edit(existing, this);
            }
            else
            {
                _repository.Add(this);
            }
        }