Ejemplo n.º 1
0
 public void UpdateStatus(int casino, int id, [FromBody] StaffStatusPostData data)
 {
     if (data != null && !string.IsNullOrWhiteSpace(data.Status))
     {
         string sql = "UPDATE Staff SET Status = @Status WHERE CasinoID = @CasinoID AND StaffID = @StaffID";
         _data.Save(sql, new { CasinoID = casino, StaffID = id, Status = data.Status });
     }
 }
Ejemplo n.º 2
0
        public async void UpdateStaffStatus(int casino, int staff_id, string status)
        {
            var data = new StaffStatusPostData
            {
                Status = status,
            };
            var content = new StringContent(JsonConvert.SerializeObject(data), System.Text.Encoding.UTF8, "application/json");

            using (var http = GetHttpClient())
            {
                var r = await http.PostAsync(casino + "/staff/" + staff_id + "/status", content);

                if (!r.IsSuccessStatusCode)
                {
                    throw new Exception(r.ReasonPhrase);
                }
            }
        }