fix bugs
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for LogViewerUC.xaml
|
||||
/// </summary>
|
||||
public partial class UserManageUC : UserControl
|
||||
{
|
||||
private ObservableCollection<string> _logItems = new ObservableCollection<string>();
|
||||
|
||||
public UserManageUC()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void LogInfoButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private async void btnGetUsers_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var amCustomers= await APIModels.GetAeonMallCustomers(5);
|
||||
using(var context = new CDMDbContext())
|
||||
{
|
||||
var customers = context.Customers;
|
||||
context.Customers.RemoveRange(customers);
|
||||
context.SaveChanges();
|
||||
foreach (var amCustomer in amCustomers)
|
||||
{
|
||||
var customer = new Customer
|
||||
{
|
||||
AccountNumber = amCustomer.TenantCode,
|
||||
AccountHolder = amCustomer.TenantName,
|
||||
TenantName = amCustomer.TenantShortName,
|
||||
TenantCode = amCustomer.TenantCode,
|
||||
PinCode = amCustomer.TenantCode,
|
||||
UpdatedTime = DateTime.Now,
|
||||
};
|
||||
customers.Add(customer);
|
||||
}
|
||||
context.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user