Пример #1
0
        public void UpdatechipRecord(string id, string fieldName, string value, Guid userId)
        {
            chip oldTcData = new chip();

            var queryTcUpdate = Sql.Builder
                .Append("UPDATE [ProvisioningRecords].[dbo].[chips]")
                .Append("SET " + fieldName + "='" + value + "'")
            .Append("WHERE chipId ='" + id + "'");

            var queryTcChangeLogUpdate = Sql.Builder
                .Append("SELECT * FROM [ProvisioningRecords].[dbo].[chips]")
            .Append("WHERE chipId ='" + id + "'");

            oldTcData = _database.FirstOrDefault<chip>(queryTcChangeLogUpdate);

            _database.Execute(queryTcUpdate);
            CreateTcHistoryRecord(id, userId, fieldName, oldTcData.Description, value);
        }
Пример #2
0
        public chip Getchip(int chipId)
        {
            chip chip = new chip();

            var query = Sql.Builder
                .Append("SELECT *")
                .Append("FROM [ProvisioningRecords].[dbo].[chips]")
                .Append("WHERE [ProvisioningRecords].[dbo].[chips].[chipId] = '" + chipId + "'");

            chip = _database.FirstOrDefault<chip>(query);

            return chip;
        }