Ejemplo n.º 1
0
        public static void PostJobHistory(int id_backup, DateTime date, bool success)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(URL);

                var Client = new job_history()
                {
                    id_job = id_backup, date = date, success = success, error_message = "", info = ""
                };

                var postTask = client.PostAsJsonAsync("job_history", Client);
                postTask.Wait();

                var result = postTask.Result;
                if (result.IsSuccessStatusCode)
                {
                    var readTask = result.Content.ReadAsAsync <job_history>();
                    readTask.Wait();

                    Console.WriteLine("Job_History sent");
                }
            }
        }
Ejemplo n.º 2
0
        public void Delete(int id)
        {
            job_history job_history = this.repository.FindById(id);

            this.repository.Delete(job_history);
        }
Ejemplo n.º 3
0
 public void Put(int id, [FromBody] job_history value)
 {
     value.id = id;
     this.repository.Update(value);
 }
Ejemplo n.º 4
0
 public void Post([FromBody] job_history value)
 {
     this.repository.Create(value);
 }
Ejemplo n.º 5
0
 public void Delete(job_history job_history)
 {
     this.context.Job_histories.Remove(job_history);
     this.context.SaveChanges();
 }
Ejemplo n.º 6
0
 public void Update(job_history job_history)
 {
     this.context.Entry(job_history).State = System.Data.Entity.EntityState.Modified;
     this.context.SaveChanges();
 }
Ejemplo n.º 7
0
 public void Create(job_history job_history)
 {
     this.context.Job_histories.Add(job_history);
     this.context.SaveChanges();
 }