mvvm模式升级从 packages.config 迁移到 PackageReference

This commit is contained in:
sc committed 2024-06-29 23:20:36 +08:00
commit 83a38deaa6
56 files changed
+612 -1158

No files matched your search

+2 -6
View File
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
namespace formula_manage.ViewModel
{
public class ExchangeViewModel : ViewModelBase
{
public ExchangeViewModel()
public ExchangeViewModel()
{
CountDown();
}
@@ -30,7 +26,7 @@ namespace formula_manage.ViewModel
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
}
}
+41 -53
View File
@@ -1,24 +1,11 @@
using formula_manage.SQLModels;
using formula_manage.UserClass;
using formula_manage.ViewModel;
using formula_manage.Windows;
using GalaSoft.MvvmLight;
using formula_manage.UserClass;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Threading;
using System.Xml.Linq;
namespace formula_manage.ViewModel
{
@@ -43,8 +30,8 @@ namespace formula_manage.ViewModel
DataTable DissolvedataTable = new DataTable(); //建立Dissolve
DataTable STUFFdataTable = new DataTable(); //建立STUFF
DataTable MACHINEdataTable = new DataTable(); //建立Machine
// DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT
// DataTable RecipedataTable = new DataTable(); //建立Recipe
// DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT
// DataTable RecipedataTable = new DataTable(); //建立Recipe
public static DataTable STUFFdatatemp = new DataTable(); //建立STUFF缓存
public static DataTable MACHINEdatatemp = new DataTable(); //建立Machine缓存
@@ -54,7 +41,7 @@ namespace formula_manage.ViewModel
public string cdk_time; //注册到期时间
public string cdk_page = "Hidden"; //注册到期页面状态
public string cdk_pageT; //注册到期页面关闭时间
int cdk_pageT_T=-1;////注册到期页面关闭时间计算
int cdk_pageT_T = -1;////注册到期页面关闭时间计算
public string Sys_Time //通知UI控件参数改变
{
@@ -89,50 +76,51 @@ namespace formula_manage.ViewModel
private void CDkey_()
{
try
{
string id_1 = SN_ID.Substring(5, 1) + SN_ID.Substring(0, 1) + SN_ID.Substring(4, 1) + SN_ID.Substring(1, 1) + SN_ID.Substring(3, 1) + SN_ID.Substring(2, 1);
if ((id_1 == SN_KEY.Substring(0, 6)) && (SN_KEY.Length == 16))
{
try
{
string id_1 = SN_ID.Substring(5, 1) + SN_ID.Substring(0, 1) + SN_ID.Substring(4, 1) + SN_ID.Substring(1, 1) + SN_ID.Substring(3, 1) + SN_ID.Substring(2, 1);
if ((id_1 == SN_KEY.Substring(0, 6)) && (SN_KEY.Length == 16))
{
if (CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(SN_KEY.Substring(0, 12)), true) == SN_KEY.Substring(12, 4)) //校验key的crc校验值
{
string Y = (2255 - StrToInt.To16Convert10(SN_KEY.Substring(6, 2))).ToString();
string M = (255 - StrToInt.To16Convert10(SN_KEY.Substring(8, 2))).ToString();
{
string Y = (2255 - StrToInt.To16Convert10(SN_KEY.Substring(6, 2))).ToString();
string M = (255 - StrToInt.To16Convert10(SN_KEY.Substring(8, 2))).ToString();
string D = (255 - StrToInt.To16Convert10(SN_KEY.Substring(10, 2))).ToString();
string YY = DateTime.Now.ToString("yyyy");
string MM = DateTime.Now.ToString("MM");
string YY = DateTime.Now.ToString("yyyy");
string MM = DateTime.Now.ToString("MM");
string DD = DateTime.Now.ToString("dd");
Cdk_time = "注册到期时间: " + Y + "/" + M + "/" + D;
if (string.Compare(Y, YY) < 0)
if (string.Compare(Y, YY) < 0)
{
if (string.Compare(M, MM) < 0)
{
if (string.Compare(D, DD) < 0)
{
Cdk_page = "Visible";
if (string.Compare(M, MM) < 0)
{
if (string.Compare(D, DD) < 0)
{
Cdk_page = "Visible";
//cdk_pageT_T = -1; //防止触发倒计时
}
}
else if ((int.Parse(D) - int.Parse(DD)) <= 10)//提前三天提醒
{
Cdk_page = "Visible";
{
Cdk_page = "Visible";
cdk_pageT_T = 180; //页面关闭倒计时30秒
}
}
}
}
else
{
Cdk_page = "Visible";
Cdk_time = "许可证安全校验错误请重新激活";
} }
}
}
}
else
{
Cdk_page = "Visible";
Cdk_time = "许可证安全校验错误请重新激活";
}
}
else
{
Cdk_page = "Visible";
Cdk_time = "计算机信息变更当前许可证失效";
{
Cdk_page = "Visible";
Cdk_time = "计算机信息变更当前许可证失效";
}
}
catch (Exception)
@@ -151,7 +139,7 @@ namespace formula_manage.ViewModel
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
SN_ID = Configini.IniReadvalue("SN", "SN2");
SN_KEY = Configini.IniReadvalue("SN", "SN1");
SN_KEY = Configini.IniReadvalue("SN", "SN1");
if (TEXT_SQMOD == "0") //判断连接方式
{
@@ -286,7 +274,7 @@ namespace formula_manage.ViewModel
{
cdk_pageT_T--;
Cdk_pageT = cdk_pageT_T.ToString();
if(cdk_pageT_T == 1) Cdk_page = "Hidden";
if (cdk_pageT_T == 1) Cdk_page = "Hidden";
}
}
+42 -55
View File
@@ -1,36 +1,23 @@
using formula_manage.SQLModels;
using formula_manage.ViewModel;
using formula_manage.Windows;
using GalaSoft.MvvmLight;
using System;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Threading;
using System.Xml.Linq;
namespace formula_manage.ViewModel
{
/* public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
/* public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}*/
protected virtual void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}*/
///<Summary>
///
///
@@ -191,40 +178,40 @@ namespace formula_manage.ViewModel
}
}
/* public class Product //stuff_Product
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int ProductType { get; set; }
public int Concentration { get; set; }
/* public class Product //stuff_Product
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int ProductType { get; set; }
public int Concentration { get; set; }
public override string ToString()
{
return ProductCode;
}
}
public class Machine //mac
{
public string Name { get; set; }
public float Volume { get; set; }
public float Capacity { get; set; }
public override string ToString()
{
return ProductCode;
}
}
public class Machine //mac
{
public string Name { get; set; }
public float Volume { get; set; }
public float Capacity { get; set; }
public override string ToString()
{
return Name;
}
}
public class Workflow //Dissolve
{
public string DissolveName { get; set; }
public int MaterialType { get; set; }
public int WeightMIN { get; set; }
public int WeightMAX { get; set; }
public override string ToString()
{
return Name;
}
}
public class Workflow //Dissolve
{
public string DissolveName { get; set; }
public int MaterialType { get; set; }
public int WeightMIN { get; set; }
public int WeightMAX { get; set; }
public override string ToString()
{
return DissolveName;
}
}*/
public override string ToString()
{
return DissolveName;
}
}*/
}
+1 -7
View File
@@ -1,10 +1,4 @@
using CommonServiceLocator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
namespace formula_manage.ViewModel
@@ -30,7 +24,7 @@ namespace formula_manage.ViewModel
SimpleIoc.Default.Register<RECIPEViewModel>();
SimpleIoc.Default.Register<ExchangeViewModel>();
}
public MainWindowViewModel Main
{
get