Files
2026-04-17 14:55:32 -04:00

2.4 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/DASFactoryDb/DAS/DAS.cs
2026-04-17T16:13:50.698481+00:00 zai-org/GLM-5-FP8 1 02b33d07988ee1e0

DAS

Purpose

This module provides data access layer functionality for DAS (Data Acquisition System) communication records. It exists to insert new DAS device records into the factory database, capturing device identification (serial number), firmware version, and connection metadata through a stored procedure interface.

Public Interface

DAS.InsertDASSimple(string serialNumber, string firmwareVersion, string connectString)int

  • Inserts a new record into the DAS communication table via the sp_IDASCommunicationTableSimpleInsert stored procedure.
  • Parameters:
    • serialNumber (string): Device serial number, passed as NVarChar(50)
    • firmwareVersion (string): Firmware version string, passed as NVarChar(50)
    • connectString (string): Connection string, passed as NVarChar(255)
  • Returns the newly created record ID from the @new_id output parameter.
  • Throws or propagates errors via DbWrapper.ProcessReturn() if the stored procedure sets @errorNumber.

Invariants

  • The stored procedure sp_IDASCommunicationTableSimpleInsert must exist in the target database.
  • DbWrapper.GetDASFactoryCommand() must return a valid, executable command object with an open connection.
  • The returned new_id will be a valid integer upon successful insertion.

Dependencies

  • Depends on: DbWrapper (static class providing GetDASFactoryCommand() and ProcessReturn(SqlParameter, SqlParameter) methods) - inferred from usage but not shown in source.
  • Depends on: System.Data, System.Data.SqlClient for ADO.NET infrastructure.
  • Consumers: Unknown from source alone - likely factory calibration or device registration workflows.

Gotchas

  • Parameter naming inconsistency: The connectString parameter is added as "ConnectString" (camelCase vs PascalCase) - this may cause issues if the stored procedure is case-sensitive.
  • Connection disposal pattern: The cmd.Connection.Dispose() is called in a finally block, but the using statement wrapping cmd would typically handle command disposal. This suggests the connection lifecycle is managed separately from the command.
  • No null validation: The method does not validate input parameters before passing to the stored procedure.