Ejemplo n.º 1
0
 private void PallePopup_OnPrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
 {
     if (txtbox_Palle.Text != "")
     {
         PalletCheck p = new PalletCheck()
         {
             Pallet         = txtbox_Palle.Text,
             ProcessOrderNR = this.Id,
             TimeOfTest     = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second),
             WorkerID       = 3
         };
         EtiketteArkVM.SavePalleCheck(p);
         ET.PalleChecks.Add(new EtiketteArkVM.PalleCheck()
         {
             Pallet     = txtbox_Palle.Text,
             TimeOfTest = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second),
             Worker     = new Worker()
             {
                 WorkerID = 3
             }
         });
     }
     else
     {
         //// TODO
         //// ERROR MSG
     }
 }
        public static bool SavePalleCheck(PalletCheck palletCheck)
        {
            using (HttpClient client = new HttpClient())
            {
                string        json    = JsonConvert.SerializeObject(palletCheck);
                StringContent content = new StringContent(json, Encoding.ASCII, "Application/json");
                Task <HttpResponseMessage> response = client.PostAsync("http://localhost:54926/api/PalletCheck", content);

                return(response.Result.StatusCode == HttpStatusCode.OK);
            }
        }
Ejemplo n.º 3
0
 public bool Put(int id, [FromBody] PalletCheck value)
 {
     return(palletCheckManager.Put(id, value));
 }
Ejemplo n.º 4
0
 // POST: api/PalletCheck
 public bool Post([FromBody] PalletCheck value)
 {
     return(palletCheckManager.Post(value));
 }