execute() public method

public execute ( ) : string
return string
Esempio n. 1
0
        public void delete(String recordIen, String vistaFile)
        {
            DdrFiler request  = buildDeleteRequest(recordIen, vistaFile);
            String   response = request.execute();

            toCreateUpdateDeleteRecordResponse(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new record entry in a Vista file
        /// </summary>
        /// <param name="fieldsAndValues">The field number and value dictionary</param>
        /// <param name="vistaFile">The Vista file number</param>
        /// <param name="iens">If creating a record in a subfile, the IENS string of the parent record</param>
        /// <returns>The IEN of the new record</returns>
        public CrudOperation create(Dictionary <String, String> fieldsAndValues, String vistaFile, String iens = null)
        {
            Dictionary <String, String> wpFieldsAndValues = findWpFields(fieldsAndValues);
            DdrFiler request      = buildCreateRequest(fieldsAndValues, vistaFile, iens);
            DateTime startRequest = DateTime.Now;
            String   response     = request.execute();
            DateTime endRequest   = DateTime.Now;
            String   parsed       = toCreateUpdateDeleteRecordResponse(response);

            // if we get this far, create succeeded! to make the API easier to use, enable user to pass WP fields in dictionary
            foreach (String key in wpFieldsAndValues.Keys)
            {
                addWordProcessing(vistaFile, key, String.Concat(parsed, ",", iens), wpFieldsAndValues[key]);
            }

            //return result;
            CrudOperation result = new CrudOperation()
            {
                RPC = new RPC()
                {
                    Name           = request.buildRequest().RpcName,
                    RequestString  = request.buildRequest().buildMessage(),
                    ResponseString = response,
                    RequestTime    = startRequest,
                    ResponseTime   = endRequest
                },
                Result = parsed,
                Type   = CrudOperationType.CREATE
            };

            return(result);
        }
Esempio n. 3
0
        public string deleteRecord(AbstractConnection cxn, string ien, string parentIen)
        {
            DdrFiler query    = buildRemoveSubrecordQuery(cxn, ien, parentIen);
            string   response = query.execute();

            return(response);
        }
Esempio n. 4
0
        public static string addRecord(AbstractConnection cxn, RemoteApplicationRecord rec, CallBackFileRecord subrec)
        {
            DdrFiler query    = buildAddRecordQuery(cxn, rec, subrec);
            string   response = query.execute();

            return(response);
        }
Esempio n. 5
0
        public static string deleteRecord(AbstractConnection cxn, string ien)
        {
            CallBackFile callBackFile = new CallBackFile();
            string       result       = callBackFile.deleteRecord(cxn, "1", ien);
            DdrFiler     query        = buildDeleteRecordQuery(cxn, ien);

            result = query.execute();
            return(result);
        }
Esempio n. 6
0
        /// <summary>
        /// Create a new record entry in a Vista file
        /// </summary>
        /// <param name="fieldsAndValues">The field number and value dictionary</param>
        /// <param name="vistaFile">The Vista file number</param>
        /// <param name="iens">If creating a record in a subfile, the IENS string of the parent record</param>
        /// <returns>The IEN of the new record</returns>
        public String create(Dictionary <String, String> fieldsAndValues, String vistaFile, String iens = null)
        {
            Dictionary <String, String> wpFieldsAndValues = findWpFields(fieldsAndValues);
            DdrFiler request  = buildCreateRequest(fieldsAndValues, vistaFile, iens);
            String   response = request.execute();
            String   result   = toCreateUpdateDeleteRecordResponse(response);

            // if we get this far, create succeeded! to make the API easier to use, enable user to pass WP fields in dictionary
            foreach (String key in wpFieldsAndValues.Keys)
            {
                addWordProcessing(vistaFile, key, String.Concat(result, ",", iens), wpFieldsAndValues[key]);
            }
            return(result);
        }
Esempio n. 7
0
        public void update(Dictionary <String, String> fieldsAndValues, String ien, String vistaFile)
        {
            Dictionary <String, String> wpFieldsAndValues = findWpFields(fieldsAndValues);

            if (fieldsAndValues.Count > 0) // need to check this in case we were only updating WP fields
            {
                DdrFiler request  = buildUpdateRequest(fieldsAndValues, ien, vistaFile);
                String   response = request.execute();
                toCreateUpdateDeleteRecordResponse(response); // should throw exception on failure
            }
            // if we get this far, create succeeded! to make the API easier to use, enable user to pass WP fields in dictionary
            foreach (String key in wpFieldsAndValues.Keys)
            {
                addWordProcessing(vistaFile, key, ien, wpFieldsAndValues[key]);
                fieldsAndValues.Add(key, wpFieldsAndValues[key]); // want to add this back to original dict so that we don't permanently change it's state
            }
        }
Esempio n. 8
0
        public CrudOperation update(Dictionary <String, String> fieldsAndValues, String ien, String vistaFile)
        {
            CrudOperation result = null;

            Dictionary <String, String> wpFieldsAndValues = findWpFields(fieldsAndValues);

            if (fieldsAndValues.Count > 0) // need to check this in case we were only updating WP fields
            {
                DdrFiler request      = buildUpdateRequest(fieldsAndValues, ien, vistaFile);
                DateTime startRequest = DateTime.Now;
                String   response     = request.execute();
                DateTime endRequest   = DateTime.Now;
                String   parsed       = toCreateUpdateDeleteRecordResponse(response); // should throw exception on failure

                result = new CrudOperation()
                {
                    RPC = new RPC()
                    {
                        Name           = request.buildRequest().RpcName,
                        RequestString  = request.buildRequest().buildMessage(),
                        ResponseString = response,
                        RequestTime    = startRequest,
                        ResponseTime   = endRequest
                    },
                    Result = parsed,
                    Type   = CrudOperationType.UPDATE
                };
            }
            // if we get this far, create succeeded! to make the API easier to use, enable user to pass WP fields in dictionary
            foreach (String key in wpFieldsAndValues.Keys)
            {
                addWordProcessing(vistaFile, key, ien, wpFieldsAndValues[key]);
                fieldsAndValues.Add(key, wpFieldsAndValues[key]); // want to add this back to original dict so that we don't permanently change it's state
            }


            return(result);
        }
Esempio n. 9
0
        public CrudOperation delete(String recordIen, String vistaFile)
        {
            DdrFiler request      = buildDeleteRequest(recordIen, vistaFile);
            DateTime startRequest = DateTime.Now;
            String   response     = request.execute();
            DateTime endRequest   = DateTime.Now;
            String   parsed       = toCreateUpdateDeleteRecordResponse(response);

            CrudOperation result = new CrudOperation()
            {
                RPC = new RPC()
                {
                    Name           = request.buildRequest().RpcName,
                    RequestString  = request.buildRequest().buildMessage(),
                    ResponseString = response,
                    RequestTime    = startRequest,
                    ResponseTime   = endRequest
                },
                Result = parsed,
                Type   = CrudOperationType.DELETE
            };

            return(result);
        }