using Microsoft.Extensions.Logging;
using SafeBagDE70.API;
using SafeBagDE70.Model;
using Serilog;
using Serilog.Core;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SafeBagDE70.Admin
{
///
/// Interaction logic for LogViewerUC.xaml
///
public partial class UserManageUC : UserControl
{
private ObservableCollection _logItems = new ObservableCollection();
public UserManageUC()
{
InitializeComponent();
}
private void LogInfoButton_Click(object sender, RoutedEventArgs e)
{
}
private async void btnGetUsers_Click(object sender, RoutedEventArgs e)
{
try
{
if(AppData.IsInTransaction)
{
lblStatus.Foreground = new SolidColorBrush(Colors.Red);
lblStatus.Content = "Vui lòng kết thúc giao dịch để thực hiện chức năng này";
}
else
{
int nUpdatedCustomers=await AppData.UpdateCustomers();
lblStatus.Foreground = new SolidColorBrush(Colors.Green);
lblStatus.Content = "Updated customers: " + nUpdatedCustomers;
}
AppData.InitUsers();
}
catch(Exception ex)
{
lblStatus.Foreground = new SolidColorBrush(Colors.Red);
lblStatus.Content= ex.Message;
}
}
private void btnSyncTransaction_Click(object sender, RoutedEventArgs e)
{
AppData.ResendData();
}
}
}