comments, event text

This commit is contained in:
Luc Vandenbroucke 2020-02-06 09:37:51 +01:00
parent 0ea1a6a4fe
commit f1e03db563
8 changed files with 1500 additions and 54 deletions

View file

@ -20,7 +20,6 @@ DWORD EpdBase::Epd2U::StartCom()
if (InitRv == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
else {
CommsInitialized = 1;
//SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod);
}
return Error;
}
@ -30,7 +29,6 @@ EpdBase::Epd2U::~Epd2U()
DeinitComms(port);
}
int EpdBase::Epd2U::StartDiscover()
{
System::Diagnostics::Trace::WriteLine("StartDiscover");
@ -113,23 +111,23 @@ void EpdBase::Epd2U::DecodeStatus()
WORD EpdBase::Epd2U::ReadStatus()
{
Error = 0; ReadStatusRV = 0;
memset(WearerID, 0, WearerIDLength+1);
memset(WearerName, 0, WearerNameLength+1);
memset(WearerID, 0, WearerIDLength + 1);
memset(WearerName, 0, WearerNameLength + 1);
EpdClock = RealTime = IssueCount = OffTime = OperatingStatus = ErrorStatus = AlarmStatus = OtherAlarms = EEPROMBadSectors = 0;
ErrorSource = ErrorReason = ErrorData = 0;
EpdID = HardVersion = SoftVersion = FunctionFlags = 0;
CommitRV = ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
if (CommitRV==1) CommitRV= ReadEpdID(
if (CommitRV == 1) CommitRV = ReadEpdID(
&EpdID,
&HardVersion,
&SoftVersion,
&FunctionFlags);
if (CommitRV==1) CommitRV = Commit();
if(CommitRV == 0) {
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
ReadStatusRV= ErrorReason;
ReadStatusRV = ErrorReason;
return 0;
}
else {
@ -147,7 +145,7 @@ WORD EpdBase::Epd2U::ReadStatus()
WearerIDLength,
WearerName,
WearerNameLength);
if(CommitRV==1) CommitRV = Commit();
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
ReadStatusRV = ErrorReason;

File diff suppressed because it is too large Load diff

View file

@ -75,6 +75,97 @@
</Mappings>
<Sources />
</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>
<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>
</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>
<Mapping SourceColumn="ID_CommnentOnEvent" DataSetColumn="ID_CommnentOnEvent" />
<Mapping SourceColumn="TriggerTable" DataSetColumn="TriggerTable" />
<Mapping SourceColumn="TriggerField" DataSetColumn="TriggerField" />
<Mapping SourceColumn="TriggerStatus" DataSetColumn="TriggerStatus" />
<Mapping SourceColumn="Comment_FR" DataSetColumn="Comment_FR" />
<Mapping SourceColumn="Comment_NL" DataSetColumn="Comment_NL" />
<Mapping SourceColumn="Comment_EN" DataSetColumn="Comment_EN" />
</Mappings>
<Sources />
</TableAdapter>
</Tables>
<Sources />
</DataSource>
@ -83,7 +174,7 @@
<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_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: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: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" />
@ -113,7 +204,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<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: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: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" />
@ -175,6 +266,49 @@
</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: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" />
<xs:element name="TriggerTable" msprop:Generator_ColumnVarNameInTable="columnTriggerTable" msprop:Generator_ColumnPropNameInRow="TriggerTable" msprop:Generator_ColumnPropNameInTable="TriggerTableColumn" msprop:Generator_UserColumnName="TriggerTable" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TriggerField" msprop:Generator_ColumnVarNameInTable="columnTriggerField" msprop:Generator_ColumnPropNameInRow="TriggerField" msprop:Generator_ColumnPropNameInTable="TriggerFieldColumn" msprop:Generator_UserColumnName="TriggerField" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TriggerStatus" msprop:Generator_ColumnVarNameInTable="columnTriggerStatus" msprop:Generator_ColumnPropNameInRow="TriggerStatus" msprop:Generator_ColumnPropNameInTable="TriggerStatusColumn" msprop:Generator_UserColumnName="TriggerStatus" type="xs:boolean" minOccurs="0" />
<xs:element name="Comment_FR" msprop:Generator_ColumnVarNameInTable="columnComment_FR" msprop:Generator_ColumnPropNameInRow="Comment_FR" msprop:Generator_ColumnPropNameInTable="Comment_FRColumn" msprop:Generator_UserColumnName="Comment_FR" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5000" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Comment_NL" msprop:Generator_ColumnVarNameInTable="columnComment_NL" msprop:Generator_ColumnPropNameInRow="Comment_NL" msprop:Generator_ColumnPropNameInTable="Comment_NLColumn" msprop:Generator_UserColumnName="Comment_NL" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5000" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Comment_EN" msprop:Generator_ColumnVarNameInTable="columnComment_EN" msprop:Generator_ColumnPropNameInRow="Comment_EN" msprop:Generator_ColumnPropNameInTable="Comment_ENColumn" msprop:Generator_UserColumnName="Comment_EN" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5000" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
@ -185,5 +319,9 @@
<xs:selector xpath=".//mstns:GetTaskInfo" />
<xs:field xpath="mstns:ID_Task" />
</xs:unique>
<xs:unique name="CommentOnEvent_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:CommentOnEvent" />
<xs:field xpath="mstns:ID_CommnentOnEvent" />
</xs:unique>
</xs:element>
</xs:schema>

View file

@ -34,6 +34,30 @@
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Name="tbUser" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
<Border Background="AliceBlue" TextBlock.FontSize="20" Padding="20,20,20,20" >
<StackPanel HorizontalAlignment="Center" >
<TextBlock Name="Username" Text="" TextAlignment="Center" Margin="0,20,0,20" HorizontalAlignment="Stretch"/>
<TextBlock Name="UserAccess" Text="Welcome to eDOS" TextAlignment="Center" MaxWidth="600" TextWrapping="Wrap" HorizontalAlignment="Stretch" />
</StackPanel>
</Border>
<Border Name="boxComment" Background="AliceBlue" TextBlock.FontSize="15" Padding="20,20,20,20" >
<StackPanel HorizontalAlignment="Center" >
<TextBlock Text="Comment" />
<TextBlock x:Name="UserComment" />
</StackPanel>
</Border>
<ProgressBar x:Name="pUserSeconds" Background="Blue" Value="5" Maximum="10" Tag="AA" >
<ProgressBar.Effect>
<DropShadowEffect/>
</ProgressBar.Effect>
</ProgressBar>
<TextBlock x:Name="tUserSeconds" Text="10" TextAlignment="Center" HorizontalAlignment="Stretch" />
</StackPanel>
</TabItem>
<TabItem Name="tbTask">
<Grid DataContext="{Binding Mode=OneWay, Source={StaticResource getTaskListViewSource}}" >
<Grid.RowDefinitions>

View file

@ -29,7 +29,7 @@ namespace eDosStation
EpdBaseClr.Epd2 ep;
bool EpdFound = false;
DispatcherTimer dispatcherTimer;
int Search;
int Search, UserSeconds;
Boolean Inst1 = false, Inst2 = false;
public static OkReadBadge.Badging a;
@ -41,7 +41,9 @@ namespace eDosStation
string csn, site, code;
static User _User;
DataSet1.CommentOnEventDataTable dtCOE;
DataSet1.GetTaskInfoRow CurTaskRow;
enum eCOE { quiz=1} ;
private bool StopReadBadge=true;
public EntryBadge(EpdBaseClr.Epd2 curEP, Station curStation)
{
@ -102,12 +104,12 @@ namespace eDosStation
Search--;
if (Search > 0)
{
statusEPD.Text = $"Search {Search} ({ep.ConnectError})";
statusEPD.Text = $"Searching EPD ... {Search} ({ep.ConnectError})";
dispatcherTimer.Start();
}
else
{
statusEPD.Text = $"Search Timeout";
statusEPD.Text = $"No EPD found";
}
}
}
@ -245,20 +247,75 @@ namespace eDosStation
}
getTaskListViewSource.View.MoveCurrentToFirst();
}
void AskTask()
public string getCommentOnEvent(string prefix, int id)
{
string res=string.Empty;
if (!string.IsNullOrWhiteSpace(prefix)) res = prefix + "\n";
DataSet1.CommentOnEventRow r = dtCOE.FindByID_CommnentOnEvent(id);
string l = _User?.Language ?? "E";
if (r!=null)
switch (l)
{
case "N": res += r.Comment_NL; break;
case "F": res += r.Comment_FR; break;
default: res += r.Comment_EN; break;
}
return res.Replace("\\n","\n");
}
bool ShowUserInfo()
{
bool doCancel = false;
UserSeconds = 10;
//UserScreen
string ReasonNoAccess = string.Empty;
tbUser.IsSelected = true;
if (_User == null || _User.VisitIDLocked == true || _User.AccessAllow == false)
{
tbNotAllowed.IsSelected = true;
if (_User.VisitIDLocked == true || _User.AccessAllow == false) tReasonNoAccess.Text = _User.ReasonNoAccess;
else tReasonNoAccess.Text = "No identification";
//tbNotAllowed.IsSelected = true;
if (_User.VisitIDLocked == true || _User.AccessAllow == false)
ReasonNoAccess = _User.ReasonNoAccess;
else ReasonNoAccess = getCommentOnEvent(string.Empty, 3);
}
if (!string.IsNullOrEmpty(_User.UserComment))
{
UserComment.Text = _User.UserComment;
boxComment.Visibility = Visibility.Visible;
}
else
boxComment.Visibility = Visibility.Hidden;
if (!string.IsNullOrWhiteSpace(ReasonNoAccess)) UserAccess.Text = ReasonNoAccess;
else UserAccess.Text = "Welcome to eDOS";
Username.Text = string.Concat(_User.FirstName, " ", _User.LastName);
pUserSeconds.Maximum = UserSeconds; pUserSeconds.Value = UserSeconds;
tReasonNoAccess.Text = ReasonNoAccess;
dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal);
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
dispatcherTimer.Tick += SwitchToTask;
dispatcherTimer.Start();
return doCancel;
}
private void SwitchToTask(object sender, EventArgs e)
{
if (--UserSeconds > 0)
{
tUserSeconds.Text = UserSeconds.ToString();
pUserSeconds.Value = UserSeconds;
}
else
{
if (!string.IsNullOrEmpty(_User.UserComment))
{
MessageBox.Show(_User.UserComment, "Comment", MessageBoxButton.OK, MessageBoxImage.Asterisk);
dispatcherTimer.Stop();
dispatcherTimer.Tick -= SwitchToTask;
AskTask();
}
}
void AskTask()
{
eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1")));
using (var dataSet1GetTaskInfoTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskInfoTableAdapter())
{
@ -268,21 +325,10 @@ namespace eDosStation
bool isAlara = (cbAlara.IsChecked == true);
SetFilter(isAlara);
}
}
void CheckBadge()
{
_User = new User(CSN.Text, Code.Text);
if (_User.Error == 0)
{
Naam.Text = string.Concat(_User.FirstName, " ", _User.LastName);
AskTask();
}
else
{
MessageBox.Show(_User.ErrorMessage);
Close();
}
ShowUserInfo(); //AskTask();
}
public void showBadge()
{
@ -493,6 +539,10 @@ namespace eDosStation
cbInst2.IsChecked = Inst2;
}
dtCOE = new DataSet1.CommentOnEventDataTable();
using (var dt = new DataSet1TableAdapters.CommentOnEventTableAdapter())
dt.Fill(dtCOE);
string TestCSN = thisStation.TestCSN;
initialising = false;
@ -509,7 +559,7 @@ namespace eDosStation
{
MessageBox.Show(_User.ErrorMessage, "DB Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
} else {
Dispatcher.InvokeAsync(AskTask);
Dispatcher.InvokeAsync(ShowUserInfo); //AskTask
}
}
}

