Esempio n. 1
0
        private void updateButton_Click(object sender, RoutedEventArgs e)
        {
            EmployeeDBSOA.Models.Employee employee = (EmployeeDBSOA.Models.Employee)EmployeeDataGrid.SelectedItem;

            EditWindow editWindow = new EditWindow(employee);

            editWindow.ShowDialog();
            if (editWindow.DialogResult.HasValue && editWindow.DialogResult.Value)
            {
                loadAllButton_Click(loadAllButton, null);
            }
            else
            {
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Производит чтение 1 сотрудника из сервиса
        /// </summary>
        /// <param name="path">строка для контроллера web-api вида 'api/employees/{Id}'</param>
        /// <returns>Возвращает сотрудника</returns>
        static async Task <EmployeeDBSOA.Models.Employee> GetProductAsync(string path)
        {
            EmployeeDBSOA.Models.Employee employee = null;
            try
            {
                HttpResponseMessage response = await client.GetAsync(path);

                if (response.IsSuccessStatusCode)
                {
                    employee = await response.Content.ReadAsAsync <EmployeeDBSOA.Models.Employee>();
                }
            }
            catch (Exception)
            {
            }
            return(employee);
        }
 public EditWindow(EmployeeDBSOA.Models.Employee empl)
 {
     InitializeComponent();
     employee = empl;
 }