示例#1
0
        private SiteDetails GetDetailsForCollection(Collection collection)
        {
            SiteDetails details = PhotoRepository.GetSiteDetails(collection.Site);

            details.CoverPhotoID = collection.CoverPhoto == null ? details.LastPhotoID : collection.CoverPhoto.ID;

            return(details);
        }
        /// <summary>
        /// Walks SiteLink > Quest > Place > QuestMarkers > Target to see if an individual NPC has been placed elsewhere.
        /// Used only to determine if an individual NPC should be disabled at home location by layout builders.
        /// Ignores non-individual NPCs.
        /// </summary>
        /// <param name="factionID">Faction ID of individual NPC.</param>
        /// <returns>True if individual has been placed elsewhere, otherwise false.</returns>
        public bool IsIndividualQuestNPCAtSiteLink(int factionID)
        {
            // Check this is a valid individual
            if (!IsIndividualNPC(factionID))
                return false;

            // Iterate site links
            foreach (SiteLink link in siteLinks)
            {
                // Attempt to get Quest target
                Quest quest = GetQuest(link.questUID);
                if (quest == null)
                    continue;

                // Attempt to get Place target
                Place place = quest.GetPlace(link.placeSymbol);
                if (place == null)
                    continue;

                // Must have target resources
                SiteDetails siteDetails = place.SiteDetails;
                QuestMarker marker = siteDetails.questSpawnMarkers[siteDetails.selectedQuestItemMarker];
                if (marker.targetResources == null)
                {
                    Debug.Log("IsIndividualQuestNPCAtSiteLink() found a SiteLink with no targetResources assigned.");
                    continue;
                }

                // Check spawn marker at this site for target NPC resource
                foreach(Symbol target in marker.targetResources)
                {
                    // Get target resource
                    QuestResource resource = quest.GetResource(target);
                    if (resource == null)
                        continue;

                    // Must be a Person resource
                    if (!(resource is Person))
                        continue;

                    // Person must be an individual and not at home
                    Person person = (Person)resource;
                    if (!person.IsIndividualNPC || person.IsIndividualAtHome)
                        continue;

                    // Check if factionID match to placed NPC
                    // This means we found an individual placed at site who is not supposed to be at their home location
                    if (person.FactionData.id == factionID)
                        return true;
                }
            }

            return false;
        }
示例#3
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            SiteSetup siteSetup = new SiteSetup();

            if (siteSetup.ShowDialog(this) == DialogResult.OK)
            {
                SiteDetails details = new SiteDetails((SiteName)siteSetup.PokerSites.SelectedItems[0],
                                                      siteSetup.HandHistoryLocation.Text,
                                                      siteSetup.TournamentSummaryLocation.Text);
                PokerSites.Items.Add(details);
            }
        }
示例#4
0
        private void ModifyButton_Click(object sender, EventArgs e)
        {
            SiteDetails item      = (SiteDetails)PokerSites.SelectedItem;
            SiteSetup   siteSetup = new SiteSetup(item);

            if (siteSetup.ShowDialog(this) == DialogResult.OK)
            {
                SiteDetails details = new SiteDetails(((SiteName)siteSetup.PokerSites.SelectedItems[0]),
                                                      siteSetup.HandHistoryLocation.Text,
                                                      siteSetup.TournamentSummaryLocation.Text);
                (PokerSites.Items[PokerSites.SelectedIndex]) = details;
            }
        }
示例#5
0
        public SiteSetup(SiteDetails details)
        {
            InitializeComponent();
            foreach (SiteName.Values s in Enum.GetValues(typeof(SiteName.Values)))
            {
                if (HandHistoryParserFactory.HasHandHistoryParserFactory(s))
                {
                    PokerSites.Items.Add(new SiteName(s));
                }
            }

            HandHistoryLocation.Text       = details.HandsLocation;
            TournamentSummaryLocation.Text = details.TournamentsLocation;
        }
示例#6
0
        private void LoadValues()
        {
            PokerSites.Items.Clear();
            if (Settings.Default.Sites != null)
            {
                foreach (string site in Settings.Default.Sites)
                {
                    SiteDetails details = new SiteDetails(site);
                    PokerSites.Items.Add(details);
                }
            }

            autoUpdate.Checked = Settings.Default.autoUpdate;
        }
示例#7
0
        public IActionResult UpdateEvents(SiteDetails siteDetails)
        {
            Events eventUpdate = new Events
            {
                EventID  = siteDetails.EventID,
                SiteCode = siteDetails.SiteCode,
                Date     = siteDetails.Date,
                Spaces   = siteDetails.Spaces - 1
            };

            _Context.Events.Update(eventUpdate);
            _Context.SaveChanges();
            return(RedirectToAction("Index", "Home"));
        }
        /// <summary>
        /// Executes the WorkFlow.
        /// </summary>
        /// <param name="crmWorkflowContext">The <see cref="LocalWorkflowContext"/> which contains the
        /// <param name="executionContext" > <see cref="CodeActivityContext"/>
        /// </param>
        /// <remarks>
        /// For improved performance, Microsoft Dynamics 365 caches WorkFlow instances.
        /// The WorkFlow's Execute method should be written to be stateless as the constructor
        /// is not called for every invocation of the WorkFlow. Also, multiple system threads
        /// could execute the WorkFlow at the same time. All per invocation state information
        /// is stored in the context. This means that you should not use global variables in WorkFlows.
        /// </remarks>
        public override void ExecuteCRMWorkFlowActivity(CodeActivityContext executionContext, LocalWorkflowContext crmWorkflowContext)
        {
            if (crmWorkflowContext == null)
            {
                throw new ArgumentNullException(nameof(crmWorkflowContext));
            }

            try
            {
                var tracingService = executionContext.GetExtension <ITracingService>();
                var context        = executionContext.GetExtension <IWorkflowContext>();
                var serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>();
                var service        = crmWorkflowContext.OrganizationService;
                var adminService   = serviceFactory.CreateOrganizationService(null);

                tracingService.Trace("In UpdateSharePointMetadata.");

                var parentEntityName = Parent_Entity_Name.Get(executionContext);
                var parentLookupName = Parent_Lookup_Name.Get(executionContext);

                tracingService.Trace("Parent Entity = {0}; Parent Lookup = {1}", parentEntityName, parentLookupName);

                var customer = Customer.Get(executionContext);
                if (string.IsNullOrEmpty(customer))
                {
                    customer = string.Empty;
                    tracingService.Trace("No customer details passed to workflow");
                }
                var siteDetails = SiteDetails.Get(executionContext);
                if (string.IsNullOrEmpty(siteDetails))
                {
                    siteDetails = string.Empty;
                    tracingService.Trace("No site details details passed to workflow");
                }
                var permitDetails = PermitDetails.Get(executionContext);
                if (string.IsNullOrEmpty(permitDetails))
                {
                    permitDetails = string.Empty;
                    tracingService.Trace("No permit details passed to workflow");
                }
                tracingService.Trace("Customer = {0}; Site = {1}; Permit = {2}", customer, siteDetails, permitDetails);

                var azureInterface = new AzureInterface(adminService, service, tracingService);
                azureInterface.UpdateMetaData(new EntityReference(context.PrimaryEntityName, context.PrimaryEntityId), customer, siteDetails, permitDetails);
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException("An error occurred in Workflow assembly.", ex);
            }
        }
        /// <summary>
        /// Query and return all items from the datasource
        /// </summary>
        private async void getData(DataSource ds)
        {
            //query/return all features
            var result = await ds.ExecuteQueryAsync(new Query(WhereClause, null, true));

            //Create a list to store the returned results
            List <SiteDetails> items = new List <SiteDetails>();

            if (result == null || result.Features == null)
            {
                return;
            }
            else
            {
                foreach (var item in result.Features)
                {
                    try
                    {
                        //TODO thinking I should just handle the projections here
                        // that way it only happens once rather than on each zoom
                        SiteDetails newItem = new SiteDetails()
                        {
                            f          = item.Attributes[ds.ObjectIdFieldName].ToString(),
                            ZoomExtent = item.Geometry.ToJson(),
                            AdditionalFieldsAndValues = createNewFieldList(item),
                            LabelField         = (item.Attributes[AdditionalFields.Keys.ToList()[0]] != null) ? item.Attributes[AdditionalFields.Keys.ToList()[0]].ToString() : "",
                            isParentExpandable = UseExpandable
                        };

                        if (UseExpandable)
                        {
                            if (ds.IsSelectable)
                            {
                                newItem.isExpanded = isItemExpanded(newItem);
                            }
                        }

                        items.Add(newItem);
                    }
                    catch (Exception ex)
                    {
                        //MessageBox.Show(ex.Message);
                    }
                }
            }

            //bind the items to the control
            lvSiteDetails.ItemsSource = items;
        }
        public ActionResult <string> NextBest(string currentUrl)
        {
            if (string.IsNullOrEmpty(currentUrl) ||
                !Uri.TryCreate(currentUrl, UriKind.Absolute, out _))
            {
                return(BadRequest(nameof(currentUrl)));
            }

            Task qurryAa = aaRequests.MakeACall_TempAsync();

            var siteDetails = new SiteDetails {
                Url = currentUrl
            };

            siteDetails.LoadDetails();

            return(Ok(siteDetails));
        }
        private void HighlightFeature_Click(object sender, RoutedEventArgs e)
        {
            SiteDetails sd = ((Button)sender).DataContext as SiteDetails;

            Geometry g = Geometry.FromJson(sd.ZoomExtent);

            ESRI.ArcGIS.Client.FeatureLayer fl = mapWidget.FindFeatureLayer(dataSource);

            for (int i = 0; i < fl.Graphics.Count; i++)
            {
                client.Graphic feature = fl.Graphics[i];
                int            featureOid;
                int.TryParse(feature.Attributes[dataSource.ObjectIdFieldName].ToString(), out featureOid);
                if (sd.f == featureOid.ToString())
                {
                    fl.ClearSelection();
                    feature.Select();
                }
            }
        }
