Nieuwe database
This commit is contained in:
parent
e29970b7a9
commit
81ab4d634c
22 changed files with 596 additions and 629 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#include "stdafx.h"
|
||||
#include "EpdBase.h"
|
||||
|
||||
#define DiscoveryTimeslotPeriod 200
|
||||
#define DiscoveryExpirationPeriod 5000
|
||||
#define DiscoveryTimeslotPeriod 100
|
||||
#define DiscoveryExpirationPeriod 6000
|
||||
#define RxRetryCount 5
|
||||
#define TxRetryCount 5
|
||||
|
||||
EpdBase::Epd2U::Epd2U(int comport)
|
||||
{
|
||||
|
|
@ -15,39 +17,65 @@ EpdBase::Epd2U::Epd2U(int comport)
|
|||
|
||||
DWORD EpdBase::Epd2U::StartCom()
|
||||
{
|
||||
Error = 0;
|
||||
InitRv = InitComms(port, 9600, 8, 0, 0);
|
||||
if (InitRv == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
else {
|
||||
CommsInitialized = 1;
|
||||
}
|
||||
return Error;
|
||||
DWORD rv;
|
||||
ErrorReason = 0;
|
||||
|
||||
int mx = 10;
|
||||
if (CommsInitialized==0)
|
||||
do {
|
||||
InitRv = InitComms(port, 9600, 8, 0, 0);
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms RV={0} Port={1}", InitRv, port));
|
||||
|
||||
if (InitRv == 0) {
|
||||
rv= GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms ErrorReason={0} ErrorData={1} Port={2}", ErrorReason, ErrorData, port));
|
||||
Sleep(300); DeinitComms(port);
|
||||
}
|
||||
else {
|
||||
SetRetryCounts(RxRetryCount, TxRetryCount);
|
||||
//SetDiscoveryTimeslotCount(port, 2);
|
||||
SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod);
|
||||
SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod);
|
||||
}
|
||||
} while (InitRv == 0 && mx > 0);
|
||||
|
||||
CommsInitialized = InitRv;
|
||||
return ErrorReason;
|
||||
}
|
||||
|
||||
EpdBase::Epd2U::~Epd2U()
|
||||
{
|
||||
DeinitComms(port);
|
||||
CommsInitialized = 0;
|
||||
}
|
||||
|
||||
int EpdBase::Epd2U::StartDiscover()
|
||||
{
|
||||
WORD rv;
|
||||
System::Diagnostics::Trace::WriteLine("StartDiscover");
|
||||
FlushBuffers(port);
|
||||
FlushDiscoveryCache(port);
|
||||
Error = 0;
|
||||
SetDiscoveryTimeslotCount(port, 2);
|
||||
SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod);
|
||||
SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod);
|
||||
int tries = 25; DeviceCount = 0;
|
||||
while (tries-- > 0 && DeviceCount == 0)
|
||||
|
||||
//SetDiscoveryTimeslotCount(port, 2);
|
||||
//SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod);
|
||||
//SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod);
|
||||
|
||||
//rv =SetRetryCounts(RxRetryCount, TxRetryCount);
|
||||
|
||||
FlushDiscoveryCache(port);
|
||||
FlushBuffers(port);
|
||||
|
||||
int tries = 25; DeviceCount = 0; DiscRV = 1;
|
||||
while (tries-- > 0 && DeviceCount == 0 )
|
||||
{
|
||||
//memset(DeviceIDs, 0, sizeof(DeviceIDs));
|
||||
DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("Discover try: {0} RV={1}", tries, DiscRV));
|
||||
if (DiscRV ==0 ) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("StartDiscover Error Connect Reason: {0} ErrorData {1}", ErrorReason, ErrorData));
|
||||
}
|
||||
}
|
||||
if (DiscRV != 1) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("StartDiscover Error Connect1: {0}", ErrorReason));
|
||||
}
|
||||
System::Diagnostics::Trace::WriteLine(System::String::Format("Discover DeviceCount = {0}", DeviceCount));
|
||||
return DiscRV;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +93,7 @@ void EpdBase::Epd2U::Open(DWORD DeviceID)
|
|||
void EpdBase::Epd2U::Close()
|
||||
{
|
||||
CloseDevice();
|
||||
DeinitComms(port);
|
||||
//DeinitComms(port); CommsInitialized = 0;
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::DecodeFunctionFlags()
|
||||
|
|
@ -119,6 +147,7 @@ WORD EpdBase::Epd2U::ReadStatus()
|
|||
EpdID = HardVersion = SoftVersion = FunctionFlags = 0;
|
||||
|
||||
CommitRV = ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
|
||||
if (CommitRV == 1) CommitRV = Commit();
|
||||
if (CommitRV == 1) CommitRV = ReadEpdID(
|
||||
&EpdID,
|
||||
&HardVersion,
|
||||
|
|
@ -233,7 +262,6 @@ WORD EpdBase::Epd2U::TurnOn()
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::WriteCal()
|
||||
{
|
||||
|
||||
|
|
@ -253,7 +281,6 @@ WORD EpdBase::Epd2U::WriteCal()
|
|||
return CommitRV;
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::ReadTresHolds()
|
||||
{
|
||||
Hp10THDose1 = Hp10THDose2 = Hp07THDose = 0;
|
||||
|
|
@ -368,7 +395,7 @@ WORD EpdBase::Epd2U::DeIssue()
|
|||
FlushBuffers(port);
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); EndSession(0x5E, 40); return 0;
|
||||
}
|
||||
//DeinitComms(port);
|
||||
Close();
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
|
|
@ -410,6 +437,7 @@ WORD EpdBase::Epd2U::Issue()
|
|||
EndSession(0x5E, 40);
|
||||
}
|
||||
|
||||
Close();
|
||||
//DeinitComms(port);
|
||||
|
||||
return OKRV;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace EpdBase
|
||||
{
|
||||
|
||||
|
||||
class Epd2U
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ EpdBaseClr::Epd2::Epd2(int port)
|
|||
epd = new EpdBase::Epd2U(port);
|
||||
b = gcnew sEpdBase();
|
||||
this->InitRV = epd->InitRv;
|
||||
epd->StartCom();
|
||||
}
|
||||
|
||||
EpdBaseClr::Epd2::~Epd2()
|
||||
|
|
@ -21,12 +22,12 @@ EpdBaseClr::Epd2::!Epd2()
|
|||
{
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::Connect()
|
||||
int EpdBaseClr::Epd2::Connect(bool reinit)
|
||||
{
|
||||
ConnectError = 0;
|
||||
epd->StartCom();
|
||||
if (epd->CommsInitialized==0) epd->StartCom();
|
||||
b->CurrentDeviceID = 0;
|
||||
|
||||
DeviceCount = 0;
|
||||
DiscRV = epd->StartDiscover();
|
||||
if (DiscRV == 1)
|
||||
{
|
||||
|
|
@ -47,6 +48,44 @@ int EpdBaseClr::Epd2::Close()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::DecodeStatus()
|
||||
{
|
||||
epd->DecodeStatus();
|
||||
//OperatingStatus
|
||||
DetectorsOn = epd->DetectorsOn;
|
||||
EPDIssued = epd->EPDIssued;
|
||||
EPDLocked = epd->EPDLocked;
|
||||
EPDTesting = epd->EPDTesting;
|
||||
EPDProcSec = epd->EPDProcSec;
|
||||
EPDFaulty = epd->EPDFaulty;
|
||||
|
||||
EPDNewFault = epd->EPDNewFault;
|
||||
EPDComFault = epd->EPDComFault;
|
||||
EPDCalFault = epd->EPDCalFault;
|
||||
EPDDetFault = epd->EPDDetFault;
|
||||
EPDEprFault = epd->EPDEprFault;
|
||||
EPDTrhFault = epd->EPDTrhFault;
|
||||
EPDOthFault = epd->EPDOthFault;
|
||||
|
||||
AlarmDoseHP101G = epd->AlarmDoseHP101G;
|
||||
AlarmDoseHP102G = epd->AlarmDoseHP102G;
|
||||
AlarmDoseHP07N = epd->AlarmDoseHP07N;
|
||||
AlarmRateHP101G = epd->AlarmRateHP101G;
|
||||
AlarmRateHP102G = epd->AlarmRateHP102G;
|
||||
AlarmRateHP07N = epd->AlarmRateHP07N;
|
||||
|
||||
OtherAlarmRateHp101G = epd->OtherAlarmRateHp101G;
|
||||
OtherAlarmRateHp102G = epd->OtherAlarmRateHp102G;
|
||||
OtherAlarmRateHp07N = epd->OtherAlarmRateHp07N;
|
||||
OtherAlarmReturn = epd->OtherAlarmReturn;
|
||||
OtherAlarmBatLow = epd->OtherAlarmBatLow;
|
||||
OtherAlarmCarrier = epd->OtherAlarmCarrier;
|
||||
OtherAlarmBatVolt = epd->OtherAlarmBatVolt;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int EpdBaseClr::Epd2::GetStatus()
|
||||
{
|
||||
GetStatusError = 0; StatusRV = 0; Issued = false;
|
||||
|
|
@ -63,12 +102,17 @@ int EpdBaseClr::Epd2::GetStatus()
|
|||
otherAlarms = epd->OtherAlarms;
|
||||
errorStatus = epd->ErrorStatus;
|
||||
operatingStatus = epd->OperatingStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
EpdID = epd->EpdID;
|
||||
HardVersion = epd->HardVersion;
|
||||
SoftVersion = epd->SoftVersion;
|
||||
FunctionFlags = epd->FunctionFlags;
|
||||
|
||||
DecodeStatus();
|
||||
return StatusRV;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,15 +90,55 @@ namespace EpdBaseClr {
|
|||
|
||||
unsigned short BatADC;
|
||||
unsigned short SupplyADC;
|
||||
|
||||
|
||||
//OperatingStatus
|
||||
BYTE DetectorsOn = 0;
|
||||
BYTE EPDIssued = 0;
|
||||
BYTE EPDLocked = 0;
|
||||
BYTE EPDTesting = 0;
|
||||
BYTE EPDProcSec = 0;
|
||||
BYTE EPDFaulty = 0;
|
||||
|
||||
|
||||
//ERrrostatus
|
||||
BYTE EPDNewFault = 0;
|
||||
BYTE EPDComFault = 0;
|
||||
BYTE EPDCalFault = 0;
|
||||
BYTE EPDDetFault = 0;
|
||||
BYTE EPDEprFault = 0;
|
||||
BYTE EPDTrhFault = 0;
|
||||
BYTE EPDOthFault = 0;
|
||||
|
||||
|
||||
//AlarmStatus
|
||||
BYTE AlarmDoseHP101G = 0;
|
||||
BYTE AlarmDoseHP102G = 0;
|
||||
BYTE AlarmDoseHP07N = 0;
|
||||
BYTE AlarmRateHP101G = 0;
|
||||
BYTE AlarmRateHP102G = 0;
|
||||
BYTE AlarmRateHP07N = 0;
|
||||
|
||||
//OtherAlarm
|
||||
BYTE OtherAlarmRateHp101G = 0;
|
||||
BYTE OtherAlarmRateHp102G = 0;
|
||||
BYTE OtherAlarmRateHp07N = 0;
|
||||
BYTE OtherAlarmReturn = 0;
|
||||
BYTE OtherAlarmBatLow = 0;
|
||||
BYTE OtherAlarmCarrier = 0;
|
||||
BYTE OtherAlarmBatVolt = 0;
|
||||
|
||||
|
||||
Epd2(int port);
|
||||
~Epd2();
|
||||
!Epd2();
|
||||
|
||||
int Connect();
|
||||
int Connect(bool reinit);
|
||||
|
||||
int Close();
|
||||
|
||||
int DecodeStatus();
|
||||
|
||||
int GetStatus();
|
||||
|
||||
int GetDoses();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</sectionGroup>
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="eDosStation.Properties.Settings.RemoteSQL" connectionString="Data Source=sqlsrv3.sck.be;Initial Catalog=HPH_REMS_new;Integrated Security=True"
|
||||
<add name="eDosStation.Properties.Settings.RemoteSQL" connectionString="Data Source=tcp:10.2.12.200\sag,54037;Initial Catalog=eDos;Integrated Security=True"
|
||||
providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<startup>
|
||||
|
|
|
|||
397
eDosStation/DataSet1.Designer.cs
generated
397
eDosStation/DataSet1.Designer.cs
generated
|
|
@ -3354,59 +3354,6 @@ namespace eDosStation.DataSet1TableAdapters {
|
|||
tableMapping.ColumnMappings.Add("Comment_NL", "Comment_NL");
|
||||
tableMapping.ColumnMappings.Add("Comment_EN", "Comment_EN");
|
||||
this._adapter.TableMappings.Add(tableMapping);
|
||||
this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._adapter.DeleteCommand.Connection = this.Connection;
|
||||
this._adapter.DeleteCommand.CommandText = @"DELETE FROM [HPH_REMS_new].[dbo].[CommentOnEvent] WHERE (([ID_CommnentOnEvent] = @Original_ID_CommnentOnEvent) AND ((@IsNull_TriggerTable = 1 AND [TriggerTable] IS NULL) OR ([TriggerTable] = @Original_TriggerTable)) AND ((@IsNull_TriggerField = 1 AND [TriggerField] IS NULL) OR ([TriggerField] = @Original_TriggerField)) AND ((@IsNull_TriggerStatus = 1 AND [TriggerStatus] IS NULL) OR ([TriggerStatus] = @Original_TriggerStatus)) AND ((@IsNull_Comment_FR = 1 AND [Comment_FR] IS NULL) OR ([Comment_FR] = @Original_Comment_FR)) AND ((@IsNull_Comment_NL = 1 AND [Comment_NL] IS NULL) OR ([Comment_NL] = @Original_Comment_NL)) AND ((@IsNull_Comment_EN = 1 AND [Comment_EN] IS NULL) OR ([Comment_EN] = @Original_Comment_EN)))";
|
||||
this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ID_CommnentOnEvent", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_CommnentOnEvent", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerTable", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerTable", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerField", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerField", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerStatus", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerStatus", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_FR", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_FR", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_NL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_NL", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_EN", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_EN", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._adapter.InsertCommand.Connection = this.Connection;
|
||||
this._adapter.InsertCommand.CommandText = @"INSERT INTO [HPH_REMS_new].[dbo].[CommentOnEvent] ([TriggerTable], [TriggerField], [TriggerStatus], [Comment_FR], [Comment_NL], [Comment_EN]) VALUES (@TriggerTable, @TriggerField, @TriggerStatus, @Comment_FR, @Comment_NL, @Comment_EN);
|
||||
SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR, Comment_NL, Comment_EN FROM CommentOnEvent WHERE (ID_CommnentOnEvent = SCOPE_IDENTITY())";
|
||||
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerTable", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerField", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerStatus", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_FR", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_NL", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_EN", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._adapter.UpdateCommand.Connection = this.Connection;
|
||||
this._adapter.UpdateCommand.CommandText = @"UPDATE [HPH_REMS_new].[dbo].[CommentOnEvent] SET [TriggerTable] = @TriggerTable, [TriggerField] = @TriggerField, [TriggerStatus] = @TriggerStatus, [Comment_FR] = @Comment_FR, [Comment_NL] = @Comment_NL, [Comment_EN] = @Comment_EN WHERE (([ID_CommnentOnEvent] = @Original_ID_CommnentOnEvent) AND ((@IsNull_TriggerTable = 1 AND [TriggerTable] IS NULL) OR ([TriggerTable] = @Original_TriggerTable)) AND ((@IsNull_TriggerField = 1 AND [TriggerField] IS NULL) OR ([TriggerField] = @Original_TriggerField)) AND ((@IsNull_TriggerStatus = 1 AND [TriggerStatus] IS NULL) OR ([TriggerStatus] = @Original_TriggerStatus)) AND ((@IsNull_Comment_FR = 1 AND [Comment_FR] IS NULL) OR ([Comment_FR] = @Original_Comment_FR)) AND ((@IsNull_Comment_NL = 1 AND [Comment_NL] IS NULL) OR ([Comment_NL] = @Original_Comment_NL)) AND ((@IsNull_Comment_EN = 1 AND [Comment_EN] IS NULL) OR ([Comment_EN] = @Original_Comment_EN)));
|
||||
SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR, Comment_NL, Comment_EN FROM CommentOnEvent WHERE (ID_CommnentOnEvent = @ID_CommnentOnEvent)";
|
||||
this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerTable", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerField", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TriggerStatus", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_FR", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_NL", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Comment_EN", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ID_CommnentOnEvent", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ID_CommnentOnEvent", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerTable", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerTable", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerTable", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerField", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerField", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerField", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_TriggerStatus", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TriggerStatus", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TriggerStatus", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_FR", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_FR", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_FR", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_NL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_NL", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_NL", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Comment_EN", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Comment_EN", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Comment_EN", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
|
||||
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID_CommnentOnEvent", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ID_CommnentOnEvent", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
|
@ -3422,10 +3369,9 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
|
||||
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._commandCollection[0].Connection = this.Connection;
|
||||
this._commandCollection[0].CommandText = "SELECT [ID_CommnentOnEvent]\r\n ,[TriggerTable]\r\n ,[TriggerField]\r\n " +
|
||||
",[TriggerStatus]\r\n ,[Comment_FR]\r\n ,[Comment_NL]\r\n ,[Comment_EN]\r" +
|
||||
"\n FROM [HPH_REMS_new].[dbo].[CommentOnEvent]";
|
||||
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
|
||||
this._commandCollection[0].CommandText = "dbo.CommentOnEventSelect";
|
||||
this._commandCollection[0].CommandType = global::System.Data.CommandType.StoredProcedure;
|
||||
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
|
@ -3451,277 +3397,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
this.Adapter.Fill(dataTable);
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int Update(DataSet1.CommentOnEventDataTable dataTable) {
|
||||
return this.Adapter.Update(dataTable);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int Update(DataSet1 dataSet) {
|
||||
return this.Adapter.Update(dataSet, "CommentOnEvent");
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int Update(global::System.Data.DataRow dataRow) {
|
||||
return this.Adapter.Update(new global::System.Data.DataRow[] {
|
||||
dataRow});
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int Update(global::System.Data.DataRow[] dataRows) {
|
||||
return this.Adapter.Update(dataRows);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
|
||||
public virtual int Delete(int Original_ID_CommnentOnEvent, string Original_TriggerTable, string Original_TriggerField, global::System.Nullable<bool> Original_TriggerStatus, string Original_Comment_FR, string Original_Comment_NL, string Original_Comment_EN) {
|
||||
this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID_CommnentOnEvent));
|
||||
if ((Original_TriggerTable == null)) {
|
||||
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_TriggerTable));
|
||||
}
|
||||
if ((Original_TriggerField == null)) {
|
||||
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_TriggerField));
|
||||
}
|
||||
if ((Original_TriggerStatus.HasValue == true)) {
|
||||
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[6].Value = ((bool)(Original_TriggerStatus.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((Original_Comment_FR == null)) {
|
||||
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[8].Value = ((string)(Original_Comment_FR));
|
||||
}
|
||||
if ((Original_Comment_NL == null)) {
|
||||
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[10].Value = ((string)(Original_Comment_NL));
|
||||
}
|
||||
if ((Original_Comment_EN == null)) {
|
||||
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
|
||||
this.Adapter.DeleteCommand.Parameters[12].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
|
||||
this.Adapter.DeleteCommand.Parameters[12].Value = ((string)(Original_Comment_EN));
|
||||
}
|
||||
global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
|
||||
if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
|
||||
!= global::System.Data.ConnectionState.Open)) {
|
||||
this.Adapter.DeleteCommand.Connection.Open();
|
||||
}
|
||||
try {
|
||||
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
|
||||
return returnValue;
|
||||
}
|
||||
finally {
|
||||
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
|
||||
this.Adapter.DeleteCommand.Connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
|
||||
public virtual int Insert(string TriggerTable, string TriggerField, global::System.Nullable<bool> TriggerStatus, string Comment_FR, string Comment_NL, string Comment_EN) {
|
||||
if ((TriggerTable == null)) {
|
||||
this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(TriggerTable));
|
||||
}
|
||||
if ((TriggerField == null)) {
|
||||
this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(TriggerField));
|
||||
}
|
||||
if ((TriggerStatus.HasValue == true)) {
|
||||
this.Adapter.InsertCommand.Parameters[2].Value = ((bool)(TriggerStatus.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((Comment_FR == null)) {
|
||||
this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Comment_FR));
|
||||
}
|
||||
if ((Comment_NL == null)) {
|
||||
this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[4].Value = ((string)(Comment_NL));
|
||||
}
|
||||
if ((Comment_EN == null)) {
|
||||
this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.InsertCommand.Parameters[5].Value = ((string)(Comment_EN));
|
||||
}
|
||||
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
|
||||
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
|
||||
!= global::System.Data.ConnectionState.Open)) {
|
||||
this.Adapter.InsertCommand.Connection.Open();
|
||||
}
|
||||
try {
|
||||
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
|
||||
return returnValue;
|
||||
}
|
||||
finally {
|
||||
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
|
||||
this.Adapter.InsertCommand.Connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
|
||||
public virtual int Update(string TriggerTable, string TriggerField, global::System.Nullable<bool> TriggerStatus, string Comment_FR, string Comment_NL, string Comment_EN, int Original_ID_CommnentOnEvent, string Original_TriggerTable, string Original_TriggerField, global::System.Nullable<bool> Original_TriggerStatus, string Original_Comment_FR, string Original_Comment_NL, string Original_Comment_EN, int ID_CommnentOnEvent) {
|
||||
if ((TriggerTable == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(TriggerTable));
|
||||
}
|
||||
if ((TriggerField == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(TriggerField));
|
||||
}
|
||||
if ((TriggerStatus.HasValue == true)) {
|
||||
this.Adapter.UpdateCommand.Parameters[2].Value = ((bool)(TriggerStatus.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((Comment_FR == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Comment_FR));
|
||||
}
|
||||
if ((Comment_NL == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Comment_NL));
|
||||
}
|
||||
if ((Comment_EN == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Comment_EN));
|
||||
}
|
||||
this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_ID_CommnentOnEvent));
|
||||
if ((Original_TriggerTable == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_TriggerTable));
|
||||
}
|
||||
if ((Original_TriggerField == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_TriggerField));
|
||||
}
|
||||
if ((Original_TriggerStatus.HasValue == true)) {
|
||||
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[12].Value = ((bool)(Original_TriggerStatus.Value));
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((Original_Comment_FR == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[14].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Original_Comment_FR));
|
||||
}
|
||||
if ((Original_Comment_NL == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(Original_Comment_NL));
|
||||
}
|
||||
if ((Original_Comment_EN == null)) {
|
||||
this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1));
|
||||
this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0));
|
||||
this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_Comment_EN));
|
||||
}
|
||||
this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(ID_CommnentOnEvent));
|
||||
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
|
||||
if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
|
||||
!= global::System.Data.ConnectionState.Open)) {
|
||||
this.Adapter.UpdateCommand.Connection.Open();
|
||||
}
|
||||
try {
|
||||
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
|
||||
return returnValue;
|
||||
}
|
||||
finally {
|
||||
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
|
||||
this.Adapter.UpdateCommand.Connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
|
||||
public virtual int Update(string TriggerTable, string TriggerField, global::System.Nullable<bool> TriggerStatus, string Comment_FR, string Comment_NL, string Comment_EN, int Original_ID_CommnentOnEvent, string Original_TriggerTable, string Original_TriggerField, global::System.Nullable<bool> Original_TriggerStatus, string Original_Comment_FR, string Original_Comment_NL, string Original_Comment_EN) {
|
||||
return this.Update(TriggerTable, TriggerField, TriggerStatus, Comment_FR, Comment_NL, Comment_EN, Original_ID_CommnentOnEvent, Original_TriggerTable, Original_TriggerField, Original_TriggerStatus, Original_Comment_FR, Original_Comment_NL, Original_Comment_EN, Original_ID_CommnentOnEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -3736,8 +3411,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
|
||||
private UpdateOrderOption _updateOrder;
|
||||
|
||||
private CommentOnEventTableAdapter _commentOnEventTableAdapter;
|
||||
|
||||
private bool _backupDataSetBeforeUpdate;
|
||||
|
||||
private global::System.Data.IDbConnection _connection;
|
||||
|
|
@ -3753,20 +3426,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
[global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
|
||||
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
|
||||
"a", "System.Drawing.Design.UITypeEditor")]
|
||||
public CommentOnEventTableAdapter CommentOnEventTableAdapter {
|
||||
get {
|
||||
return this._commentOnEventTableAdapter;
|
||||
}
|
||||
set {
|
||||
this._commentOnEventTableAdapter = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
public bool BackupDataSetBeforeUpdate {
|
||||
|
|
@ -3786,10 +3445,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
if ((this._connection != null)) {
|
||||
return this._connection;
|
||||
}
|
||||
if (((this._commentOnEventTableAdapter != null)
|
||||
&& (this._commentOnEventTableAdapter.Connection != null))) {
|
||||
return this._commentOnEventTableAdapter.Connection;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set {
|
||||
|
|
@ -3803,9 +3458,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
public int TableAdapterInstanceCount {
|
||||
get {
|
||||
int count = 0;
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
count = (count + 1);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -3817,15 +3469,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
private int UpdateUpdatedRows(DataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
|
||||
int result = 0;
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
global::System.Data.DataRow[] updatedRows = dataSet.CommentOnEvent.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
|
||||
updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
|
||||
if (((updatedRows != null)
|
||||
&& (0 < updatedRows.Length))) {
|
||||
result = (result + this._commentOnEventTableAdapter.Update(updatedRows));
|
||||
allChangedRows.AddRange(updatedRows);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -3836,14 +3479,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
private int UpdateInsertedRows(DataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
|
||||
int result = 0;
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
global::System.Data.DataRow[] addedRows = dataSet.CommentOnEvent.Select(null, null, global::System.Data.DataViewRowState.Added);
|
||||
if (((addedRows != null)
|
||||
&& (0 < addedRows.Length))) {
|
||||
result = (result + this._commentOnEventTableAdapter.Update(addedRows));
|
||||
allAddedRows.AddRange(addedRows);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -3854,14 +3489,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
|
||||
private int UpdateDeletedRows(DataSet1 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
|
||||
int result = 0;
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
global::System.Data.DataRow[] deletedRows = dataSet.CommentOnEvent.Select(null, null, global::System.Data.DataViewRowState.Deleted);
|
||||
if (((deletedRows != null)
|
||||
&& (0 < deletedRows.Length))) {
|
||||
result = (result + this._commentOnEventTableAdapter.Update(deletedRows));
|
||||
allChangedRows.AddRange(deletedRows);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -3901,11 +3528,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
if ((dataSet.HasChanges() == false)) {
|
||||
return 0;
|
||||
}
|
||||
if (((this._commentOnEventTableAdapter != null)
|
||||
&& (this.MatchTableAdapterConnection(this._commentOnEventTableAdapter.Connection) == false))) {
|
||||
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
|
||||
"tring.");
|
||||
}
|
||||
global::System.Data.IDbConnection workConnection = this.Connection;
|
||||
if ((workConnection == null)) {
|
||||
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
|
||||
|
|
@ -3938,15 +3560,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
try {
|
||||
// ---- Prepare for update -----------
|
||||
//
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
revertConnections.Add(this._commentOnEventTableAdapter, this._commentOnEventTableAdapter.Connection);
|
||||
this._commentOnEventTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
|
||||
this._commentOnEventTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
|
||||
if (this._commentOnEventTableAdapter.Adapter.AcceptChangesDuringUpdate) {
|
||||
this._commentOnEventTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
|
||||
adaptersWithAcceptChangesDuringUpdate.Add(this._commentOnEventTableAdapter.Adapter);
|
||||
}
|
||||
}
|
||||
//
|
||||
//---- Perform updates -----------
|
||||
//
|
||||
|
|
@ -4005,10 +3618,6 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
if (workConnOpened) {
|
||||
workConnection.Close();
|
||||
}
|
||||
if ((this._commentOnEventTableAdapter != null)) {
|
||||
this._commentOnEventTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._commentOnEventTableAdapter]));
|
||||
this._commentOnEventTableAdapter.Transaction = null;
|
||||
}
|
||||
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
|
||||
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
|
||||
adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
|
||||
|
|
|
|||
|
|
@ -77,82 +77,15 @@
|
|||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="CommentOnEventTableAdapter" GeneratorDataComponentClassName="CommentOnEventTableAdapter" Name="CommentOnEvent" UserDataComponentName="CommentOnEventTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="RemoteSQL (Settings)" DbObjectName="HPH_REMS_new.dbo.CommentOnEvent" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>DELETE FROM [HPH_REMS_new].[dbo].[CommentOnEvent] WHERE (([ID_CommnentOnEvent] = @Original_ID_CommnentOnEvent) AND ((@IsNull_TriggerTable = 1 AND [TriggerTable] IS NULL) OR ([TriggerTable] = @Original_TriggerTable)) AND ((@IsNull_TriggerField = 1 AND [TriggerField] IS NULL) OR ([TriggerField] = @Original_TriggerField)) AND ((@IsNull_TriggerStatus = 1 AND [TriggerStatus] IS NULL) OR ([TriggerStatus] = @Original_TriggerStatus)) AND ((@IsNull_Comment_FR = 1 AND [Comment_FR] IS NULL) OR ([Comment_FR] = @Original_Comment_FR)) AND ((@IsNull_Comment_NL = 1 AND [Comment_NL] IS NULL) OR ([Comment_NL] = @Original_Comment_NL)) AND ((@IsNull_Comment_EN = 1 AND [Comment_EN] IS NULL) OR ([Comment_EN] = @Original_Comment_EN)))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ID_CommnentOnEvent" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ID_CommnentOnEvent" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerTable" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_TriggerTable" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerField" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_TriggerField" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerStatus" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_TriggerStatus" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_FR" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_FR" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_NL" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_NL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_EN" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_EN" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>INSERT INTO [HPH_REMS_new].[dbo].[CommentOnEvent] ([TriggerTable], [TriggerField], [TriggerStatus], [Comment_FR], [Comment_NL], [Comment_EN]) VALUES (@TriggerTable, @TriggerField, @TriggerStatus, @Comment_FR, @Comment_NL, @Comment_EN);
|
||||
SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR, Comment_NL, Comment_EN FROM CommentOnEvent WHERE (ID_CommnentOnEvent = SCOPE_IDENTITY())</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TriggerTable" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TriggerField" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@TriggerStatus" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_FR" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_NL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_EN" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<DbSource ConnectionRef="RemoteSQL (Settings)" DbObjectName="HPH_REMS_new.dbo.CommentOnEventSelect" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="true">
|
||||
<CommandText>SELECT [ID_CommnentOnEvent]
|
||||
,[TriggerTable]
|
||||
,[TriggerField]
|
||||
,[TriggerStatus]
|
||||
,[Comment_FR]
|
||||
,[Comment_NL]
|
||||
,[Comment_EN]
|
||||
FROM [HPH_REMS_new].[dbo].[CommentOnEvent]</CommandText>
|
||||
<Parameters />
|
||||
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
|
||||
<CommandText>dbo.CommentOnEventSelect</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>UPDATE [HPH_REMS_new].[dbo].[CommentOnEvent] SET [TriggerTable] = @TriggerTable, [TriggerField] = @TriggerField, [TriggerStatus] = @TriggerStatus, [Comment_FR] = @Comment_FR, [Comment_NL] = @Comment_NL, [Comment_EN] = @Comment_EN WHERE (([ID_CommnentOnEvent] = @Original_ID_CommnentOnEvent) AND ((@IsNull_TriggerTable = 1 AND [TriggerTable] IS NULL) OR ([TriggerTable] = @Original_TriggerTable)) AND ((@IsNull_TriggerField = 1 AND [TriggerField] IS NULL) OR ([TriggerField] = @Original_TriggerField)) AND ((@IsNull_TriggerStatus = 1 AND [TriggerStatus] IS NULL) OR ([TriggerStatus] = @Original_TriggerStatus)) AND ((@IsNull_Comment_FR = 1 AND [Comment_FR] IS NULL) OR ([Comment_FR] = @Original_Comment_FR)) AND ((@IsNull_Comment_NL = 1 AND [Comment_NL] IS NULL) OR ([Comment_NL] = @Original_Comment_NL)) AND ((@IsNull_Comment_EN = 1 AND [Comment_EN] IS NULL) OR ([Comment_EN] = @Original_Comment_EN)));
|
||||
SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR, Comment_NL, Comment_EN FROM CommentOnEvent WHERE (ID_CommnentOnEvent = @ID_CommnentOnEvent)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TriggerTable" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TriggerField" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@TriggerStatus" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_FR" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_NL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Comment_EN" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ID_CommnentOnEvent" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ID_CommnentOnEvent" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerTable" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_TriggerTable" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerTable" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerField" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_TriggerField" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="TriggerField" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_TriggerStatus" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_TriggerStatus" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="TriggerStatus" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_FR" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_FR" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_FR" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_NL" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_NL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_NL" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Comment_EN" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Comment_EN" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Comment_EN" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="ID_CommnentOnEvent" ColumnName="ID_CommnentOnEvent" DataSourceName="HPH_REMS_new.dbo.CommentOnEvent" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ID_CommnentOnEvent" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="ID_CommnentOnEvent" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
|
|
@ -174,7 +107,7 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DataSet1" msprop:Generator_UserDSName="DataSet1">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="GetTaskList" msprop:Generator_TableClassName="GetTaskListDataTable" msprop:Generator_TableVarName="tableGetTaskList" msprop:Generator_TablePropName="GetTaskList" msprop:Generator_RowDeletingName="GetTaskListRowDeleting" msprop:Generator_RowChangingName="GetTaskListRowChanging" msprop:Generator_RowEvHandlerName="GetTaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskListRowDeleted" msprop:Generator_UserTableName="GetTaskList" msprop:Generator_RowChangedName="GetTaskListRowChanged" msprop:Generator_RowEvArgName="GetTaskListRowChangeEvent" msprop:Generator_RowClassName="GetTaskListRow">
|
||||
<xs:element name="GetTaskList" msprop:Generator_TableClassName="GetTaskListDataTable" msprop:Generator_TableVarName="tableGetTaskList" msprop:Generator_RowChangedName="GetTaskListRowChanged" msprop:Generator_TablePropName="GetTaskList" msprop:Generator_RowDeletingName="GetTaskListRowDeleting" msprop:Generator_RowChangingName="GetTaskListRowChanging" msprop:Generator_RowEvHandlerName="GetTaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskListRowDeleted" msprop:Generator_RowClassName="GetTaskListRow" msprop:Generator_UserTableName="GetTaskList" msprop:Generator_RowEvArgName="GetTaskListRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID_Task" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID_Task" msprop:Generator_ColumnPropNameInRow="ID_Task" msprop:Generator_ColumnPropNameInTable="ID_TaskColumn" msprop:Generator_UserColumnName="ID_Task" type="xs:int" />
|
||||
|
|
@ -204,7 +137,7 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="GetTaskInfo" msprop:Generator_TableClassName="GetTaskInfoDataTable" msprop:Generator_TableVarName="tableGetTaskInfo" msprop:Generator_RowChangedName="GetTaskInfoRowChanged" msprop:Generator_TablePropName="GetTaskInfo" msprop:Generator_RowDeletingName="GetTaskInfoRowDeleting" msprop:Generator_RowChangingName="GetTaskInfoRowChanging" msprop:Generator_RowEvHandlerName="GetTaskInfoRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskInfoRowDeleted" msprop:Generator_RowClassName="GetTaskInfoRow" msprop:Generator_UserTableName="GetTaskInfo" msprop:Generator_RowEvArgName="GetTaskInfoRowChangeEvent">
|
||||
<xs:element name="GetTaskInfo" msprop:Generator_TableClassName="GetTaskInfoDataTable" msprop:Generator_TableVarName="tableGetTaskInfo" msprop:Generator_TablePropName="GetTaskInfo" msprop:Generator_RowDeletingName="GetTaskInfoRowDeleting" msprop:Generator_RowChangingName="GetTaskInfoRowChanging" msprop:Generator_RowEvHandlerName="GetTaskInfoRowChangeEventHandler" msprop:Generator_RowDeletedName="GetTaskInfoRowDeleted" msprop:Generator_UserTableName="GetTaskInfo" msprop:Generator_RowChangedName="GetTaskInfoRowChanged" msprop:Generator_RowEvArgName="GetTaskInfoRowChangeEvent" msprop:Generator_RowClassName="GetTaskInfoRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID_Task" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID_Task" msprop:Generator_ColumnPropNameInRow="ID_Task" msprop:Generator_ColumnPropNameInTable="ID_TaskColumn" msprop:Generator_UserColumnName="ID_Task" type="xs:int" />
|
||||
|
|
@ -266,7 +199,7 @@ SELECT ID_CommnentOnEvent, TriggerTable, TriggerField, TriggerStatus, Comment_FR
|
|||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="CommentOnEvent" msprop:Generator_TableClassName="CommentOnEventDataTable" msprop:Generator_TableVarName="tableCommentOnEvent" msprop:Generator_TablePropName="CommentOnEvent" msprop:Generator_RowDeletingName="CommentOnEventRowDeleting" msprop:Generator_RowChangingName="CommentOnEventRowChanging" msprop:Generator_RowEvHandlerName="CommentOnEventRowChangeEventHandler" msprop:Generator_RowDeletedName="CommentOnEventRowDeleted" msprop:Generator_UserTableName="CommentOnEvent" msprop:Generator_RowChangedName="CommentOnEventRowChanged" msprop:Generator_RowEvArgName="CommentOnEventRowChangeEvent" msprop:Generator_RowClassName="CommentOnEventRow">
|
||||
<xs:element name="CommentOnEvent" msprop:Generator_TableClassName="CommentOnEventDataTable" msprop:Generator_TableVarName="tableCommentOnEvent" msprop:Generator_RowChangedName="CommentOnEventRowChanged" msprop:Generator_TablePropName="CommentOnEvent" msprop:Generator_RowDeletingName="CommentOnEventRowDeleting" msprop:Generator_RowChangingName="CommentOnEventRowChanging" msprop:Generator_RowEvHandlerName="CommentOnEventRowChangeEventHandler" msprop:Generator_RowDeletedName="CommentOnEventRowDeleted" msprop:Generator_RowClassName="CommentOnEventRow" msprop:Generator_UserTableName="CommentOnEvent" msprop:Generator_RowEvArgName="CommentOnEventRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID_CommnentOnEvent" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID_CommnentOnEvent" msprop:Generator_ColumnPropNameInRow="ID_CommnentOnEvent" msprop:Generator_ColumnPropNameInTable="ID_CommnentOnEventColumn" msprop:Generator_UserColumnName="ID_CommnentOnEvent" type="xs:int" />
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
Changes to this file may cause incorrect behavior and will be lost if
|
||||
the code is regenerated.
|
||||
</autogenerated>-->
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="0" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="-10" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:GetTaskList" ZOrder="2" X="70" Y="70" Height="191" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
|
||||
<Shape ID="DesignTable:GetTaskInfo" ZOrder="1" X="351" Y="70" Height="305" Width="270" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:GetTaskList" ZOrder="3" X="70" Y="70" Height="191" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
|
||||
<Shape ID="DesignTable:GetTaskInfo" ZOrder="2" X="441" Y="77" Height="305" Width="270" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:CommentOnEvent" ZOrder="1" X="57" Y="304" Height="210" Width="285" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
|
||||
</Shapes>
|
||||
<Connectors />
|
||||
</DiagramLayout>
|
||||
55
eDosStation/Decoder.cs
Normal file
55
eDosStation/Decoder.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace eDosStation
|
||||
{
|
||||
static class Decoder
|
||||
{
|
||||
static StackPanel sp;
|
||||
|
||||
|
||||
private static void tb_Add( string s)
|
||||
{
|
||||
TextBlock x = new TextBlock();
|
||||
x.Text = s;
|
||||
sp.Children.Add(x);
|
||||
}
|
||||
public static void AlarmToTextBox(StackPanel s,EpdBaseClr.Epd2 ep)
|
||||
{
|
||||
sp = s;
|
||||
if (ep.DetectorsOn > 0) tb_Add("DetectorsOn");
|
||||
if (ep.EPDIssued > 0) tb_Add("EPD Issued");
|
||||
if (ep.EPDLocked > 0) tb_Add("EPD Locked");
|
||||
if (ep.EPDTesting > 0) tb_Add("EPD Detector test active");
|
||||
if (ep.EPDProcSec > 0) tb_Add("EPD Processing every second");
|
||||
if (ep.EPDFaulty > 0) tb_Add("EPD Faulty");
|
||||
|
||||
if (ep.EPDNewFault > 0) tb_Add("EPD New Fault in History");
|
||||
if (ep.EPDComFault > 0) tb_Add("EPD Communication fault");
|
||||
if (ep.EPDCalFault > 0) tb_Add("EPD Calibration factors faulty");
|
||||
if (ep.EPDDetFault > 0) tb_Add("EPD Detector faulty");
|
||||
if (ep.EPDEprFault > 0) tb_Add("EPD Eprom faulty");
|
||||
if (ep.EPDTrhFault > 0) tb_Add("EPD Tresholds faulty");
|
||||
if (ep.EPDOthFault > 0) tb_Add("EPD Other Fault");
|
||||
|
||||
if (ep.AlarmDoseHP101G > 0) tb_Add("Alarm Dose HP10");
|
||||
if (ep.AlarmDoseHP102G > 0) tb_Add("Alarm Dose HP10");
|
||||
if (ep.AlarmDoseHP07N > 0) tb_Add("Alarm Dose HP07");
|
||||
if (ep.AlarmRateHP101G > 0) tb_Add("Alarm RateHP10 ");
|
||||
if (ep.AlarmRateHP102G > 0) tb_Add("Alarm RateHP10 ");
|
||||
if (ep.AlarmRateHP07N > 0) tb_Add("Alarm Rate HP07");
|
||||
|
||||
if (ep.OtherAlarmRateHp101G > 0) tb_Add("Alarm Rate Hp10 /G");
|
||||
if (ep.OtherAlarmRateHp102G > 0) tb_Add("Alarm Rate Hp10 /G");
|
||||
if (ep.OtherAlarmRateHp07N > 0) tb_Add("Alarm Rate Hp07 /HPN");
|
||||
if (ep.OtherAlarmReturn > 0) tb_Add("Please Return");
|
||||
if (ep.OtherAlarmBatLow > 0) tb_Add("Battery Low");
|
||||
if (ep.OtherAlarmCarrier > 0) tb_Add("Carrier present");
|
||||
if (ep.OtherAlarmBatVolt > 0) tb_Add("Battery Volt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -62,12 +62,24 @@ namespace eDosStation
|
|||
MessageBox.Show($"Entry GetStatus error {rva} {ep.GetStatusError}");
|
||||
}
|
||||
System.Diagnostics.Debug.WriteLine($"LoadDoses: EPD {ep.EpdID} Type:{ep.epdType}");
|
||||
statusEPD.Text = $"EPD: {ep.EpdID}";
|
||||
if (ep.Issued)
|
||||
{
|
||||
MessageBox.Show("EPD is currently issued\nPlease take an other", "EDP", MessageBoxButton.OK, MessageBoxImage.Hand, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification);
|
||||
this.Close();
|
||||
return false;
|
||||
}
|
||||
if (ep.alarmStatus != 0 || (ep.otherAlarms & 0x7f)!=0)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("EPD is in alarm status\n\n");
|
||||
if (ep.alarmStatus>0) sb.AppendLine("- Alarm dose");
|
||||
if (ep.OtherAlarmBatLow > 0) sb.AppendLine("- Battery Low");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Please take another");
|
||||
MessageBox.Show(sb.ToString(), "EDP", MessageBoxButton.OK, MessageBoxImage.Hand, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification);
|
||||
this.Close();
|
||||
return false;
|
||||
}
|
||||
bool isBG = (ep.epdType == 0);
|
||||
if (isBG != CurTaskRow.EPDRad.Equals("BG"))
|
||||
{
|
||||
|
|
@ -75,7 +87,7 @@ namespace eDosStation
|
|||
this.Close();
|
||||
return false;
|
||||
}
|
||||
statusEPD.Text = $"EPD: {ep.EpdID}";
|
||||
|
||||
rva = ep.ReadTresholds();
|
||||
if (rva != 1)
|
||||
{
|
||||
|
|
@ -91,7 +103,7 @@ namespace eDosStation
|
|||
dispatcherTimer.Stop();
|
||||
ep.Close();
|
||||
System.Threading.Thread.Sleep(200);
|
||||
int rv= ep.Connect();
|
||||
int rv= ep.Connect(false);
|
||||
System.Diagnostics.Debug.WriteLine($"Connect {rv} error {ep.ConnectError}");
|
||||
if (ep.DeviceCount >0 && ep.b.CurrentDeviceID>0)
|
||||
{
|
||||
|
|
@ -118,31 +130,32 @@ namespace eDosStation
|
|||
if (LoadDoses())
|
||||
{
|
||||
bool isBG = (ep.epdType != 3); //3 = zwarte 0=grijs
|
||||
int? VisitID = null;
|
||||
int? StationVisitID = null;
|
||||
using (var co = new System.Data.SqlClient.SqlConnection(Properties.Settings.Default.RemoteSQL))
|
||||
{
|
||||
using (var cmd1 = new SqlCommand("VisitInit", co))
|
||||
{
|
||||
cmd1.CommandType = CommandType.StoredProcedure;
|
||||
var pa = new SqlParameter("PersID", SqlDbType.Int, 4); pa.Value = _User.PersID; cmd1.Parameters.Add(pa);
|
||||
var pa = new SqlParameter("ID_Station", SqlDbType.Int, 4); pa.Value = thisStation.ID_Station; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("PersID", SqlDbType.Int, 4); pa.Value = _User.PersID; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("ID_Task", SqlDbType.Int, 4); pa.Value = CurTaskRow.ID_Task; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Inst_CODE", SqlDbType.Int, 4); pa.Value = CurTaskRow.Inst_CODE; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("EPD_InternalID", SqlDbType.Int, 4); pa.Value = (int)ep.EpdID; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("isBG", SqlDbType.Bit, 4); pa.Value = isBG; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("ID_Visit", SqlDbType.Int, 4); pa.Direction = ParameterDirection.Output; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("EPDVisitID", SqlDbType.Int, 4); pa.Direction = ParameterDirection.Output; cmd1.Parameters.Add(pa);
|
||||
co.Open();
|
||||
cmd1.ExecuteNonQuery();
|
||||
VisitID = (int?)cmd1.Parameters["ID_Visit"].Value;
|
||||
StationVisitID = (int?)cmd1.Parameters["EPDVisitID"].Value;
|
||||
co.Close();
|
||||
}
|
||||
}
|
||||
|
||||
int rv= ep.PrepareForIssue();
|
||||
int rv = ep.PrepareForIssue();
|
||||
if (rv != 1)
|
||||
{
|
||||
MessageBox.Show($"PrepareForIssue error {ep.PrepareForIssueError}");
|
||||
}
|
||||
ep.WearerID = VisitID.ToString();
|
||||
ep.WearerID = StationVisitID.ToString();
|
||||
ep.WearerName = _User.PersID.ToString();
|
||||
|
||||
ep.Hp07RateOn = CurTaskRow.HP07RateON;
|
||||
|
|
@ -195,12 +208,14 @@ namespace eDosStation
|
|||
}
|
||||
bEpdDone.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
ep.Close();
|
||||
}
|
||||
private void GetEPD()
|
||||
{
|
||||
if (_User == null || CurTaskRow == null) return;
|
||||
|
||||
int ok = ep.Connect();
|
||||
int ok = ep.Connect(false);
|
||||
if (ok != 1) System.Diagnostics.Debug.WriteLine($"GetEpd {ok} ConnectError: {ep.ConnectError}");
|
||||
if (ep.DeviceCount == 1 && ep.b.CurrentDeviceID>0)
|
||||
{
|
||||
|
|
@ -287,6 +302,7 @@ namespace eDosStation
|
|||
if (_User.PersID == 0)
|
||||
{
|
||||
tReasonNoAccess.Text = getCommentUnknown();
|
||||
if (_User.Error > 0) tReasonNoAccess.Text = _User.ErrorMessage;
|
||||
tbNotAllowed.IsSelected = true;
|
||||
doCancel = true;
|
||||
}
|
||||
|
|
@ -385,39 +401,6 @@ namespace eDosStation
|
|||
this.Dispatcher.Invoke(new Action(() => showBadge()));
|
||||
StopReadBadge = true;
|
||||
}
|
||||
// if (a.clr.Result.StartsWith("csn:", StringComparison.InvariantCultureIgnoreCase) && a.clr.Result.EndsWith(";"))
|
||||
// { //GEn 2
|
||||
// csn = string.Empty;
|
||||
// foreach (string ar in a.clr.Result.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
// {
|
||||
// if (ar.StartsWith("csn:")) csn = ar.Substring(4);
|
||||
// if (ar.StartsWith("site:")) site = ar.Substring(5);
|
||||
// if (ar.StartsWith("code:")) code = ar.Substring(5);
|
||||
// }
|
||||
// this.Dispatcher.Invoke(new Action(() => showBadge()));
|
||||
// StopReadBadge = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (a.clr.Result.Equals(";"))
|
||||
// {
|
||||
// if (nextSite) site = string.Empty;
|
||||
// if (nextCode) code = string.Empty;
|
||||
// if (nextFinish || nextCode)
|
||||
// {
|
||||
// this.Dispatcher.Invoke(new Action(() => showBadge()));
|
||||
// StopReadBadge = true;
|
||||
// }
|
||||
// nextCSN = nextSite = nextCode = nextFinish = false;
|
||||
// }
|
||||
// else if (nextCSN) { csn = a.clr.Result; nextCSN = nextFinish = false; }
|
||||
// else if (nextSite) { site = a.clr.Result; nextSite = false; }
|
||||
// else if (nextCode) { code = a.clr.Result; nextCode = false; nextFinish = true; }
|
||||
// else if (a.clr.Result.Equals("csn:")) { nextCSN = true; nextCode = nextSite = false; }
|
||||
// else if (a.clr.Result.Equals("site:")) { nextSite = true; nextCSN = nextCode = false; }
|
||||
// else if (a.clr.Result.Equals("code:")) { nextCode = true; nextCSN = nextSite = false; }
|
||||
// else System.Diagnostics.Debug.WriteLine(a.clr.Result);
|
||||
// }
|
||||
}
|
||||
else
|
||||
System.Diagnostics.Debug.WriteLine($"Error {err}");
|
||||
|
|
@ -549,6 +532,7 @@ namespace eDosStation
|
|||
{
|
||||
t = null;
|
||||
a = null;
|
||||
ep.Close();
|
||||
//t.Abort();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:eDosStation"
|
||||
mc:Ignorable="d"
|
||||
Title="Exit" Height="450" Width="800" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
|
||||
Title="Exit" Height="450" Width="800" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
|
||||
<DockPanel>
|
||||
<StatusBar DockPanel.Dock="Bottom" >
|
||||
<StatusBarItem Name="statusEPD" Content="Epd" />
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace eDosStation
|
|||
dispatcherTimer.Tick -= DispatcherTimer_Tick;
|
||||
dispatcherTimer.Stop();
|
||||
}
|
||||
dispatcherTimer.Tick += DispatcherTimer_TickTO; ;
|
||||
dispatcherTimer.Tick += DispatcherTimer_TickTimeOut; ;
|
||||
|
||||
int rv= ep.GetStatus();
|
||||
if (rv != 1)
|
||||
|
|
@ -100,73 +100,88 @@ namespace eDosStation
|
|||
rv = ep.GetDoses();
|
||||
if (rv != 1)
|
||||
{
|
||||
MessageBox.Show($"GetDoses {rv} er:{ep.GetDosesError}");
|
||||
rv = ep.GetDoses(); //try again
|
||||
if (rv != 1)
|
||||
MessageBox.Show($"GetDoses {rv} er:{ep.GetDosesError}");
|
||||
}
|
||||
|
||||
HpDose07.Text = $"Hp07: {ep.Hp07:0.00} µSv ";
|
||||
HpDose10.Text = $"Hp10: {ep.Hp10:0.00} µSv";
|
||||
if (int.TryParse(ep.WearerID, out int VisitID)) {
|
||||
if (int.TryParse(ep.WearerID, out int EpdVisitID))
|
||||
{
|
||||
bool isBG = (ep.epdType == 3);
|
||||
using (var co = new System.Data.SqlClient.SqlConnection(Properties.Settings.Default.RemoteSQL))
|
||||
rv = ep.SetDeIssued(); //includes close
|
||||
if (rv != 1)
|
||||
{
|
||||
using (var cmd1 = new SqlCommand("VisitExit", co))
|
||||
MessageBox.Show($"DeIssueerror {rv}");
|
||||
}
|
||||
|
||||
|
||||
var l = new SqlLog();
|
||||
try
|
||||
{
|
||||
using (var co = new System.Data.SqlClient.SqlConnection(Properties.Settings.Default.RemoteSQL))
|
||||
{
|
||||
cmd1.CommandType = CommandType.StoredProcedure;
|
||||
var pa = new SqlParameter("ID_Visit", SqlDbType.Int, 4); pa.Value = VisitID; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP07", SqlDbType.Float); pa.Value = ep.Hp07; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP10", SqlDbType.Float); pa.Value = ep.Hp10; cmd1.Parameters.Add(pa);
|
||||
using (var cmd1 = new SqlCommand("VisitExit", co))
|
||||
{
|
||||
cmd1.CommandType = CommandType.StoredProcedure;
|
||||
var pa = new SqlParameter("EPDVisitID", SqlDbType.Int, 4); pa.Value = EpdVisitID; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP07", SqlDbType.Float); pa.Value = ep.Hp07; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP10", SqlDbType.Float); pa.Value = ep.Hp10; cmd1.Parameters.Add(pa);
|
||||
|
||||
pa = new SqlParameter("Hp07Total", SqlDbType.Float); pa.Value = ep.Hp07Total; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp10Total", SqlDbType.Float); pa.Value = ep.Hp10Total; cmd1.Parameters.Add(pa);
|
||||
//pa = new SqlParameter("Hp07Rate", SqlDbType.Float); pa.Value = ep.Hp07Rate; cmd1.Parameters.Add(pa);
|
||||
//pa = new SqlParameter("Hp10Rate", SqlDbType.Float); pa.Value = ep.Hp10Rate; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp07Total", SqlDbType.Float); pa.Value = ep.Hp07Total; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp10Total", SqlDbType.Float); pa.Value = ep.Hp10Total; cmd1.Parameters.Add(pa);
|
||||
//pa = new SqlParameter("Hp07Rate", SqlDbType.Float); pa.Value = ep.Hp07Rate; cmd1.Parameters.Add(pa);
|
||||
//pa = new SqlParameter("Hp10Rate", SqlDbType.Float); pa.Value = ep.Hp10Rate; cmd1.Parameters.Add(pa);
|
||||
|
||||
pa = new SqlParameter("Hp07Peak", SqlDbType.Float); pa.Value = ep.Hp07Peak; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp10Peak", SqlDbType.Float); pa.Value = ep.Hp10Peak; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP07PeakTime", SqlDbType.DateTime); cmd1.Parameters.Add(pa);
|
||||
if (ep.Hp07PeakTime != null) pa.Value = ep.Hp07PeakTime; else pa.Value = DBNull.Value;
|
||||
pa = new SqlParameter("HP10PeakTime", SqlDbType.DateTime); cmd1.Parameters.Add(pa);
|
||||
if (ep.Hp10PeakTime != null) pa.Value = ep.Hp10PeakTime; else pa.Value = DBNull.Value;
|
||||
pa = new SqlParameter("K1", SqlDbType.Int); pa.Value = ep.K1; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K2", SqlDbType.Int); pa.Value = ep.K2; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K3", SqlDbType.Int); pa.Value = ep.K3; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K4", SqlDbType.Int); pa.Value = ep.K4; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K5", SqlDbType.Int); pa.Value = ep.K5; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K6", SqlDbType.Int); pa.Value = ep.K6; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("SG", SqlDbType.Int); pa.Value = ep.SG; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("BC", SqlDbType.Int); pa.Value = ep.BC; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("FB", SqlDbType.Int); pa.Value = ep.FB; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HG", SqlDbType.Int); pa.Value = ep.HG; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp07Peak", SqlDbType.Float); pa.Value = ep.Hp07Peak; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("Hp10Peak", SqlDbType.Float); pa.Value = ep.Hp10Peak; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HP07PeakTime", SqlDbType.DateTime); cmd1.Parameters.Add(pa);
|
||||
if (ep.Hp07PeakTime != null) pa.Value = ep.Hp07PeakTime; else pa.Value = DBNull.Value;
|
||||
pa = new SqlParameter("HP10PeakTime", SqlDbType.DateTime); cmd1.Parameters.Add(pa);
|
||||
if (ep.Hp10PeakTime != null) pa.Value = ep.Hp10PeakTime; else pa.Value = DBNull.Value;
|
||||
pa = new SqlParameter("K1", SqlDbType.Int); pa.Value = ep.K1; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K2", SqlDbType.Int); pa.Value = ep.K2; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K3", SqlDbType.Int); pa.Value = ep.K3; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K4", SqlDbType.Int); pa.Value = ep.K4; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K5", SqlDbType.Int); pa.Value = ep.K5; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("K6", SqlDbType.Int); pa.Value = ep.K6; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("SG", SqlDbType.Int); pa.Value = ep.SG; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("BC", SqlDbType.Int); pa.Value = ep.BC; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("FB", SqlDbType.Int); pa.Value = ep.FB; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("HG", SqlDbType.Int); pa.Value = ep.HG; cmd1.Parameters.Add(pa);
|
||||
|
||||
pa = new SqlParameter("QualityData", SqlDbType.Int); pa.Value = ep.QualityData; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("QualityData", SqlDbType.Int); pa.Value = ep.QualityData; cmd1.Parameters.Add(pa);
|
||||
|
||||
pa = new SqlParameter("D1", SqlDbType.Int); pa.Value = ep.D1; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D2", SqlDbType.Int); pa.Value = ep.D2; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D3", SqlDbType.Int); pa.Value = ep.D3; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D4", SqlDbType.Int); pa.Value = ep.D4; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D1", SqlDbType.Int); pa.Value = ep.D1; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D2", SqlDbType.Int); pa.Value = ep.D2; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D3", SqlDbType.Int); pa.Value = ep.D3; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("D4", SqlDbType.Int); pa.Value = ep.D4; cmd1.Parameters.Add(pa);
|
||||
|
||||
pa = new SqlParameter("alarmStatus", SqlDbType.Int); pa.Value = ep.alarmStatus; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("otherAlarms", SqlDbType.Int); pa.Value = ep.otherAlarms; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("errorStatus", SqlDbType.Int); pa.Value = ep.errorStatus; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("operatingStatus", SqlDbType.Int); pa.Value = ep.operatingStatus; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("alarmStatus", SqlDbType.Int); pa.Value = ep.alarmStatus; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("otherAlarms", SqlDbType.Int); pa.Value = ep.otherAlarms; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("errorStatus", SqlDbType.Int); pa.Value = ep.errorStatus; cmd1.Parameters.Add(pa);
|
||||
pa = new SqlParameter("operatingStatus", SqlDbType.Int); pa.Value = ep.operatingStatus; cmd1.Parameters.Add(pa);
|
||||
|
||||
co.Open();
|
||||
cmd1.ExecuteNonQuery();
|
||||
co.Close();
|
||||
l.LogCommand(cmd1);
|
||||
co.Open();
|
||||
cmd1.ExecuteNonQuery();
|
||||
co.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
l.LogCommand(ex.Message);
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
l.Dispose();
|
||||
}
|
||||
|
||||
rv= ep.SetDeIssued();
|
||||
if (rv!=1)
|
||||
{
|
||||
MessageBox.Show($"DeIssueerror {rv}");
|
||||
}
|
||||
|
||||
dispatcherTimer.Start(); //Knop hide
|
||||
return;
|
||||
}
|
||||
|
||||
private void DispatcherTimer_TickTO(object sender, EventArgs e)
|
||||
private void DispatcherTimer_TickTimeOut(object sender, EventArgs e)
|
||||
{
|
||||
dispatcherTimer.Stop();
|
||||
this.Close();
|
||||
|
|
@ -177,9 +192,9 @@ namespace eDosStation
|
|||
{
|
||||
EpdFound = false;
|
||||
//ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
int rv = ep.Connect();
|
||||
int rv = ep.Connect(false);
|
||||
System.Diagnostics.Debug.WriteLine($"Connect {rv} error {ep.ConnectError}");
|
||||
if (ep.DeviceCount >0 && ep.b.CurrentDeviceID>0)
|
||||
if (rv==1 && ep.DeviceCount >0 && ep.b.CurrentDeviceID>0)
|
||||
{
|
||||
EpdFound = true;
|
||||
statusEPD.Content = $"StartScan : EPD: {ep.b.CurrentDeviceID}";
|
||||
|
|
@ -207,7 +222,8 @@ namespace eDosStation
|
|||
{
|
||||
dispatcherTimer.Stop();
|
||||
EpdFound = false;
|
||||
int rv = ep.Connect();
|
||||
|
||||
int rv = ep.Connect(false);
|
||||
if (rv==1 && ep.DeviceCount > 0 && ep.b.CurrentDeviceID>0)
|
||||
{
|
||||
EpdFound = true;
|
||||
|
|
@ -236,5 +252,11 @@ namespace eDosStation
|
|||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if (dispatcherTimer?.IsEnabled == true) dispatcherTimer.IsEnabled = false;
|
||||
dispatcherTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
eDosStation/InstMessage.xaml
Normal file
24
eDosStation/InstMessage.xaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<Window x:Class="eDosStation.InstMessage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:eDosStation"
|
||||
mc:Ignorable="d"
|
||||
Title="InstMessage" Height="450" Width="800" Topmost="True" WindowStartupLocation="CenterScreen" Closing="Window_Closing" Loaded="Window_Loaded" >
|
||||
<Grid>
|
||||
|
||||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" MinWidth="500" >
|
||||
<StackPanel Name="sComments" VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||
</StackPanel>
|
||||
<Button Content="OK" Name="bMsg" Click="BMsg_Click" Width="50" Margin="0,20,0,20"/>
|
||||
<ProgressBar x:Name="pUserSeconds" Background="Blue" Value="5" Maximum="10" Tag="AA" Height="10" MinWidth="150" >
|
||||
<ProgressBar.Effect>
|
||||
<DropShadowEffect/>
|
||||
</ProgressBar.Effect>
|
||||
</ProgressBar>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
66
eDosStation/InstMessage.xaml.cs
Normal file
66
eDosStation/InstMessage.xaml.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
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.Shapes;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace eDosStation
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for InstMessage.xaml
|
||||
/// </summary>
|
||||
public partial class InstMessage : Window
|
||||
{
|
||||
DispatcherTimer dispatcherTimer;
|
||||
int UserSeconds;
|
||||
public InstMessage(TextBlock comments)
|
||||
{
|
||||
InitializeComponent();
|
||||
sComments.Children.Add(comments);
|
||||
}
|
||||
|
||||
private void BMsg_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
sComments.Children.Clear();
|
||||
}
|
||||
|
||||
private void SwitchToTask(object sender, EventArgs e)
|
||||
{
|
||||
if (--UserSeconds > 0 )
|
||||
{
|
||||
//tUserSeconds.Text = UserSeconds.ToString();
|
||||
pUserSeconds.Value = UserSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatcherTimer.Stop();
|
||||
dispatcherTimer.Tick -= SwitchToTask;
|
||||
sComments.Children.Clear();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserSeconds = 20;
|
||||
pUserSeconds.Maximum = pUserSeconds.Value= UserSeconds;
|
||||
dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal);
|
||||
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
|
||||
dispatcherTimer.Tick += SwitchToTask;
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -56,15 +56,54 @@ namespace eDosStation
|
|||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
thisStation = new Station("");
|
||||
if (thisStation.insComments.Length > 2) {
|
||||
ibComment.Child= thisStation.tbComments;
|
||||
//itComment = thisStation.tbComments;
|
||||
ibComment.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
ibComment.Visibility = Visibility.Hidden;
|
||||
ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
bool ok = true;
|
||||
try
|
||||
{
|
||||
thisStation = new Station(string.Empty);
|
||||
} catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Startup error {ex.Message} ");
|
||||
ok = false;
|
||||
}
|
||||
if (ok && thisStation.Error>0)
|
||||
{
|
||||
MessageBox.Show($"Startup error {thisStation.ErrorMessage} ");
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok) try {
|
||||
//var sp = new System.IO.Ports.SerialPort($"com{thisStation.ComPort}");
|
||||
//sp.BaudRate = 9600;
|
||||
//sp.Parity = System.IO.Ports.Parity.None;
|
||||
//sp.StopBits = System.IO.Ports.StopBits.One;
|
||||
//sp.Open();
|
||||
//sp.DiscardInBuffer();
|
||||
//sp.Close();
|
||||
|
||||
|
||||
ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Edp software error {ex.Message}");
|
||||
ok = false;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
|
||||
|
||||
if (thisStation.insComments.Length > 2)
|
||||
{
|
||||
InstMessage w = new InstMessage(thisStation.tbComments);
|
||||
w.ShowDialog();
|
||||
ibComment.Child = thisStation.tbComments;
|
||||
//itComment = thisStation.tbComments;
|
||||
ibComment.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
ibComment.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3
eDosStation/Properties/Settings.Designer.cs
generated
3
eDosStation/Properties/Settings.Designer.cs
generated
|
|
@ -38,7 +38,8 @@ namespace eDosStation.Properties {
|
|||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=sqlsrv3.sck.be;Initial Catalog=HPH_REMS_new;Integrated Security=True")]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=tcp:10.2.12.200\\sag,54037;Initial Catalog=eDos;Integrated Security=Tr" +
|
||||
"ue")]
|
||||
public string RemoteSQL {
|
||||
get {
|
||||
return ((string)(this["RemoteSQL"]));
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
<Setting Name="RemoteSQL" Type="(Connection string)" Scope="Application">
|
||||
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
||||
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ConnectionString>Data Source=sqlsrv3.sck.be;Initial Catalog=HPH_REMS_new;Integrated Security=True</ConnectionString>
|
||||
<ConnectionString>Data Source=tcp:10.2.12.200\sag,54037;Initial Catalog=eDos;Integrated Security=True</ConnectionString>
|
||||
<ProviderName>System.Data.SqlClient</ProviderName>
|
||||
</SerializableConnectionString></DesignTimeValue>
|
||||
<Value Profile="(Default)">Data Source=sqlsrv3.sck.be;Initial Catalog=HPH_REMS_new;Integrated Security=True</Value>
|
||||
<Value Profile="(Default)">Data Source=tcp:10.2.12.200\sag,54037;Initial Catalog=eDos;Integrated Security=True</Value>
|
||||
</Setting>
|
||||
<Setting Name="Inst_CODE1" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">1</Value>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -29,18 +30,38 @@
|
|||
<CheckBox Grid.Row="0" Grid.Column="0" Content="Issued" IsChecked="False" Name ="isIssued"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Name ="Wearer" Text=""/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="2" Name ="EpdVisit" Text=""/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Dose" Margin="5,10,0,0" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="5,10,0,0">
|
||||
<TextBlock Name="HpDose07" />
|
||||
<TextBlock Name="HpDose10" />
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0">
|
||||
<CheckBox Content="Alarm" Name="cAlarm" HorizontalContentAlignment="Left" />
|
||||
<StackPanel Name="sAlarm" Margin="50,0,20,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Dose Treshold" />
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Vertical" >
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Dose" Margin="5,10,0,0" />
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Vertical" Margin="5,10,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Name="HpDose07l" Width="200"/>
|
||||
<TextBlock Name="HpDose07" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Name="HpDose10l" Width="200" />
|
||||
<TextBlock Name="HpDose10" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="Dose Treshold" />
|
||||
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Vertical" >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Name="HP07AlarmDosel" Width="200" />
|
||||
<TextBlock Name="HP07AlarmDose" />
|
||||
<TextBlock Name="HP10AlarmDose1" />
|
||||
<TextBlock Name="HP10AlarmDose2" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Name="HP10AlarmDose1l" Width="200" />
|
||||
<TextBlock Name="HP10AlarmDose1" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Name="HP10AlarmDose2l" Width="200" />
|
||||
<TextBlock Name="HP10AlarmDose2" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,18 +36,34 @@ namespace eDosStation
|
|||
private void LoadDoses()
|
||||
{
|
||||
ep.GetStatus();
|
||||
|
||||
isIssued.IsChecked = ep.Issued;
|
||||
Wearer.Text = ep.WearerName;
|
||||
EpdVisit.Text = $"Visit {ep.WearerID}";
|
||||
|
||||
if ((ep.otherAlarms & 0x7f)!=0 || ep.alarmStatus>0)
|
||||
{
|
||||
cAlarm.IsChecked = true;
|
||||
} else
|
||||
cAlarm.IsChecked = false;
|
||||
|
||||
Decoder.AlarmToTextBox(sAlarm, ep);
|
||||
|
||||
ep.GetDoses();
|
||||
HpDose07.Text = $"Hp07: {ep.Hp07:0.00} µSv";
|
||||
HpDose10.Text = $"Hp10: {ep.Hp10:0.00} µSv";
|
||||
HpDose07l.Text = $"Hp07";
|
||||
HpDose10l.Text = $"Hp10";
|
||||
|
||||
HpDose07.Text = $"{ep.Hp07:0.00} µSv";
|
||||
HpDose10.Text = $"{ep.Hp10:0.00} µSv";
|
||||
|
||||
ep.ReadTresholds();
|
||||
HP10AlarmDose1.Text = $"Alarm HP10(1) {ep.Hp10THDose1:0.00} µSv";
|
||||
HP10AlarmDose2.Text = $"Alarm HP10(2) {ep.Hp10THDose2:0.00} µSv";
|
||||
HP07AlarmDose.Text = $"Alarm HP07 {ep.Hp07THDose:0.00} µSv";
|
||||
HP10AlarmDose1l.Text = "Alarm HP10(1)";
|
||||
HP10AlarmDose2l.Text = "Alarm HP10(2)";
|
||||
HP07AlarmDosel.Text = "Alarm HP07";
|
||||
|
||||
HP10AlarmDose1.Text = $"{ep.Hp10THDose1:0.00} µSv";
|
||||
HP10AlarmDose2.Text = $"{ep.Hp10THDose2:0.00} µSv";
|
||||
HP07AlarmDose.Text = $"{ep.Hp07THDose:0.00} µSv";
|
||||
|
||||
//ep.ReadExtraStatus();
|
||||
|
||||
|
|
@ -56,6 +72,7 @@ namespace eDosStation
|
|||
|
||||
//int Hp10THDose2;
|
||||
//int Hp07THDose;
|
||||
ep.Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
|
|
@ -65,7 +82,7 @@ namespace eDosStation
|
|||
try
|
||||
{
|
||||
//ep = new EpdBaseClr.Epd2(thisStation.ComPort);
|
||||
ConnectRV = ep.Connect();
|
||||
ConnectRV = ep.Connect(false);
|
||||
} catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error loading dll's");
|
||||
|
|
@ -92,8 +109,7 @@ namespace eDosStation
|
|||
private void DispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
dispatcherTimer.Stop();
|
||||
ep.Close();
|
||||
ep.Connect();
|
||||
ep.Connect(false);
|
||||
if (ep.DeviceCount == 1 )
|
||||
{
|
||||
EpdFound = true;
|
||||
|
|
|
|||
71
eDosStation/SqlLog.cs
Normal file
71
eDosStation/SqlLog.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eDosStation
|
||||
{
|
||||
public class SqlLog: IDisposable
|
||||
{
|
||||
private bool disposed = false;
|
||||
System.IO.StreamWriter wr;
|
||||
public SqlLog()
|
||||
{
|
||||
try
|
||||
{
|
||||
wr = new System.IO.StreamWriter(@"c:\temp\sql.txt", true);
|
||||
} catch(System.Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!this.disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (wr?.BaseStream != null) wr.Close();
|
||||
wr.Dispose();
|
||||
}
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
~SqlLog()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public void LogCommand(string ermsg)
|
||||
{
|
||||
if (wr.BaseStream.CanWrite)
|
||||
{
|
||||
wr.WriteLine($"-- {System.DateTime.Now.ToString("yyyy-MM-dd HH:mm")} --- err {ermsg} ---");
|
||||
wr.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
public void LogCommand(System.Data.SqlClient.SqlCommand co )
|
||||
{
|
||||
wr.WriteLine($"-- {System.DateTime.Now.ToString("yyyy-MM-dd HH:mm")} ---");
|
||||
if (co.CommandType == System.Data.CommandType.StoredProcedure) wr.Write("exec ");
|
||||
wr.Write(co.CommandText);
|
||||
int paidx = 0;
|
||||
foreach (System.Data.SqlClient.SqlParameter pa in co.Parameters)
|
||||
{
|
||||
if (paidx++ > 0) wr.Write(",");
|
||||
wr.Write($" @{pa.ParameterName}={pa.Value}");
|
||||
}
|
||||
wr.WriteLine();
|
||||
wr.WriteLine("----");
|
||||
wr.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,8 @@ namespace eDosStation
|
|||
{
|
||||
public class Station
|
||||
{
|
||||
|
||||
public int ID_Station { get; set; }
|
||||
public int ComPort { get; set; }
|
||||
public int Inst_CODE1 { get; set; }
|
||||
public int Inst_CODE2 { get; set; }
|
||||
|
|
@ -26,6 +28,8 @@ namespace eDosStation
|
|||
|
||||
public Station(string Station)
|
||||
{
|
||||
Error = 0;
|
||||
ErrorMessage = string.Empty;
|
||||
ComPort = 0;
|
||||
Inst_CODE1 = 1;
|
||||
Inst_CODE2 = 11;
|
||||
|
|
@ -50,6 +54,7 @@ namespace eDosStation
|
|||
{
|
||||
object[] Values = new object[rs.FieldCount];
|
||||
int rv = rs.GetValues(Values);
|
||||
ID_Station= (int)Values[rs.GetOrdinal("ID_Station")];
|
||||
ComPort = (int)Values[rs.GetOrdinal("ComPort")];
|
||||
Inst_CODE1 = (int)Values[rs.GetOrdinal("Inst_CODE1")];
|
||||
Inst_CODE2 = (int)Values[rs.GetOrdinal("Inst_CODE2")];
|
||||
|
|
@ -58,6 +63,7 @@ namespace eDosStation
|
|||
TestCSN = Values[rs.GetOrdinal("TestCSN")].ToString();
|
||||
} else
|
||||
{
|
||||
ID_Station = 0;
|
||||
ComPort = 0;
|
||||
Inst_CODE1 = 1;
|
||||
Inst_CODE2 = 11;
|
||||
|
|
@ -75,7 +81,7 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
|
||||
using (var cmd2 = new SqlCommand("GetInstallationsComments", co))
|
||||
if (Error==0) using (var cmd2 = new SqlCommand("GetInstallationsComments", co))
|
||||
{
|
||||
cmd2.CommandType = System.Data.CommandType.StoredProcedure;
|
||||
cmd2.Parameters.AddWithValue("@Inst_CODE1", Inst_CODE1);
|
||||
|
|
|
|||
|
|
@ -135,18 +135,23 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>DataSet1.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Decoder.cs" />
|
||||
<Compile Include="EntryBadge.xaml.cs">
|
||||
<DependentUpon>EntryBadge.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EpdExit.xaml.cs">
|
||||
<DependentUpon>EpdExit.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InstMessage.xaml.cs">
|
||||
<DependentUpon>InstMessage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Settings.xaml.cs">
|
||||
<DependentUpon>Settings.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShowEPDDose.xaml.cs">
|
||||
<DependentUpon>ShowEPDDose.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SqlLog.cs" />
|
||||
<Compile Include="Station.cs" />
|
||||
<Compile Include="TouchEnabledTextBox.cs" />
|
||||
<Compile Include="User.cs" />
|
||||
|
|
@ -162,6 +167,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InstMessage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue