Beispiel #1
0
        /// <summary>
        ///     Get the details of an organization.
        /// </summary>
        /// <param name="organization_id">The organization_id is the identifier of the organization.</param>
        /// <returns>Organization object.</returns>
        public Organization Get(string organization_id)
        {
            var url      = baseAddress + "/" + organization_id;
            var responce = ZohoHttpClient.get(url, getQueryParameters());

            return(OrganizationParser.getOrganization(responce));
        }
Beispiel #2
0
        /// <summary>
        ///     Get the list of organizations.
        /// </summary>
        /// <returns>List of Organization objects.</returns>
        public OrganizationList GetOrganizations()
        {
            var url      = baseAddress;
            var response = ZohoHttpClient.get(url, getQueryParameters());

            return(OrganizationParser.getOrganizationList(response));
        }
Beispiel #3
0
        /// <summary>
        ///     Update the details of an organization.
        /// </summary>
        /// <param name="organization_id">The organization_id is the identifier of the organization.</param>
        /// <param name="update_info">The update_info is the Organization object which contains the updation information.</param>
        /// <returns>Organization object.</returns>
        public Organization Upadte(string organization_id, Organization update_info)
        {
            var url        = baseAddress + "/" + organization_id;
            var json       = JsonConvert.SerializeObject(update_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.put(url, getQueryParameters(jsonstring));

            return(OrganizationParser.getOrganization(responce));
        }
Beispiel #4
0
        /// <summary>
        ///     Adds the organization address.
        /// </summary>
        /// <param name="address_info">The address_info.</param>
        /// <returns>Address.</returns>
        public Address AddOrganizationAddress(Address address_info)
        {
            var url        = baseAddress + "/address";
            var json       = JsonConvert.SerializeObject(address_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            return(OrganizationParser.getOrganizationAddress(responce));
        }
Beispiel #5
0
        /// <summary>
        ///     Create an organization.
        /// </summary>
        /// <param name="oranization_info">
        ///     The oranization_info is the Organization object with name,currency_code and time_zone as
        ///     mandatory attributes.
        /// </param>
        /// <returns>Organization object.</returns>
        public Organization Create(Organization oranization_info)
        {
            var url        = baseAddress;
            var json       = JsonConvert.SerializeObject(oranization_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            Console.WriteLine(responce.Content.ReadAsStringAsync().Result);
            return(OrganizationParser.getOrganization(responce));
        }
        public void ShallReturnOrganization()
        {
            var xml     = XDocument.Load("C-CDA_R2-1_CCD.xml");
            var element = xml.Root.CdaElement("recordTarget")?.CdaElement("patientRole")?.CdaElement("providerOrganization");

            var result = new OrganizationParser().FromXml(element);

            result.Should().NotBeNull();
            // Shall have id
            result.Id.Should().NotBeNullOrEmpty();
            // US-Core Shall have identifier
            result.Identifier.Count.Should().BeGreaterThan(0);
            result.Identifier.All(i => !string.IsNullOrEmpty(i.System)).Should().BeTrue();
            // US-Core Shall have name
            result.Name.Should().NotBeNullOrEmpty();
            // US-Core Shall have telcom
            result.Telecom.Count.Should().BeGreaterThan(0);
            // US-Core Shall have address
            result.Address.Count.Should().BeGreaterThan(0);
        }
        public void NullElementShallReturnNull()
        {
            var result = new OrganizationParser().FromXml(null);

            result.Should().BeNull();
        }