示例#12
0
        public SiteDetails GetSiteDetails(int userId, int siteId)
        {
            var siteDetails = new SiteDetails
            {
                SiteId   = 1,
                SiteName = "Indirapuram",
                Location = new Location {
                    Latitude = 22.4343f, Longitude = 27.33432f
                },
                Pump = new Pumps
                {
                    PumpId     = 1,
                    PumpStatus = -1,
                    RAmp       = 12,
                    BAmp       = 123,
                    YVoltage   = 242,
                    RVoltage   = 222,
                    BVoltage   = 235
                },
                Motor = new Motor
                {
                    MotorId     = 2,
                    MotorStatus = 0
                },
                Genset = new Genset
                {
                    GensetId     = 12213,
                    GensetStatus = 1
                },
                Tank = new Tank
                {
                    TankId           = 123,
                    TankLevelCurrent = 230,
                    TankLevelMax     = 500
                },
                CityName             = "Ghaziabad",
                LastUpdatedTimestamp = "1112312312"
            };

            return(siteDetails);
        }
        public override DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            SiteDetails siteItem = item as SiteDetails;
            var         element  = container as FrameworkElement;

            if (siteItem != null)
            {
                if (siteItem.isParentExpandable)
                {
                    return(element.FindResource("ExpanderTemplate") as DataTemplate);
                }
                else
                {
                    return(element.FindResource("ExpanderTemplate2") as DataTemplate);
                }
            }
            else
            {
                return(element.FindResource("ExpanderTemplate") as DataTemplate);
            }
        }
示例#14
0
        public IActionResult DeleteSite(SiteDetails siteDetails)
        {
            Site deletesite = new Site
            {
                SiteCode = siteDetails.SiteCode,
                Postcode = siteDetails.Postcode,
                SiteName = siteDetails.SiteName,
                Tel      = siteDetails.Tel,
                Website  = siteDetails.Website
            };
            Address deleteaddress = new Address
            {
                Postcode = siteDetails.Postcode,
                Street   = siteDetails.Street,
                City     = siteDetails.City
            };

            _Context.Sites.Remove(deletesite);
            _Context.Addresses.Remove(deleteaddress);
            _Context.SaveChanges();
            return(RedirectToAction("Sites", "Home"));
        }
示例#15
0
        /// <summary>
        /// Get a local building in the town player is currently at.
        /// Throws exception if no valid buildings of specified type are found.
        /// Example of how this can happen is issuing a quest to a local palace in a town with no palace.
        /// Use remote palace instead to ensure quest can select from entire region.
        /// </summary>
        void SetupLocalSite()
        {
            // Get player location
            DFLocation location = GameManager.Instance.PlayerGPS.CurrentLocation;

            if (!location.Loaded)
            {
                throw new Exception("Tried to setup a local site but player is not in a location (i.e. player in wilderness).");
            }

            // Local dungeons not supported
            if (p1 == 1)
            {
                throw new Exception("Cannot specify a local dungeon place resource. Only use of remote or fixed supported for dungeons.");
            }

            // Get list of valid sites
            SiteDetails[] foundSites = null;
            if (p2 == -1)
            {
                foundSites = CollectQuestSitesOfBuildingType(location, DFLocation.BuildingTypes.AllValid);
            }
            else
            {
                foundSites = CollectQuestSitesOfBuildingType(location, (DFLocation.BuildingTypes)p2);
            }

            // Must have found at least one site
            if (foundSites == null || foundSites.Length == 0)
            {
                throw new Exception(string.Format("Could not find local site with P2={0} in {1}/{2}.", p2, location.RegionName, location.Name));
            }

            // Select a random site from available list
            int selectedIndex = UnityEngine.Random.Range(0, foundSites.Length);

            siteDetails = foundSites[selectedIndex];
        }
        private bool isItemExpanded(SiteDetails sd)
        {
            try
            {
                for (int i = 0; i < lvSiteDetails.Items.Count; i++)
                {
                    bool isMatch = true;

                    SiteDetails currentSD = (SiteDetails)lvSiteDetails.Items[i];
                    int         cnt       = 3;
                    if (currentSD.AdditionalFieldsAndValues.Count < 3)
                    {
                        cnt = currentSD.AdditionalFieldsAndValues.Count;
                    }
                    //only check the first couple of fields
                    for (int ii = 0; ii < cnt; ii++)
                    {
                        //TODO..could be that they just edited the value
                        if (currentSD.AdditionalFieldsAndValues[ii].value != sd.AdditionalFieldsAndValues[ii].value)
                        {
                            isMatch = false;
                        }
                    }

                    if (isMatch)
                    {
                        return(currentSD.isExpanded);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
 public PokerStarsParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
 public FullTiltPokerParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
 public EntractionParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
示例#20
0
 public IPokerParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
        private void parsingWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            Dictionary <HandHistoryParserFactory, IEnumerable <FileInfo> > factories =
                new Dictionary <HandHistoryParserFactory, IEnumerable <FileInfo> >();
            int totalFiles = 0;

            foreach (string siteDetailsString in Settings.Default.Sites)
            {
                SiteDetails details = new SiteDetails(siteDetailsString);
                HandHistoryParserFactory parserFactory = HandHistoryParserFactory.GetHandHistoryParserFactory(details);
                DirectoryInfo            info          = new DirectoryInfo(details.HandsLocation);
                IEnumerable <FileInfo>   files         = info.GetFiles().Where(fi => parserFactory.IsHandHistoryFile(fi) &&
                                                                               fi.LastWriteTime > lastUpdate);
                totalFiles += files.Count();
                factories.Add(parserFactory, files);
            }

            handsFound       = 0;
            tournamentsFound = 0;

            float fileProgressInc = 100.0f / totalFiles;
            int   filesProcessed  = 0;

            foreach (HandHistoryParserFactory factory in factories.Keys)
            {
                factory.HandHistoryParser.AmountsAsBigBlindMultiples = true;
                foreach (FileInfo file in factories[factory])
                {
                    int         byteCount  = 0;
                    HandHistory parsedHand = null;

                    TournamentSummary tournamentSummary = null;

                    if (factory.HasTournamentSummaryParser() && File.Exists(factory.GetTournamentFile(file.FullName)))
                    {
                        tournamentSummary = factory.ParseTournamentSummary(file.FullName);
                        DatabaseHandler.Add(tournamentSummary);
                        ++tournamentsFound;
                    }
                    IEnumerable <HandHistory> hands = factory.ParseHandHistories(file.FullName);
                    float totalHands = (float)hands.Count();
                    int   fileHands  = 0;

                    foreach (HandHistory hand in hands)
                    {
                        if (parsingWorker.CancellationPending)
                        {
                            break;
                        }

                        try
                        {
                            parsedHand = hand;
                            string tournamentId = parsedHand.GameDescription.TournamentId;

                            if (tournamentSummary != null)
                            {
                                parsedHand.GameDescription.TournamentSummary = tournamentSummary;
                            }
                            DatabaseHandler.Add(parsedHand);
                            byteCount += parsedHand.FullHandHistoryText.Length;
                            ++handsFound;
                            ++fileHands;
                            float progress = (int)((filesProcessed + fileHands / totalHands) * fileProgressInc);
                            parsingWorker.ReportProgress((int)progress);
                        }
                        catch (MongoWriteException ex)
                        {
                            Console.Write("Failed");
                        }
                        catch (HandParseException ex)
                        {
                            Console.Write("Parsing failed for: " + string.Concat(ex.HandText) + "\n");
                        }
                    }
                    if (parsingWorker.CancellationPending)
                    {
                        break;
                    }

                    ++filesProcessed;
                    parsingWorker.ReportProgress((int)(filesProcessed * fileProgressInc));
                }
            }

            parsingWorker.ReportProgress(100);
        }
 public WinningPokerNetworkParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
示例#23
0
 public void UpdateSite(SiteDetails Details)
 {
     CurrentRuntime.Globals["SiteDetails"] = Details;
 }
示例#24
0
 public MergeParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
示例#25
0
 public void UpdateSite(SiteDetails Stats)
 {
     Runtime.SetValue("SiteDetails", Stats);
 }
示例#26
0
 public WinamaxParserFactory(SiteDetails siteDetails) : base(siteDetails)
 {
 }
 protected HandHistoryParserFactory(SiteDetails siteDetails)
 {
     SiteDetails = siteDetails;
 }
示例#28
0
        private void GetSiteDetails()
        {
            try
            {
                int SiteId = 0;

                SiteId = Convert.ToInt32(SessionData.Config.SSiteID);

                if (Session["SiteDetails"] == null || (Session["SiteDetails"] != null && ((SiteDetails)Session["SiteDetails"]).SiteID != SiteId))
                {
                    //string Query = "select SiteId,SiteName,FolderPath from Sites where SiteId=" + SiteId + " and UserId=" + int.Parse(oUserData["UserId"].ToString());
                    string Query = "select S.SiteId,S.SiteName,S.FolderPath,S.FolderPathTool,S.FolderPathFinal,S.DefaultPage from Sites S"
                                    + " where S.SiteId=" + SiteId + " and S.UserId=" + "'" + QSVars["CDID"].ToString() + "'";
                    DataSet oDataSet = new DataSet();
                    SqlHelper.FillDataset(ConfigurationSettings.AppSettings["SoConn"].ToString(), CommandType.Text, Query, oDataSet, new string[] { "SiteDetails" });

                    oSiteDetails.SiteID = int.Parse(oDataSet.Tables["SiteDetails"].Rows[0]["SiteId"].ToString());
                    oSiteDetails.SiteName = oDataSet.Tables["SiteDetails"].Rows[0]["SiteName"].ToString();

                    oSiteDetails.FolderPath = oDataSet.Tables["SiteDetails"].Rows[0]["FolderPath"].ToString();
                    oSiteDetails.FolderPathTool = oDataSet.Tables["SiteDetails"].Rows[0]["FolderPathTool"].ToString(); //Added
                    oSiteDetails.FolderPathFinal = oDataSet.Tables["SiteDetails"].Rows[0]["FolderPathFinal"].ToString(); //Added

                    //oSiteDetails.CustomerName = oDataSet.Tables["SiteDetails"].Rows[0]["CustomerName"].ToString();
                    oSiteDetails.DefaultPage = oDataSet.Tables["SiteDetails"].Rows[0]["DefaultPage"].ToString();
                    //oSiteDetails.ToolCodePath = "./Sites/Tool/" + oSiteDetails.SiteID; //Added
                    //oSiteDetails.FinalCodePath = "./Sites/Final/"+oSiteDetails.SiteID;  //Added

                    //string strFolderName = Server.MapPath("./Template/");
                    string[] PagesWithPath = Directory.GetFiles(Server.MapPath(oSiteDetails.FolderPathTool), "*.htm*", SearchOption.TopDirectoryOnly);
                    List<string> listPages = new List<string>();
                    foreach (string PageWithPath in PagesWithPath)
                    {
                        //Path.GetFileName("D:\\WebHutNew\\WebHutNew\\SiteImages\\5\\about.html");
                        listPages.Add(Path.GetFileName(PageWithPath));
                    }
                    oSiteDetails.Pages = listPages;
                    Session["SiteDetails"] = oSiteDetails;
                }
                else
                {
                    oSiteDetails = (SiteDetails)Session["SiteDetails"];
                }
            }
            catch (Exception ex)
            {

            }
        }
示例#29
0
 public Poker888ParserFactory(SiteDetails details) : base(details)
 {
 }
示例#30
0
 public void UpdateSite(SiteDetails Stats)
 {
     Scope.SetVariable("SiteDetails", Stats);
 }
 protected HandHistoryParserFactory(SiteName site)
 {
     SiteDetails = new SiteDetails(site);
 }