Merge branch 'master' of http://192.168.0.12:13000/sc/Audit_APP
This commit is contained in:
commit
57aa8b1c6c
3 files changed
+25
-13
No files matched your search
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
||||
using System.Web.Services.Description;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Audit.ViewModel
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace Audit.ViewModel
|
||||
public class StuffViewModel : ViewModelBase
|
||||
{
|
||||
private List<Product> products = new List<Product>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所有原料
|
||||
/// </summary>
|
||||
@@ -36,11 +37,20 @@ namespace Audit.ViewModel
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询数据
|
||||
/// StuffViewModeldl
|
||||
/// </summary>
|
||||
public StuffViewModel()
|
||||
{
|
||||
products = new ProductProvider().Select();
|
||||
DispatcherTimer timer = new DispatcherTimer();//每5秒调用一次Tick_Event
|
||||
timer.Interval = TimeSpan.FromSeconds(5);
|
||||
timer.Tick += Tick_Event;
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
void Tick_Event(object sender, EventArgs e)
|
||||
{
|
||||
Product = new ProductProvider().Select();//扫描数据库
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user