Exemplo n.º 1
0
        /// <summary>
        /// Gets the history for the record
        /// </summary>
        /// <param name="id">The unique identifier.</param>
        /// <returns></returns>
        public AmplaAuditRecord GetHistory(int id)
        {
            IAmplaViewProperties <TModel> amplaViewProperties = GetViewProperties(null);

            amplaViewProperties.Enforce.CanView();

            FilterValue     idFilter      = new FilterValue("Id", Convert.ToString(id));
            FilterValue     deletedFilter = new FilterValue("Deleted", "");
            GetDataRequest  dataRequest   = GetDataRequest(false, idFilter, deletedFilter);
            GetDataResponse dataResponse  = webServiceClient.GetData(dataRequest);
            TModel          model;
            AmplaRecord     amplaRecord = FindAmplaRecord(dataResponse, ModelProperties, amplaViewProperties, out model);

            if (amplaRecord != null)
            {
                var request = GetAuditDataRequest(amplaRecord);
                GetAuditDataResponse    response     = webServiceClient.GetAuditData(request);
                List <AmplaAuditRecord> auditRecords = new List <AmplaAuditRecord>();
                IAmplaBinding           binding      = new AmplaGetAuditDataRecordBinding <TModel>(response, amplaRecord, auditRecords, modelProperties);
                if (binding.Validate() && binding.Bind())
                {
                    return(auditRecords.Count > 0 ? auditRecords[0] : null);
                }
            }
            return(null);
        }
Exemplo n.º 2
0
 public GetAuditDataResponse GetAuditData(GetAuditDataRequest request)
 {
     logger.Log("GetAuditData ({0})", request);
     return(implementation.GetAuditData(request));
 }