View file

@ -20,15 +20,20 @@
</StatusBar>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<telerik:RadButton Grid.Row="0" Grid.Column="0" Content="Entry" Name="bEntry" Click="BEntry_Click" Margin="10,10,10,10" CornerRadius="15" />
<telerik:RadButton Grid.Row="1" Grid.Column="0" Content="Exit" Name="bExit" Click="BExit_Click" Margin="10,10,10,10" CornerRadius="15"/>
<telerik:RadButton Grid.Row="2" Grid.Column="0" Content="Show EPD Dosis" Click="Button_Click" Margin="10,10,10,10" CornerRadius="15"/>
<Border Name="ibComment" Grid.Row="0" Background="Bisque">
<TextBlock Name="itComment" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="15" Margin="10,10,10,10">
</TextBlock>
</Border>
<telerik:RadButton Grid.Row="1" Grid.Column="0" Content="Entry" Name="bEntry" Click="BEntry_Click" Margin="10,10,10,10" CornerRadius="15" />
<telerik:RadButton Grid.Row="2" Grid.Column="0" Content="Exit" Name="bExit" Click="BExit_Click" Margin="10,10,10,10" CornerRadius="15"/>
<telerik:RadButton Grid.Row="3" Grid.Column="0" Content="Show EPD Dosis" Click="Button_Click" Margin="10,10,10,10" CornerRadius="15"/>
</Grid>
</DockPanel>

