|
@@ -24,12 +24,12 @@ namespace WpfTest1
|
|
|
{
|
|
|
#region 系统基本参数
|
|
|
System.Data.SQLite.SQLiteDataAdapter daHistoryRecord; //选择记录页面查询记录条目的数据集容器
|
|
|
- public doctor loginDoctor = null; //所登陆的医师
|
|
|
+ public doctor loginDoctor = null; //所登录的医师
|
|
|
DataSet ds; //其他界面的DataSet
|
|
|
System.Data.SQLite.SQLiteDataAdapter da; //其他界面的DataAdapter
|
|
|
//double highBp; //BP界面高压
|
|
|
//double lowBp; //BP界面低压
|
|
|
- DateTime lastSettingLogin; //上一次在系统设置界面登陆的时间
|
|
|
+ DateTime lastSettingLogin; //上一次在系统设置界面登录的时间
|
|
|
public Toolkits.Config cfg; //从数据库取配置的类
|
|
|
DogOperator dop = new DogOperator(Constants.registerPid, Constants.registerUid);
|
|
|
|
|
@@ -73,7 +73,7 @@ namespace WpfTest1
|
|
|
{
|
|
|
labelHomepageCversion.Content = "编译日期:" + Toolkits.Constants.compileDate;
|
|
|
labelSoftwareName.Content = String.Format("欢迎使用{0}", Constants.softwareName);
|
|
|
- //之后测试登陆
|
|
|
+ //之后测试登录
|
|
|
SmallDialogs.LoginWindow lw = new SmallDialogs.LoginWindow(this);
|
|
|
lw.ShowDialog();
|
|
|
if (loginDoctor == null)
|
|
@@ -87,6 +87,8 @@ namespace WpfTest1
|
|
|
MessageBox.Show("未找到硬件授权Key,请确认插入后重试", "错误");
|
|
|
this.Close();
|
|
|
}
|
|
|
+ loadUSBDogStatus();
|
|
|
+
|
|
|
string datestr = "2021-12-31 00:00:00";
|
|
|
DateTime dtStandard = DateTime.Parse(datestr);
|
|
|
DateTime now = DateTime.Now;
|
|
@@ -104,7 +106,20 @@ namespace WpfTest1
|
|
|
|
|
|
loadQuestionaire(filterQuestionaire, "filter");
|
|
|
loadQuestionaire(evaluationQuestionaire, "evaluation");
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+ private void loadUSBDogStatus()
|
|
|
+ {
|
|
|
+ int[] timesLimit = dop.getTimesCount();
|
|
|
+ if(timesLimit[0] != -1 && timesLimit[1]!= -1)
|
|
|
+ {
|
|
|
+ labelHomepageUSBDogStatus.Content = String.Format("系统Key已授权,当前Key可使用{0}次,已使用{1}次", timesLimit[0], timesLimit[1]);
|
|
|
+ labelHomepageUSBDogStatus.Visibility = Visibility.Visible;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ labelHomepageUSBDogStatus.Visibility = Visibility.Hidden;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void loadQuestionaire(List<QuestionAnswerPair> oneQuestionaire, string type = "filter")
|
|
@@ -260,10 +275,11 @@ namespace WpfTest1
|
|
|
//首页--操作帮助
|
|
|
private void buttonHomePageHelp_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- //System.Diagnostics.Process.Start("https://www.baidu.com");
|
|
|
- Record one_record = SQLiteModel.getRecordByID(24);
|
|
|
- Patient one_patient = SQLiteModel.getPatientById("5");
|
|
|
- ReportGenerater.generateReport_constum(one_record, one_patient,cfg);
|
|
|
+ System.Diagnostics.Process.Start(Constants.template_custom + "\\" + "manual.pdf");
|
|
|
+ //manual.pdf
|
|
|
+ //Record one_record = SQLiteModel.getRecordByID(24);
|
|
|
+ //Patient one_patient = SQLiteModel.getPatientById("5");
|
|
|
+ //ReportGenerater.generateReport_constum(one_record, one_patient,cfg);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -562,7 +578,7 @@ namespace WpfTest1
|
|
|
private void buttonSubmitFilter_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
int[] timesLimit = dop.getTimesCount();
|
|
|
- if(Constants.productionEnvironment && timesLimit[1] > timesLimit[0])
|
|
|
+ if (Constants.productionEnvironment && (timesLimit[1] >= timesLimit[0]))
|
|
|
{
|
|
|
MessageBox.Show("此功能已超过Key授权次数,请使用一个新的Key进行操作。", "提示");
|
|
|
return;
|
|
@@ -998,7 +1014,8 @@ namespace WpfTest1
|
|
|
private void buttonSubmitEvaluation_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
int[] timesLimit = dop.getTimesCount();
|
|
|
- if (Constants.productionEnvironment && timesLimit[1] > timesLimit[0])
|
|
|
+ //MessageBox.Show(String.Format("生产环境状态标识:{0}, 授权阈值: {1}, 已使用次数:{2}", Constants.productionEnvironment, timesLimit[0], timesLimit[1]));
|
|
|
+ if (Constants.productionEnvironment && (timesLimit[1] >= timesLimit[0]))
|
|
|
{
|
|
|
MessageBox.Show("此功能已超过Key授权次数,请使用一个新的Key进行操作。", "提示");
|
|
|
return;
|
|
@@ -1028,6 +1045,7 @@ namespace WpfTest1
|
|
|
return;
|
|
|
}
|
|
|
dop.addOneCount();
|
|
|
+ loadUSBDogStatus();
|
|
|
MessageBoxResult dr = MessageBox.Show("保存成功,是否生成报告?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
|
|
|
if (dr == MessageBoxResult.OK)
|
|
|
{
|
|
@@ -1238,7 +1256,7 @@ namespace WpfTest1
|
|
|
DateTime now = DateTime.Now;
|
|
|
if (lastSettingLogin != null && (now - lastSettingLogin).Minutes <= 10)
|
|
|
{
|
|
|
- //如果上次有登陆而且登陆时间在10分钟以内,则免登陆
|
|
|
+ //如果上次有登录而且登录时间在10分钟以内,则免登录
|
|
|
return;
|
|
|
}
|
|
|
|