コード例 #1
0
        public JsonResult getspecificvendors(string compid, string branchid)
        {
            List <SelectListItem> vendors = new List <SelectListItem>();
            int ID       = Convert.ToInt32(compid);
            int branchID = Convert.ToInt32(branchid);

            VendorService.VendorServiceClient    vendorServiceClient       = new VendorService.VendorServiceClient();
            OrgService.OrganizationServiceClient organizationServiceClient = new OrgService.OrganizationServiceClient();
            string  xmldata = organizationServiceClient.getSpecificVendorListDropDown(ID, branchID);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            vendors = new List <SelectListItem>();
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    vendors.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }
            return(Json(vendors, JsonRequestBehavior.AllowGet));
        }