View file

@ -57,6 +57,13 @@ 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);
}
}

View file

@ -4,6 +4,8 @@ using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Documents;
namespace eDosStation
{
@ -19,6 +21,8 @@ namespace eDosStation
public bool Changed = false;
public int Error = 0;
public string ErrorMessage;
public StringBuilder insComments;
public TextBlock tbComments;
public Station(string Station)
{
@ -27,13 +31,18 @@ namespace eDosStation
Inst_CODE2 = 11;
Inst_Name1 = "BR1"; Inst_Name2 = "Venus";
TestCSN = "0428790A0B4E80";
insComments = new StringBuilder();
tbComments = new TextBlock();
tbComments.FontSize = 15;
tbComments.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
tbComments.TextAlignment = System.Windows.TextAlignment.Center;
using (var co = new SqlConnection(Properties.Settings.Default.RemoteSQL))
{
co.Open();
using (var cmd = new SqlCommand("StationSettingsSelect", co))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
co.Open();
try
{
var rs = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow);
@ -63,8 +72,44 @@ namespace eDosStation
Error = 1;
ErrorMessage = ex.Message;
}
co.Close();
}
using (var cmd2 = new SqlCommand("GetInstallationsComments", co))
{
cmd2.CommandType = System.Data.CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@Inst_CODE1", Inst_CODE1);
if (Inst_CODE2 > 0) cmd2.Parameters.AddWithValue("@Inst_CODE2", Inst_CODE2);
try
{
var rs = cmd2.ExecuteReader(System.Data.CommandBehavior.SingleResult);
string curins = string.Empty, thisins= string.Empty, thiscomment = string.Empty;
if (rs.HasRows )
while (rs.Read())
{
thisins = rs.GetString(2);
thiscomment = rs.GetString(3).Replace("\\n", "\n");
if (curins.CompareTo(thisins) !=0)
{
if (curins != string.Empty) tbComments.Inlines.Add(new LineBreak());
tbComments.Inlines.Add(new Bold(new Run($"Installation {thisins}:\n") { FontSize=20 }));
insComments.AppendLine($"Installation {thisins}");
curins = thisins;
}
tbComments.Inlines.Add( new Run(thiscomment) );
}
rs.Close();
}
catch (System.Exception ex)
{
Error = 2;
ErrorMessage = ex.Message;
}
}
co.Close();
}
}