public string CreateCompany(CompanyModel company)
        {
            //Insert Company properties into CreateCompany template
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load("Templates\\CreateCompany.xml");

            XmlElement info = (XmlElement)xmlDoc.SelectSingleNode("//CompanyInfo");
            if (info != null)
            {
                info.SetAttribute("Email", company.Email);
                info.SetAttribute("Website", string.Empty);
                info.SetAttribute("Fax", company.Fax);
                info.SetAttribute("Extension", string.Empty);
                info.SetAttribute("Phone", company.Phone);
                info.SetAttribute("CountryCode", company.Country);
                info.SetAttribute("Zip", company.Zip.ToString());
                info.SetAttribute("State", company.State);
                info.SetAttribute("City", company.City);
                info.SetAttribute("Add2", company.Address2);
                info.SetAttribute("Add1", company.Address1);
                info.SetAttribute("CompanyName", company.CompanyName);
            }

            XmlElement types = (XmlElement)xmlDoc.SelectSingleNode("//CompanyTypes");
            if (types != null)
            {
                if (company.Demo)
                {
                    XmlElement element = (XmlElement)xmlDoc.CreateNode("element", "CompanyType", "");
                    element.SetAttribute("Type", Convert.ToInt32(company.Demo).ToString());
                    types.AppendChild(element);
                }
                foreach (int id in company.CompanyTypes)
                {
                    XmlElement element = (XmlElement)xmlDoc.CreateNode("element", "CompanyType", "");
                    element.SetAttribute("Type", id.ToString());
                    types.AppendChild(element);
                }
            }

            StringWriter stringWriter = new StringWriter();
            XmlTextWriter xmltextWriter = new XmlTextWriter(stringWriter);
            xmlDoc.WriteTo(xmltextWriter);
            string xmlString = stringWriter.ToString();

            return CompanyResponse(repo.SendXml(xmlString, company.EnvironmentLevel));
        }
        public IActionResult CreateCompany(CompanyModel company)
        {
            if(ModelState.IsValid)
            {
                var data = _legacyHelper.CreateCompany(company);

                return Ok(data);
            }
            else
            {
                // PrepareAxpRevamp();
                CompanyViewModel viewModel = new CompanyViewModel();
                viewModel.Company = company;
                viewModel.CompanyTypes = _legacyHelper.GetCompanyData();
                viewModel.Countries = GetCountries();
                viewModel.States = _legacyHelper.GetStates();
                ViewBag.EnvironmentLevels = GetEnvironmentLevels();
                return PartialView("_Company", viewModel);
            }
        }