public async Task <ActionResult> FindBusinesses(SearchTerms searchTerms) { if (!ModelState.IsValid) { return(RedirectToAction("TryAgain")); } FindBusinessService businessService = new FindBusinessService(); var url = businessService.CreateFindBuisnessUrl(searchTerms); List <Business> rawBusinessResultsList = await businessService.CreateBuisnessListFromApi(url); BusinessList newBusinessList = new BusinessList(); var validBusinessList = await newBusinessList.ReturnValidBusinessList(searchTerms, rawBusinessResultsList); if (validBusinessList == null) { return(RedirectToAction("TryAgain")); } var sortList = new Sorting(); var sortedBusinessList = sortList.SortList(validBusinessList, searchTerms); if (sortedBusinessList == null) { return(RedirectToAction("TryAgain")); } List <string> businessListTopThree = businessService.GetTopThreeFromSortedList(sortedBusinessList); _cache.Set("idList", businessListTopThree, _policy); _cache.Set("sortedBusinessList", sortedBusinessList, _policy); return(RedirectToAction("Reviews")); }
protected void SearchResID_Click(object sender, EventArgs e) { string city = SelectState.SelectedItem.Value; string searchbar = SearchBox.Text; if (searchbar != "" && city != "0") { BusinessList.DataSource = fdp.getBusinessList(city, searchbar); BusinessList.DataBind(); } else if (searchbar == "" && city != "0") { BusinessList.DataSource = fdp.getBusinessList(city); BusinessList.DataBind(); } else if (city == "0" && searchbar != "") { BusinessList.DataSource = fdp.getBusinessListbycity(searchbar); BusinessList.DataBind(); } if (Panel2.Visible == false) { Panel2.Visible = true; } }
public async Task <IActionResult> Edit(int id, [Bind("Id,BusinessName,Time,Status,Explanation,TaskExplanation,StartDate,EndDate,CreatorPersonel,CreationDate,PersonelId,Deleted,CustomerId,ProjectDescriptionId,BusinessPriority,StatusId,IsApproved,LastDateStudied")] BusinessList businessList) { if (id != businessList.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(businessList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessListExists(businessList.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(businessList)); }
protected override void OnSearch(object sender, string query) { if (null == query) { return; } query = query.Trim(); if (0 == query.Length) { return; } base.OnSearch(sender, query); if (query.IndexOf("%") < 0) { query += "%"; } FindBusiness find = new FindBusiness(); find.Names.Add(null, query); BusinessList list = find.Find(); grid.DataSource = list.BusinessInfos; grid.DataBind(); count.Text = String.Format( Localization.GetString("TEXT_QUERY_COUNT"), list.BusinessInfos.Count); }
public static string GetServiceLocation() { Console.WriteLine("Querying UDDI Registry..."); //Assign the network endpoint of UDDI Web services Inquire.Url = "http://test.uddi.microsoft.com/inquire"; //Find the provider FindBusiness findProvider = new FindBusiness(); findProvider.Names.Add("Vendor A"); BusinessList providerList = findProvider.Send(); BusinessInfo provider = providerList.BusinessInfos[0]; ServiceInfo providerService = provider.ServiceInfos[0]; //Find the Service details GetServiceDetail findService = new GetServiceDetail(); findService.ServiceKeys.Add(providerService.ServiceKey); ServiceDetail sd = findService.Send(); BusinessService service = sd.BusinessServices[0]; BindingTemplate template = service.BindingTemplates[0]; //Retrieve the service URL Console.WriteLine("Provider Endpoint : " + template.AccessPoint.Text); return(template.AccessPoint.Text); }
protected void populateLstBoxBusinessUnitName(int code, string str) { Database dbObj = new Database(HyperCatalog.Business.ApplicationSettings.Components["Datawarehouse_DB"].ConnectionString); if (str.Equals("First")) { BusinessList.DataSource = dbObj.RunSPReturnDataSet("dbo._GetAllBusinessNames", new SqlParameter[] { new SqlParameter("@Code", code) }); BusinessList.DataValueField = "Code"; BusinessList.DataTextField = "BizName"; BusinessList.DataBind(); BusinessList.Items.Insert(0, "All"); BusinessList.SelectedIndex = 0; BusinessList.Visible = true; } if (str.Equals("Second")) { BusinessList1.DataSource = dbObj.RunSPReturnDataSet("dbo._GetAllBusinessNames", new SqlParameter[] { new SqlParameter("@Code", code) }); BusinessList1.DataValueField = "Code"; BusinessList1.DataTextField = "BizName"; BusinessList1.DataBind(); BusinessList1.Items.Insert(0, "All"); BusinessList1.SelectedIndex = 0; BusinessList1.Visible = true; } }
//public BusinessList FindBusiness( FindBusiness fbus, [XmlAnyElement] XmlElement[] trash ) public BusinessList FindBusiness(FindBusiness fbus) { Debug.Enter(); BusinessList bl = null; try { bl = fbus.Find(); // // If this request came from a v1 message, filter out any service projections in our list of // businesses // if (1 == Context.ApiVersionMajor) { foreach (BusinessInfo businessInfo in bl.BusinessInfos) { businessInfo.ServiceInfos = FilterServiceProjections(businessInfo.ServiceInfos, businessInfo.BusinessKey); } } } catch (Exception e) { DispositionReport.Throw(e); } return(bl); }
public BusinessList getBusinessList(Business business) { BusinessList businessList = new BusinessList(); DataTable dt = businessDAL.getList(business); businessList.rows = dt.toList <Business>(); businessList.total = businessDAL.getCount(business); return(businessList); }
public ActionResult SearchPay(Business business) { business.page = int.Parse(Request["page"]); business.rows = int.Parse(Request["rows"]); BusinessBLL bll = new BusinessBLL(); BusinessList businessList = bll.getBusinessList(business); return(Json(businessList, JsonRequestBehavior.AllowGet)); }
public static BusinessList BusinessListWithTwoCompanies() { BusinessList instance = new BusinessList(); businesses = new List <Business>(); businesses.Add(new Business("1", "Business Name 1")); businesses.Add(new Business("2", "Business Name 2")); return(instance); }
public void DeleteBusiness(BusinessEntity newEntity) { BusinessEntity oldEntity = BusinessList.FirstOrDefault <BusinessEntity>(p => p.BusinessId == newEntity.BusinessId); if (oldEntity != null) { BusinessList.Remove(oldEntity); } BusinessList = new List <BusinessEntity>(_businessList); }
/// <summary> /// Gets the business key. /// </summary> /// <param name="UDDIConnection">The UDDI connection.</param> /// <param name="pName">Name of the provider.</param> /// <returns></returns> public static string GetBusinessKey(UddiConnection UDDIConnection, string pName) { FindBusiness findBusiness = new FindBusiness(pName); BusinessList bList = findBusiness.Send(UDDIConnection); if (bList.BusinessInfos.Count > 0) { return(bList.BusinessInfos[0].BusinessKey); } return(String.Empty); }
public async Task <IActionResult> Create([Bind("Id,BusinessName,Time,Status,Explanation,TaskExplanation,StartDate,EndDate,CreatorPersonel,CreationDate,PersonelId,Deleted,CustomerId,ProjectDescriptionId,BusinessPriority,StatusId,IsApproved,LastDateStudied")] BusinessList businessList) { if (ModelState.IsValid) { _context.Add(businessList); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(businessList)); }
public void Add() { var newEntity = new BusinessEntity() { Deleted = false, Description = "", BusinessId = -1 }; BusinessList.Add(newEntity); BusinessList = new List <BusinessEntity>(_businessList); }
/// <summary> /// Determines whether there is any service on the business or not. /// </summary> /// <param name="UDDIConnection">The UDDI connection.</param> /// <param name="pName">Name of the provider</param> /// <returns> /// <c>true</c> if [is service exists] [the specified UDDI connection]; otherwise, <c>false</c>. /// </returns> public static bool IsServiceExists(UddiConnection UDDIConnection, string pName) { FindBusiness findBusiness = new FindBusiness(pName); findBusiness.FindQualifiers.Add(FindQualifier.ApproximateMatch); BusinessList bList = findBusiness.Send(UDDIConnection); if (bList.BusinessInfos[0].ServiceInfos.Count > 0) { return(true); } return(false); }
/// <summary> /// Gets all MSE full path of the service from MSE web service. /// </summary> /// <returns></returns> /*public static string[] GetAllMSEServices() * { * MSEServiceCatalogue.ServiceModelClient serviceCatalogue = new MSEServiceCatalogue.ServiceModelClient("NetTcpBinding_ServiceModel"); * return serviceCatalogue.GetVirtualizedURLs("localRS"); * }*/ /// <summary> /// Gets all businesses. /// </summary> /// <param name="UDDIConnection">The UDDI connection.</param> /// <returns></returns> public static List <string> GetAllBusinesses(UddiConnection UDDIConnection) { List <string> retList = new List <string>(); FindBusiness findBusiness = new FindBusiness("%"); findBusiness.FindQualifiers.Add(FindQualifier.ApproximateMatch); BusinessList bList = findBusiness.Send(UDDIConnection); foreach (BusinessInfo bInfo in bList.BusinessInfos) { retList.Add(bInfo.Names[0].Text); } return(retList); }
protected void Buttons_Click(object sender, EventArgs e) { string city = SelectState.SelectedItem.Value; string searchbar = SearchBox.Text; LinkButton Button1 = (LinkButton)sender; BusinessList.DataSource = fdp.getBusinessListbyCategory(searchbar, city, Button1.CommandArgument.ToString()); BusinessList.DataBind(); catid = Button1.CommandArgument.ToString(); if (Panel2.Visible == false) { Panel2.Visible = true; } }
public void Reload() { System.Threading.ThreadPool.QueueUserWorkItem(delegate { try { ShowLoading(StringResources.captionInformation, StringResources.msgLoading); var _obusinessList = Factory.Resolve <IBaseDataDS>().SearchBusiness(new BusinessSearchEntity() { SearchText = "" }); var _oindustryList = Factory.Resolve <IBaseDataDS>().SearchIndustry(new IndustrySearchEntity() { SearchText = "" }); HideLoading(); //display to UI Application.Current.Dispatcher.Invoke(new Action(() => { BusinessEntity itbs = new BusinessEntity() { BusinessId = 0, Description = "" }; BusinessList = _obusinessList; BusinessList.Insert(0, itbs); SelectedBusiness = BusinessList.FirstOrDefault(); IndustryEntity itin = new IndustryEntity() { IndustryId = 0, Description = "" }; IndustryList = _oindustryList; IndustryList.Insert(0, itin); SelectedIndustry = IndustryList.FirstOrDefault(); })); } catch (Exception ex) { HideLoading(); ShowMessageBox(StringResources.captionError, ex.ToString(), MessageBoxButton.OK); } }); //ShowDialog<uvCompanyDetailViewModel>(new uvCompanyDetailViewModel() { // OriginalCompany = SelectCompany //}); }
private void Child_Create(BusinessList <IPollOption> options) { this.isLoading = true; try { foreach (var option in options) { this.Add(this.pollSubmissionResponseFactory.CreateChild(option)); } } finally { this.isLoading = false; } }
public void AddOrUpdateBusiness(BusinessEntity newEntity) { BusinessEntity oldEntity = BusinessList.FirstOrDefault <BusinessEntity>(p => p.Description == newEntity.Description); if (oldEntity == null) { BusinessList.Insert(0, newEntity); } else { int index = BusinessList.IndexOf(oldEntity); BusinessList.Remove(oldEntity); BusinessList.Insert(index, newEntity); } BusinessList = new List <BusinessEntity>(_businessList); }
public static BusinessList GetAll() { BusinessList returnModel = new BusinessList(); if (File.Exists(dataPath)) { using (var reader = new StreamReader(dataPath)) { XmlSerializer deserializer = new XmlSerializer(typeof(BusinessList), new XmlRootAttribute("Business_List")); returnModel = (BusinessList)deserializer.Deserialize(reader); } } else { SaveChanges(); } return(returnModel); }
private static BusinessList<IPollOption> CreateOptions() { var generator = new RandomObjectGenerator(); var optionId = generator.Generate<int>(); var optionPosition = generator.Generate<short>(); var optionText = generator.Generate<string>(); var option = new Mock<IPollOption>(MockBehavior.Loose); option.Setup(_ => _.IsChild).Returns(true); option.Setup(_ => _.PollOptionID).Returns(optionId); option.Setup(_ => _.OptionPosition).Returns(optionPosition); option.Setup(_ => _.OptionText).Returns(optionText); var options = new BusinessList<IPollOption>(); options.Add(option.Object); return options; }
protected void Page_Load(object sender, EventArgs e) { Database dbObj = new Database(HyperCatalog.Business.ApplicationSettings.Components["Datawarehouse_DB"].ConnectionString); if (!Page.IsPostBack) { DataSet ds1 = new DataSet(); this.code = 0; OrgName.Checked = true; populateLstBoxBusinessUnitName(code); ds1 = dbObj.RunSPReturnDataSet("dbo._GetAllBusinessNamesByAccessories", new SqlParameter[] { new SqlParameter("@Code", code) }); BUType.Text = "OrgName"; BUType.Visible = true; BusinessList.DataSource = ds1; if (this.code == 3) { BusinessList.DataValueField = "Code"; BusinessList.DataTextField = "Code"; } else { BusinessList.DataValueField = "Code"; BusinessList.DataTextField = "BizName"; } BusinessList.DataBind(); BusinessList.Items.Insert(0, "All"); BusinessList.SelectedIndex = 0; BusinessList.Visible = true; DataSet ds2 = new DataSet(); ds2 = dbObj.RunSPReturnDataSet("_GetRegion"); if (dbObj.LastError == string.Empty || ds2.Tables[0].Rows.Count > 0) { ddlGeography.DataSource = ds2.Tables[0].DefaultView; ddlGeography.DataTextField = "RegionName"; ddlGeography.DataValueField = "ShortCode"; ddlGeography.DataBind(); ddlGeography.Visible = true; } dbObj.CloseConnection(); dbObj.Dispose(); } }
IEnumerator GetRequest(UnityWebRequest webRequest) { // Request and wait for the desired page. yield return(webRequest.SendWebRequest()); if (webRequest.isNetworkError) { statusText.text = "Database: Failed!"; } else { dbContent = "{\"BusinessInfo\": " + webRequest.downloadHandler.text + "}"; BusinessList = JsonUtility.FromJson <BusinessList>(dbContent); statusText.text = "Database: Connected!"; result.text = BusinessList.BusinessInfo.Count + " Businesses Nearby!"; } }
private static BusinessList <IPollOption> CreateOptions() { var generator = new RandomObjectGenerator(); var optionId = generator.Generate <int>(); var optionPosition = generator.Generate <short>(); var optionText = generator.Generate <string>(); var option = new Mock <IPollOption>(MockBehavior.Loose); option.Setup(_ => _.IsChild).Returns(true); option.Setup(_ => _.PollOptionID).Returns(optionId); option.Setup(_ => _.OptionPosition).Returns(optionPosition); option.Setup(_ => _.OptionText).Returns(optionText); var options = new BusinessList <IPollOption>(); options.Add(option.Object); return(options); }
/// <summary> /// Parses the data in the CRRD Database XML file into the Business and Category classes. /// </summary> private void SetBusinessList() { // Collect all Elements (business) and all its descendants. var businesses = from qry in xDoc.Descendants("business") select new { // string values Name = qry.Element("name").Value, }; Business tmpBus; // Fill the Business and Category objects with the gathered XML data foreach (var bus in businesses) { tmpBus = new Business(); tmpBus.Name = bus.Name; BusinessList.Add(tmpBus); } }
/// <summary> /// Parses the data in the CRRD Database XML file into the Business and Category classes /// </summary> protected void SetBusinessList() { // Collect all Elements (business) and all its decendants var businesses = from qry in xDoc.Descendants("business") select new { // string values Name = qry.Element("name").Value, Addr1 = qry.Element("contact_info").Element("address").Element("address_line_1").Value, Addr2 = qry.Element("contact_info").Element("address").Element("address_line_2").Value, City = qry.Element("contact_info").Element("address").Element("city").Value, State = qry.Element("contact_info").Element("address").Element("state").Value, Phone = qry.Element("contact_info").Element("phone").Value, Website = qry.Element("contact_info").Element("website").Value, // collection values Categories = qry.Element("category_list").Elements("category"), Links = qry.Element("link_list").Elements("link"), // int & double values ID = qry.Element("id").Value, Zip = (qry.Element("contact_info").Element("address").Element("zip").Value != "") ? qry.Element("contact_info").Element("address").Element("zip").Value : "0", Lat = (qry.Element("contact_info").Element("latlong").Element("latitude").Value != "") ? qry.Element("contact_info").Element("latlong").Element("latitude").Value : "0", Lng = (qry.Element("contact_info").Element("latlong").Element("longitude").Value != "") ? qry.Element("contact_info").Element("latlong").Element("longitude").Value : "0" }; Business tmpBus; List <Category> tmpCatList; List <Link> tmpLinkList; string tmpLinkName; string tmpLinkURI; // Fill the Business and Category objects with the gathered XML data foreach (var bus in businesses) { tmpBus = new Business(); tmpCatList = new List <Category>(); tmpLinkList = new List <Link>(); tmpBus.Name = bus.Name; tmpBus.Address_1 = bus.Addr1; tmpBus.Address_2 = bus.Addr2; tmpBus.City = bus.City; tmpBus.State = bus.State; tmpBus.Phone = bus.Phone; tmpBus.Website = bus.Website; tmpBus.Database_ID = Int32.Parse(bus.ID); tmpBus.Zip = Int32.Parse(bus.Zip); tmpBus.Latitude = double.Parse(bus.Lat); tmpBus.Longitude = double.Parse(bus.Lng); // Process for Subcategory Lists foreach (var c in bus.Categories) { var subcategories = from qry in c.Descendants("subcategory") select new { Subcat = qry.Value }; List <string> tmpSubList = new List <string>(); foreach (var s in subcategories) { tmpSubList.Add(s.Subcat); } tmpCatList.Add(new Category(c.Element("name").Value, tmpSubList)); } tmpBus.CategoryList = tmpCatList; // Process for Link Lists foreach (var l in bus.Links) { tmpLinkName = l.Element("name").Value; tmpLinkURI = l.Element("URI").Value; tmpLinkList.Add(new Link(tmpLinkName, tmpLinkURI)); } tmpBus.LinkList = tmpLinkList; BusinessList.Add(tmpBus); } }
protected void Page_Load(object sender, EventArgs e) { Database dbObj = new Database(HyperCatalog.Business.ApplicationSettings.Components["Datawarehouse_DB"].ConnectionString); //DataSet ds = new DataSet(); if (!Page.IsPostBack) { DataSet ds = new DataSet(); ds = dbObj.RunSPReturnDataSet("_getLinks"); if (dbObj.LastError == string.Empty || ds.Tables[0].Rows.Count > 0) { Linksdropdown.DataSource = ds.Tables[0].DefaultView; Linksdropdown.DataTextField = "LinkTypeName"; Linksdropdown.DataValueField = "LinkTypeId"; Linksdropdown.DataBind(); Linksdropdown.Visible = true; } DataSet ds1 = new DataSet(); this.code = 0; this.code1 = 0; ds1 = dbObj.RunSPReturnDataSet("dbo._GetAllBusinessNames", new SqlParameter[] { new SqlParameter("@Code", code) }); BUType.Text = "OrgName"; BUType.Visible = true; BusinessList.DataSource = ds1; BusinessList.DataValueField = "Code"; BusinessList.DataTextField = "BizName"; BusinessList.DataBind(); BusinessList.Items.Insert(0, "All"); BusinessList.SelectedIndex = 0; BusinessList.Visible = true; BUType1.Text = "OrgName"; BUType1.Visible = true; BusinessList1.DataSource = ds1; BusinessList1.DataValueField = "Code"; BusinessList1.DataTextField = "BizName"; BusinessList1.DataBind(); BusinessList1.Items.Insert(0, "All"); BusinessList1.SelectedIndex = 0; BusinessList1.Visible = true; DataSet ds2 = new DataSet(); ds2 = dbObj.RunSPReturnDataSet("_GetRegion"); if (dbObj.LastError == string.Empty || ds2.Tables[0].Rows.Count > 0) { CulturesList.DataSource = ds2.Tables[0].DefaultView; CulturesList.DataTextField = "RegionName"; CulturesList.DataValueField = "ShortCode"; CulturesList.DataBind(); CulturesList.Items.Insert(0, "All"); CulturesList.SelectedIndex = 0; CulturesList.Visible = true; CulturesList1.DataSource = ds2.Tables[0].DefaultView; CulturesList1.DataTextField = "RegionName"; CulturesList1.DataValueField = "ShortCode"; CulturesList1.DataBind(); CulturesList1.Items.Insert(0, "All"); CulturesList1.SelectedIndex = 0; CulturesList1.Visible = true; } } }
/// <summary> /// Gets a Business object from the BusinessList by the passed Name parameter. /// </summary> /// <param name="businessName">Name of the business.</param> /// <returns> /// The Business object of the given Name perameter is returned. /// </returns> public Business GetBusinessByName(string businessName) { return(BusinessList.FirstOrDefault(x => x.Name == businessName)); }