예제 #1
0
 /// <summary>
 /// Updates the record status.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <returns></returns>
 public UpdateRecordStatusResponse UpdateRecordStatus(UpdateRecordStatusRequest request)
 {
     return(TryCatchThrowFault(() =>
     {
         List <UpdateRecordStatusResult> results = new List <UpdateRecordStatusResult>();
         CheckCredentials(request.Credentials);
         foreach (UpdateRecordStatus recordStatus in request.UpdateRecords)
         {
             string module = recordStatus.Module.ToString();
             Dictionary <int, InMemoryRecord> database = amplaDatabase.GetModuleRecords(module);
             CheckReportingPoint(module, recordStatus.Location);
             int recordId = (int)recordStatus.MergeCriteria.SetId;
             InMemoryRecord record = FindRecord(database, recordStatus.Location, recordStatus.Module, recordId);
             FieldValue confirmed = record.Find("Confirmed");
             if (confirmed != null)
             {
                 record.Fields.Remove(confirmed);
             }
             string value = recordStatus.RecordAction == UpdateRecordStatusAction.Confirm ? "True" : "False";
             record.Fields.Add(new FieldValue("Confirmed", value));
             results.Add(new UpdateRecordStatusResult
             {
                 Location = recordStatus.Location,
                 Module = recordStatus.Module,
                 RecordAction = recordStatus.RecordAction,
                 SetId = recordId
             });
         }
         return new UpdateRecordStatusResponse {
             UpdateRecordStatusResults = results.ToArray()
         };
     }));
 }
예제 #2
0
        /// <summary>
        /// Unconfirms the specified model.
        /// </summary>
        /// <param name="model">The model.</param>
        public void Unconfirm(TModel model)
        {
            IAmplaViewProperties <TModel> amplaViewProperties = GetViewProperties(model);

            amplaViewProperties.Enforce.CanUnconfirm();

            UpdateRecordStatusRequest request = new UpdateRecordStatusRequest {
                Credentials = CreateCredentials()
            };
            List <UpdateRecordStatus> records = new List <UpdateRecordStatus>();
            List <TModel>             models  = new List <TModel> {
                model
            };

            IAmplaBinding binding = new AmplaUnconfirmDataBinding <TModel>(models, records, ModelProperties);

            if (binding.Validate() && binding.Bind())
            {
                request.UpdateRecords = records.ToArray();
                WebServiceClient.UpdateRecordStatus(request);
            }
        }
예제 #3
0
 public UpdateRecordStatusResponse UpdateRecordStatus(UpdateRecordStatusRequest request)
 {
     return(Create().UpdateRecordStatus(request));
 }
예제 #4
0
 public UpdateRecordStatusResponse UpdateRecordStatus(UpdateRecordStatusRequest request)
 {
     logger.Log("UpdateRecordStatus ({0})", request);
     return(implementation.UpdateRecordStatus(request));
 }