This commit is contained in:
sc authored and sc committed 2022-05-17 16:27:02 +08:00
commit f7e064070c
112 files changed
+2233 -7508

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
using Audit.View;
using GalaSoft.MvvmLight;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Audit.ViewModel
{
public class MachinesViewModel : ViewModelBase
{
private List<Machines> machiness = new List<Machines>();
public List<Machines> Machines
{
get
{
return machiness;
}
set
{
machiness = value;
RaisePropertyChanged();
}
}
public MachinesViewModel()
{
//machiness = new MachinesProvider().Select();//显示机台
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
if (MachinesView.Button_sql == true)//获取按钮状态
{
Machines = new MachinesProvider().Select();//显示机台
MachinesView.Button_sql = false;
}
}
}
}
+19 -27
View File
@@ -1,38 +1,30 @@
using Audit.View;
using GalaSoft.MvvmLight;
using System.ComponentModel;
using System.Web.UI.WebControls;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Audit.ViewModel
{
/// <summary>
/// This class contains properties that the main View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary>
public class MainViewModel : ViewModelBase
{
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
///
public MainViewModel()
{
////if (IsInDesignMode)
////{
//// // Code runs in Blend --> create design time data.
////}
////else
////{
//// // Code runs "for real"
////}
DispatcherTimer timer = new DispatcherTimer//初始化循环,每1秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(1)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
}
}
}
+51
View File
@@ -0,0 +1,51 @@
using Audit.View;
using GalaSoft.MvvmLight;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace Audit.ViewModel
{
public class PipesViewModel : ViewModelBase
{
private List<Pipes> pipes = new List<Pipes>();
public List<Pipes> Pipes
{
get
{
return pipes;
}
set
{
pipes = value;
RaisePropertyChanged();
}
}
public PipesViewModel()
{
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
if (PipesView.Button_pipessql == true)
{
new PipesProvider().Select();
PipesView.Button_pipessql = false;
}
}
}
}
+4 -10
View File
@@ -53,7 +53,7 @@ namespace Audit.ViewModel
/// </summary>
public QueryViewModel()
{
dyelots = new DyelotsProvider().Select();//显示单号
// dyelots = new DyelotsProvider().Select();//显示单号
// dyelotsBulkedRecipe = new DyelotsBulkedRecipeProvider().Select();//显示明显
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
@@ -63,12 +63,12 @@ namespace Audit.ViewModel
timer.Start();
}
int a = 0;//计数器用变量
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
if (QueryView.sqlButton_Click == 0)
if (QueryView.sqlButton_Click == 10)
{
dyelots = new DyelotsProvider().Select();//显示单号
Dyelots = new DyelotsProvider().Select();//显示单号
QueryView.sqlButton_Click = 0;
}
if (QueryView.sqlButton_Click == 2)
{
@@ -91,12 +91,6 @@ namespace Audit.ViewModel
Dyelots = new DyelotsProvider().SelectMachine(QueryView.Dyelots_Button);//根据单号查询头
QueryView.sqlButton_Click = 0;
}
if (a == 20)//
{
a = 0;
}
else a++;
}
}
}
+90 -3
View File
@@ -1,15 +1,102 @@
using System;
using Audit.View;
using GalaSoft.MvvmLight;
using Models;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Services.Description;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Threading;
namespace Audit.ViewModel
{
///<Summary>
/// StatisticsViewModel
///</Summary>
public class StatisticsViewModel
public class StatisticsViewModel : ViewModelBase
{
}
private List<Product> products = new List<Product>();
private List<Machines> machiness = new List<Machines>();
private List<Dyelots> dyelotss = new List<Dyelots>();
public List<Product> Product
{
get
{
return products;
}
set
{
products = value;
RaisePropertyChanged();
}
}
public List<Machines> Machines
{
get
{
return machiness;
}
set
{
machiness = value;
RaisePropertyChanged();
}
}
public List<Dyelots> Dyelots
{
get
{
return dyelotss;
}
set
{
dyelotss = value;
RaisePropertyChanged();
}
}
public StatisticsViewModel()
{
// products = new ProductProvider().Select();
// machiness = new MachinesProvider().Select();
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
if (StatisticsView.Button_sql == true)//获取按钮状态
{
if (StatisticsView.Buttontype_sql == -2)
{
Product = new ProductProvider().Select();
StatisticsView.Button_machines_sql = true;
}
if (StatisticsView.Buttontype_sql == -1) Product = new ProductProvider().Select();
if (StatisticsView.Buttontype_sql == 0) Product = new ProductProvider().Selects0();
if (StatisticsView.Buttontype_sql == 1) Product = new ProductProvider().Selects1();
if (StatisticsView.Buttontype_sql == 2) Product = new ProductProvider().Selects2();
if (StatisticsView.Buttontype_sql == 3) Product = new ProductProvider().Selects3();
StatisticsView.Button_sql = false;//清除按钮状态
}
if (StatisticsView.Button_machines_sql == true)
{
Machines = new MachinesProvider().Select();
StatisticsView.Button_machines_sql = false;
}
}
}
}
+2 -1
View File
@@ -42,7 +42,7 @@ namespace Audit.ViewModel
/// </summary>
public StuffViewModel()
{
products = new ProductProvider().Select();
//products = new ProductProvider().Select();
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.1)
@@ -59,6 +59,7 @@ namespace Audit.ViewModel
if (StuffView.Buttontype_sql == 0) Product = new ProductProvider().Selects0();
if (StuffView.Buttontype_sql == 1) Product = new ProductProvider().Selects1();
if (StuffView.Buttontype_sql == 2) Product = new ProductProvider().Selects2();
if (StuffView.Buttontype_sql == 3) Product = new ProductProvider().Selects3();
StuffView.Button_sql = false;//清除按钮状态
}
}
+35
View File
@@ -0,0 +1,35 @@
using Audit.View;
using GalaSoft.MvvmLight;
using Models;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Services.Description;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Threading;
namespace Audit.ViewModel
{
public class UserViewModel : ViewModelBase
{
public UserViewModel()
{
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.5)
};
timer.Tick += Tick_Event;
timer.Start();
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
}
}
}
+34
View File
@@ -48,6 +48,9 @@ namespace Audit.ViewModel
SimpleIoc.Default.Register<StatisticsViewModel>();
SimpleIoc.Default.Register<QueryViewModel>();
SimpleIoc.Default.Register<StuffViewModel>();
SimpleIoc.Default.Register<MachinesViewModel>();
SimpleIoc.Default.Register<PipesViewModel>();
SimpleIoc.Default.Register<UserViewModel>();
}
///<Summary>
@@ -61,6 +64,14 @@ namespace Audit.ViewModel
}
}
public UserViewModel User
{
get
{
return ServiceLocator.Current.GetInstance<UserViewModel>();
}
}
///<Summary>
/// LogViewModel
///</Summary>
@@ -104,6 +115,29 @@ namespace Audit.ViewModel
return ServiceLocator.Current.GetInstance<StuffViewModel>();
}
}
/// <summary>
///
/// </summary>
public MachinesViewModel Machines
{
get
{
return ServiceLocator.Current.GetInstance<MachinesViewModel>();
}
}
/// <summary>
///
/// </summary>
public PipesViewModel Pipes
{
get
{
return ServiceLocator.Current.GetInstance<PipesViewModel>();
}
}
///<Summary>
/// Cleanup
///</Summary>