public Construction_Worker(Game game, JobList list, string name) : base(game,list, name) { ToRepair = new List<Buildings.BuildingsModel>(); _job = Jobs.CONSTRUCTION_WORKER; _coefficient = 10; }
protected void getCareerPercentile(JobList jl) { if (LoginInfo["PID"].ToString() != "") { strSQL = "select isnull(a.Percentile,0) Percentile from AP_SavedSection a join AP_SavedTest b on a.APTestID = b.APTestID and b.PortfolioID=" + LoginInfo["PID"].ToString() + " and b.IsActiveStatus=1 order by a.SectionID"; dtAP = CCLib.Common.DataAccess.GetDataTable(strSQL); aAP.Attributes.Add("HREF", "k_list_matched.aspx?LoginID=" + LoginID + "&AP=1&MMID=" + strMMID); aShowSkills.Attributes.Add("HREF", "k_list_matched.aspx?LoginID=" + LoginID + "&AP=0&MMID=" + strMMID); if (dtAP.Rows.Count >= 6) { UpdateScore(jl); tblAP.Visible = true; if (strAP == "1") Session["showAP"] = strAP; else if (Session["showAP"] != null) { strAP = Session["showAP"].ToString(); } //Determine which style to load if (strAP == "0") { Session["showAP"] = "0"; bShowAbilityProfiler = false; aAP.Visible = true; aShowSkills.Visible = false; lblHeader.Text = (bShowSkillCats) ? "MY SKILLS " : ""; strCSSName = (bShowSkillCats) ? "/CSS/MM_CareerSuggestions/mm_ms.css" : "/CSS/MM_CareerSuggestions/mm.css"; } else { Session["showAP"] = null; bShowAbilityProfiler = true; aAP.Visible = false; aShowSkills.Visible = (bShowSkillCats) ? true : false; strCSSName = "/CSS/MM_CareerSuggestions/mm_ap.css"; lblHeader.Text = "ABILITY PROFILER"; } } else { Session["showAP"] = null; tblAP.Visible = false; bShowAbilityProfiler = false; aShowSkills.Visible = false; lblHeader.Text = (bShowSkillCats) ? "MY SKILLS" : ""; strCSSName = "/CSS/MM_CareerSuggestions/mm.css"; } } else { Session["showAP"] = null; tblAP.Visible = false; bShowAbilityProfiler = false; aShowSkills.Visible = false; strCSSName = "/CSS/MM_CareerSuggestions/mm.css"; } }
public Tailor(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.TAILOR; _coefficient = 15; _happinessAddition = 1.4; }
public Miller(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.MILLER; _coefficient = 13; _happinessAddition = 1; }
public Cooker(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.COOKER; _coefficient = 13; HappinessToAdd = 1.3; }
protected BulkLoader(Configuration.Configuration config) { _jobs = new JobList(); _jobs.RowsInserted += (s, e) => OnRowsInserted(e); Config = config; DefaultSchema = "dbo"; }
internal Pulley(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g, v) { CostPrice = 200; IsActivated = false; _selected = _jobs.Construction_Worker; _owner = v; }
public Fertilizer(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g, v) { CostPrice = 1000; IsActivated = false; _selected = _jobs.Farmer; _owner = v; }
internal Whitewash(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g, v) { CostPrice = 100; IsActivated = false; _selected = _jobs.Cooker; _owner = v; }
public Scarecrow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g, v) { CostPrice = 500; IsActivated = false; _selected = _jobs.Farmer; _owner = v; }
internal Saw(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g, v) { CostPrice = 600; IsActivated = false; _selected = _jobs.Blacksmith; _owner = v; }
public Level3(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g,v) { CostPrice = 800; IsActivated = false; _selected = _jobs.Cooker; _owner = v; }
public static AspectResultSet buildAspectResultSet(string strCountry, JobList jl, AspectResultSet arsAnswered) { DataTable dtAspects = CCLib.Cache.GetCachedDataTableWithNoExpire("ASPECT_DETIALS_" + strCountry, "select * from tblaspects" + strCountry); bool[] baInclude = new bool[MaxNoOfAspects]; foreach (JobItem ji in jl) //go through each job in the list { DataRow[] drsAspects = dtAspects.Select("OccNumber=" + ji.JobRef); if (drsAspects.Length > 0) { //make sure we find the job in the aspects table for (int intSection = 1; intSection <= 3; intSection++)//check the core, secondary, other { string strAspectList=""; switch (intSection) { case 1: strAspectList = drsAspects[0]["Central"].ToString(); break; case 2: strAspectList = drsAspects[0]["Secondary"].ToString(); break; case 3: strAspectList = drsAspects[0]["Other"].ToString(); break; }; //check which aspects they should of answered for (int i = 0; i < strAspectList.Length; i = i + 3) { baInclude[Convert.ToInt16(strAspectList.Substring(i, 3).ToString())] = true; //set a flag for each aspect }; }; }; }; AspectResultSet ars = new AspectResultSet(); for (int i = 1; i < MaxNoOfAspects; i++) // go through our list of flags { //if the flags say they shold of answered it if (baInclude[i] == true) { //if the client hasn't already answered them AspectResult aspectResult = arsAnswered.Find(delegate(AspectResult ar) { return ar.AspectRef == i; } ); if (aspectResult == null) //if it's not in the list of aspects the client has answered { AspectResult ar = new AspectResult(); ar.AspectRef = i; ars.Add(ar); } else if (aspectResult.AspectResponse < 1)// or it's in the list but it has no response { AspectResult ar = new AspectResult(); ar.AspectRef = i; ars.Add(ar); } }; }; return (ars); }
internal JobsModel(Game game, JobList list, string name) : base(game) { goldBase = 5; _jobName = name; _workers = new List<Villager>(); // _gold = ModifyGoldGeneration(); _owner = list; }
public Plow(Game g, Village v, UpgradesList _listOfUpgrades, JobList _jobs) : base(g,v) { CostPrice = 1000; IsActivated = false; _selected = _jobs.Blacksmith; _owner = v; _jobsList = _jobs; }
public MainViewModel(ClientService clientService, JobList jobList, IRegionManager regionManager) { this.Title = "控制台"; this.ClientService = clientService; this.RegionManager = regionManager; this.JobDataList = jobList; this.JobList = new ListCollectionView(this.JobDataList); this.JobList.Filter = this.JobFilter; }
internal JobList DeserializeListJobResult(string payload) { var ret = new JobList(); var list = new List<JobDetails>(); using (var parser = new JsonParser(payload)) { var jobList = parser.ParseNext(); if (jobList == null || !jobList.IsValidArray()) { throw new InvalidOperationException(); } if (jobList.IsEmpty) { return ret; } for (var i = 0; i < jobList.Count(); i++) { var job = jobList.GetIndex(i); if (job == null || !job.IsValidObject()) { continue; } var detailProp = job.GetProperty(DetailPropertyName); if (detailProp != null && detailProp.IsValidObject()) { try { var jobDetails = this.DeserializeJobDetails((JsonObject)detailProp); jobDetails.SubmissionTime = jobDetails.SubmissionTime.ToLocalTime(); if (jobDetails != null) { list.Add(jobDetails); } } catch (InvalidOperationException) { //Eat it. } } } } ret.Jobs.AddRange((from j in list orderby j.SubmissionTime.ToUniversalTime() select j)); return ret; }
internal Village(Game game, string name) : base(game) { Debug.Assert(!String.IsNullOrWhiteSpace(name)); Debug.Assert(game != null, @"(village, Village) Game is null"); // Initialize village's grid _villageGrid = new Board(); // Initilize village's lists BuildingsList = new Buildings.BuildingsList(this); EmptyHouseList = new List<Buildings.House>(); JobsList = new JobList(this); _familiesList = new FamilyInVillageList(this); _upgrades = new UpgradesList(this); // Initialize historized values _offeringsPointsPerTick = new HistorizedValue<int, Village>(this, @"_offeringsPointsPerTick", 20); _villagePop = new HistorizedValue<int, Village>(this, @"_villagePop", 20); // Set values _name = name; _offeringsPointsPerTick.Current = 1; }
private JobList <T> GetJobsWithProperties <T>( IDatabase redis, string[] jobIds, string[] properties, string[] stateProperties, Func <Job, List <string>, List <string>, T> selector) { if (jobIds.Length == 0) { return(new JobList <T>(new List <KeyValuePair <string, T> >())); } var jobs = new Dictionary <string, List <string> >(jobIds.Length); var states = new Dictionary <string, List <string> >(jobIds.Length); properties = properties ?? new string[0]; var pipeline = redis.CreateBatch(); var tasks = new List <Task>(jobIds.Length * 2); foreach (var jobId in jobIds) { var id = jobId; var jobTask = pipeline.HashGetAsync( String.Format("hangfire:job:{0}", id), properties.Union(new[] { "Type", "Method", "ParameterTypes", "Arguments" }).Select(x => (RedisValue)x).ToArray()); tasks.Add(jobTask); tasks.Add(jobTask.ContinueWith(x => { jobs[id] = x.Result.Select(v => (string)v).ToList(); })); if (stateProperties != null) { var taskStateJob = pipeline.HashGetAsync(String.Format("hangfire:job:{0}:state", id), stateProperties.Select(x => (RedisValue)x).ToArray()); tasks.Add(taskStateJob); tasks.Add(taskStateJob.ContinueWith(x => { if (!states.ContainsKey(id)) { states.Add(id, x.Result.ToStringArray().ToList()); } })); } } pipeline.Execute(); Task.WaitAll(tasks.ToArray()); var jobList = new JobList <T>(jobIds .Select(x => new { JobId = x, Job = jobs[x], Method = TryToGetJob( jobs[x][properties.Length], jobs[x][properties.Length + 1], jobs[x][properties.Length + 2], jobs[x][properties.Length + 3]), State = states.ContainsKey(x) ? states[x] : null }) .Select(x => new KeyValuePair <string, T>( x.JobId, x.Job.TrueForAll(y => y == null) ? default(T) : selector(x.Method, x.Job, x.State))) .ToList()); return(jobList); }
public IHttpActionResult PostJob(JobList jobList) { _repository.Post(jobList); return(Ok(jobList)); }
public GetJobsSpectraS3Response(JobList responsePayload) { this.ResponsePayload = responsePayload; }
public override void Execute() { WriteLiteral("\r\n"); #line 10 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Layout = new LayoutPage { Title = Queue.ToUpperInvariant(), Subtitle = "Enqueued jobs", Breadcrumbs = new Dictionary <string, string> { { "Queues", Request.LinkTo("/queues") } } }; int from, perPage; int.TryParse(Request.Query["from"], out from); int.TryParse(Request.Query["count"], out perPage); var monitor = JobStorage.Current.GetMonitoringApi(); Pager pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue)) { BasePageUrl = Request.LinkTo("/queues/" + Queue) }; JobList <EnqueuedJobDto> enqueuedJobs = monitor .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage); #line default #line hidden WriteLiteral("\r\n"); #line 36 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (pager.TotalPageCount == 0) { #line default #line hidden WriteLiteral(" <div class=\"alert alert-info\">\r\n The queue is empty.\r\n </div>\r\n"); #line 41 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar btn-toolbar-top\">" + "\r\n <button class=\"js-jobs-list-command btn btn-sm btn-default\"\r\n " + " data-url=\""); #line 47 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Request.LinkTo("/enqueued/delete")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to DELETE ALL selected jobs?""> <span class=""glyphicon glyphicon-remove""></span> Delete selected </button> "); #line 54 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(RenderPartial(new PerPageSelector(pager))); #line default #line hidden WriteLiteral(@" </div> <table class=""table""> <thead> <tr> <th class=""min-width""> <input type=""checkbox"" class=""js-jobs-list-select-all"" /> </th> <th class=""min-width"">Id</th> <th class=""min-width"">State</th> <th>Job</th> <th class=""align-right"">Enqueued</th> </tr> </thead> <tbody> "); #line 70 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" foreach (var job in enqueuedJobs) { #line default #line hidden WriteLiteral(" <tr class=\"js-jobs-list-row hover "); #line 72 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(!job.Value.InEnqueuedState ? "obsolete-data" : null); #line default #line hidden WriteLiteral("\">\r\n <td>\r\n <input type=\"checkb" + "ox\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\""); #line 74 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(job.Key); #line default #line hidden WriteLiteral("\" />\r\n </td>\r\n <td class=\"min-width" + "\">\r\n <a href=\""); #line 77 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 78 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(HtmlHelper.JobId(job.Key)); #line default #line hidden WriteLiteral("\r\n </a>\r\n"); #line 80 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (!job.Value.InEnqueuedState) { #line default #line hidden WriteLiteral(" <span title=\"Job\'s state has been changed while f" + "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); #line 83 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n <td class=\"min-width\">\r\n " + " <span class=\"label label-default\" style=\""); #line 86 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null); #line default #line hidden WriteLiteral("\">\r\n "); #line 87 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(job.Value.State); #line default #line hidden WriteLiteral("\r\n </span>\r\n </td>\r\n " + " <td>\r\n <a class=\"job-method\" href=\""); #line 91 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 92 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(HtmlHelper.DisplayMethod(job.Value.Job)); #line default #line hidden WriteLiteral("\r\n </a>\r\n </td>\r\n " + " <td class=\"align-right\">\r\n"); #line 96 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" if (job.Value.EnqueuedAt.HasValue) { #line default #line hidden WriteLiteral(" <span data-moment=\""); #line 98 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value)); #line default #line hidden WriteLiteral("\">\r\n "); #line 99 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(job.Value.EnqueuedAt); #line default #line hidden WriteLiteral("\r\n </span>\r\n"); #line 101 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <em>n/a</em>\r\n"); #line 105 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n </tr>\r\n"); #line 108 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n"); #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" #line default #line hidden #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" Write(RenderPartial(new Paginator(pager))); #line default #line hidden #line 112 "..\..\Dashboard\Pages\EnqueuedJobsPage.cshtml" } #line default #line hidden }
public void JobList_Ctor_ShouldInitializeCollection() { var list = new JobList<int>(new Dictionary<string, int> { { "1", 2 } }); Assert.Equal(1, list.Count); }
public static void getSkillsCategories(String strCountry, JobList jl, SkillsResultSet srs) { int[] eWeightArray = new int[31]; int[,] eScoreArray = new int[6,31]; int[] dWeightArray = new int[31]; int[,] dScoreArray = new int[6,31]; initSkillsArrays(ref eWeightArray,ref eScoreArray,ref dWeightArray,ref dScoreArray ); DataTable dtJobSkills = CCLib.Cache.GetCachedDataTableWithNoExpire("JOBSKILLS_"+strCountry, "Select OccNumber, EssentialSkills,DesirableSkills from tblAspects" + strCountry); foreach (JobItem ji in jl) { int[] arrESkills = {0,0,0,0,0,0}; int[] arrDSkills = {0,0,0,0,0,0}; DataRow[] drsJobSkill = dtJobSkills.Select("OccNumber=" + ji.JobRef.ToString()); //get skills for each job if (drsJobSkill.Length >0) { //get eskills for the job string strESkills = drsJobSkill[0]["EssentialSkills"].ToString(); for (int i=0; i<strESkills.Length; i=i+3) { //for each eskill, retrieve that skill from the answers SkillsResult skillsResult = srs.Find(delegate(SkillsResult sr){return sr.SkillsRef == Convert.ToInt16(strESkills.Substring(i,3));}); if (skillsResult != null) { //if we've found it... if((skillsResult.SkillsResponse <=5) & (skillsResult.SkillsResponse>=0)) { arrESkills[skillsResult.SkillsResponse]++; //add the skill to the results array } else { arrESkills[0]++;} }; }; //get dskills for the job string strDSkills = drsJobSkill[0]["DesirableSkills"].ToString(); for (int i=0; i<strDSkills.Length; i=i+3) { //for each eskill, retrieve that skill from the answers SkillsResult skillsResult = srs.Find(delegate(SkillsResult sr){return sr.SkillsRef == Convert.ToInt16(strDSkills.Substring(i,3));}); if (skillsResult != null) { //if we've found it... if((skillsResult.SkillsResponse <=5) & (skillsResult.SkillsResponse>=0)) { arrDSkills[skillsResult.SkillsResponse]++; //add the skill to the results array } else { arrDSkills[0]++;} }; } int intEscore = createEDscore(ref arrESkills,ref eScoreArray,ref eWeightArray); int intDscore = createEDscore(ref arrDSkills,ref dScoreArray,ref dWeightArray); if ((intEscore >341) && (intDscore>=75)){ji.SkillsCat = 1;} else if (((intEscore>341) && ((0<=intDscore) && (intDscore<=75))) || (((115<=intEscore)&&(intEscore<=341)) && (intDscore>=23))){ji.SkillsCat =2;} else if ((((intEscore>341) && ((-250<=intDscore)&& (intDscore<0))) || (((115<=intEscore) && (intEscore<=341)) && ((-200<= intDscore)&& (intDscore<23)))) || (((-950<=intEscore)&&(intEscore<115)) && (intDscore>=-160))) {ji.SkillsCat = 3;} else if ((((intEscore>341)&& ((-350<=intDscore)&&(intDscore<-250))) || (((115<=intEscore)&&(intEscore<=340))&&((-300<=intDscore)&&(intDscore<-200)))) || ((((-950<=intEscore)&&(intEscore<115))&&((-250<=intDscore)&&(intDscore<-160))) || (((-1998 <= intEscore) && (intEscore < -950)) && (intDscore >= -200)))) { ji.SkillsCat = 4; } else {ji.SkillsCat= 5;}; } } //sort the list by score //mrm 31/3/2006 to stop re-ordering bys skill score jl.Sort(delegate(JobItem x, JobItem y) { return Comparer.Default.Compare(Convert.ToInt64((x.MatchCat * 1000000000) + (x.SkillsCat*10000000)-x.Score), Convert.ToInt64((y.MatchCat * 1000000000) + (y.SkillsCat*10000000)-y.Score)); }); //prepare rank int j = 1; foreach (JobItem ji1 in jl) { ji1.Rank = j; j++; }; }
public void ReadReleaseInformation(Stream streamIn, double timeIn) { DataSet releases = new DataSet(); releases.ReadXml(streamIn); if (releases.Tables.Count > 0) { foreach (DataRow currentRow in releases.Tables[0].Rows) { int quantity = Int32.Parse(currentRow["Quantity"].ToString()); string typeName = currentRow["Type"].ToString(); JobType jobType = this.jobMix.JobTypes[typeName]; if (quantity >= 0) { jobType.Unreleased += quantity; } else { if (quantity <= jobType.Unreleased) { jobType.Unreleased -= quantity; } else { quantity -= jobType.Unreleased; jobType.Unreleased = 0; JobList cancellableJobs = new JobList(); foreach (Job job in jobType.Jobs) { bool cancel = true; foreach (Unitload unitload in job.Unitloads) { if ((unitload.Location != jobType.InputStation.InQueue) || (unitload.Location == jobType.InputStation.InQueue && unitload.InTransfer == true)) { cancel = false; break; } } if (cancel == true) { cancellableJobs.Insert(0, job); } } while (quantity > 0 && cancellableJobs.Count > 0) { Job currentJob = cancellableJobs[0]; cancellableJobs.RemoveAt(0); quantity--; foreach (Unitload unitload in currentJob.Unitloads) { this.unitloads.Remove(unitload); } this.jobs.Remove(currentJob); Statistics submitted = jobType.Statistics["Submitted"]; submitted.UpdateCount(timeIn, -1); } } } } } streamIn.Close(); }
private void JobRefresh(string TransformerSerialNo, string JobName) { if (JobName == string.Empty) { return; } JobList job = WorkingSets.local.getJob(TransformerSerialNo, JobName); JobNameTextBox.Text = job.Name; WindingDCInsulationCheckBox.IsChecked = job.DCInsulation.Enabled; HVWindingDCInsulationCheckBox.IsChecked = job.DCInsulation.HVEnabled; MVWindingDCInsulationCheckBox.IsChecked = job.DCInsulation.MVEnabled; LVWindingDCInsulationCheckBox.IsChecked = job.DCInsulation.LVEnabled; WindingCapacitanceCheckBox.IsChecked = job.Capacitance.Enabled; HVWindingCapacitanceCheckBox.IsChecked = job.Capacitance.HVEnabled; MVWindingCapacitanceCheckBox.IsChecked = job.Capacitance.MVEnabled; LVWindingCapacitanceCheckBox.IsChecked = job.Capacitance.LVEnabled; WindingDCResistanceCheckBox.IsChecked = job.DCResistance.Enabled; HVWindingDCResistanceCheckBox.IsChecked = job.DCResistance.HVEnabled; MVWindingDCResistanceCheckBox.IsChecked = job.DCResistance.MVEnabled; LVWindingDCResistanceCheckBox.IsChecked = job.DCResistance.LVEnabled; BushingDCInsulationCheckBox.IsChecked = job.Bushing.DCInsulation; BushingCapacitanceCheckBox.IsChecked = job.Bushing.Capacitance; ZCWindingDCInsulationCheckBox.IsChecked = job.DCResistance.ZcEnable; OLTCCheckBox.IsChecked = job.OLTC.Enabled; OLTCRangeTextBox.Text = job.OLTC.Range.ToString(); OLTCRangeMulTextBox.Text = job.OLTC.MulRange.ToString(); OLTCDCResistanceCheckBox.IsChecked = job.OLTC.DCResistance; OLTCSwitchingCheckBox.IsChecked = job.OLTC.SwitchingCharacter; Coreinsulation.IsChecked = job.CoreDCInsulation; Leakagecurrent.IsChecked = job.LossDcresistance; Shortcircuitimpedance.IsChecked = job.Shortcircuitimpedance; DCInsulationTestVoltageComboBox.SelectedIndex = DCInsulationTestVoltageComboBox.Items.Count - 1; while ((job.Parameter.DCInsulationVoltage < SCEEC.Numerics.NumericsConverter.Text2Value(DCInsulationTestVoltageComboBox.Text).value) && (DCInsulationTestVoltageComboBox.SelectedIndex > 0)) { DCInsulationTestVoltageComboBox.SelectedIndex--; } DCInsulationResThTextBox.Text = ((int)(job.Parameter.DCInsulationResistance + 0.5)).ToString(); DCInsulationARTextBox.Text = job.Parameter.DCInsulationAbsorptionRatio.ToString("F1"); CapacitanceTestVoltageComboBox.SelectedIndex = CapacitanceTestVoltageComboBox.Items.Count - 1; while ((job.Parameter.CapacitanceVoltage < SCEEC.Numerics.NumericsConverter.Text2Value(CapacitanceTestVoltageComboBox.Text).value) && (CapacitanceTestVoltageComboBox.SelectedIndex > 0)) { CapacitanceTestVoltageComboBox.SelectedIndex--; } DCResistanceCurrentComboBox.SelectedIndex = DCResistanceCurrentComboBox.Items.Count - 1; while ((job.Parameter.DCResistanceCurrent < SCEEC.Numerics.NumericsConverter.Text2Value(DCResistanceCurrentComboBox.Text).value) && (DCResistanceCurrentComboBox.SelectedIndex > 0)) { DCResistanceCurrentComboBox.SelectedIndex--; } DCHvResistanceCurrentComboBox.SelectedIndex = DCHvResistanceCurrentComboBox.Items.Count - 1; while ((job.Parameter.DCHvResistanceCurrent < SCEEC.Numerics.NumericsConverter.Text2Value(DCHvResistanceCurrentComboBox.Text).value) && (DCHvResistanceCurrentComboBox.SelectedIndex > 0)) { DCHvResistanceCurrentComboBox.SelectedIndex--; } DCMvResistanceCurrentComboBox.SelectedIndex = DCMvResistanceCurrentComboBox.Items.Count - 1; while ((job.Parameter.DCMvResistanceCurrent < SCEEC.Numerics.NumericsConverter.Text2Value(DCMvResistanceCurrentComboBox.Text).value) && (DCMvResistanceCurrentComboBox.SelectedIndex > 0)) { DCMvResistanceCurrentComboBox.SelectedIndex--; } DCLvResistanceCurrentComboBox.SelectedIndex = DCLvResistanceCurrentComboBox.Items.Count - 1; while ((job.Parameter.DCLvResistanceCurrent < SCEEC.Numerics.NumericsConverter.Text2Value(DCLvResistanceCurrentComboBox.Text).value) && (DCLvResistanceCurrentComboBox.SelectedIndex > 0)) { DCLvResistanceCurrentComboBox.SelectedIndex--; } BushingDCInsulationTestVoltageComboBox.SelectedIndex = BushingDCInsulationTestVoltageComboBox.Items.Count - 1; while ((job.Parameter.BushingDCInsulationVoltage < SCEEC.Numerics.NumericsConverter.Text2Value(BushingDCInsulationTestVoltageComboBox.Text).value) && (BushingDCInsulationTestVoltageComboBox.SelectedIndex > 0)) { BushingDCInsulationTestVoltageComboBox.SelectedIndex--; } BushingCapacitanceTestVoltageComboBox.SelectedIndex = BushingCapacitanceTestVoltageComboBox.Items.Count - 1; while ((job.Parameter.BushingCapacitanceVoltage < SCEEC.Numerics.NumericsConverter.Text2Value(BushingCapacitanceTestVoltageComboBox.Text).value) && (BushingCapacitanceTestVoltageComboBox.SelectedIndex > 0)) { BushingCapacitanceTestVoltageComboBox.SelectedIndex--; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) { return; } Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); JobList.DataSource = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 2); JobList.DataBind(); DataView dv = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 3); if (dv != null && dv.Count > 0) { ResponseGridView.DataSource = dv; ResponseGridView.DataBind(); } else { ResponseGridView.Visible = false; lblResponseTitle.Visible = false; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(2, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } dv.Table.Columns.Add("FullName", Type.GetType("System.String")); dv[0]["FullName"] = dv[0]["FirstName"] + " " + dv[0]["MiddleName"] + (String)(dv[0]["MiddleName"].ToString().Length > 0 ? ". " : "") + dv[0]["LastName"]; dv.Table.Columns.Add("ContactInfo", Type.GetType("System.String")); dv[0]["ContactInfo"] = dv[0]["Address"] + "<br>" + dv[0]["Address2"] + "<br>" + dv[0]["Phone"] + "<br>" + dv[0]["EmailProfile"]; dv.Table.Columns.Add("JobCode", Type.GetType("System.String")); dv[0]["JobCode"] = dv[0]["JobPosition"] + " / " + dv[0]["JobAssignmentDescription"]; if (user.FirstName.Length > 0) { lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.Length - 1)).TrimEnd(' '); } dv.Table.Columns.Add("SubjectLevel", Type.GetType("System.String")); dv[0]["SubjectLevel"] = "<table border='0' cellspacing='0' cellpadding='0'>"; //DataView dvCoverage = user.LoadCoverage(Micajah.Common.Security.UserContext.Current.UserId); //if (dvCoverage != null && dvCoverage.Table != null && dvCoverage.Table.Rows.Count > 0) //{ // foreach (DataRow dr in dvCoverage.Table.Rows) // { // if (!dr.IsNull("SubjectName") && !dr.IsNull("LevelName") && !dr.IsNull("ExpireYear") != null) // dv[0]["SubjectLevel"] += "<tr><td><b>" + dr["SubjectName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["LevelName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["ExpireYear"].ToString() + "</b></td></tr>"; // } //} dv[0]["SubjectLevel"] += "</table>"; ViewProfile.DataSource = dv; ViewProfile.DataBind(); Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; }
private void JobChanged(object sender = null, RoutedEventArgs e = null) { ProgressEnd(); if (!inited) { return; } if (HVWindingDCInsulationCheckBox == null) { return; } if (MVWindingDCInsulationCheckBox == null) { return; } if (LVWindingDCInsulationCheckBox == null) { return; } if (HVWindingCapacitanceCheckBox == null) { return; } if (MVWindingCapacitanceCheckBox == null) { return; } if (LVWindingCapacitanceCheckBox == null) { return; } if (HVWindingDCResistanceCheckBox == null) { return; } if (MVWindingDCResistanceCheckBox == null) { return; } if (LVWindingDCResistanceCheckBox == null) { return; } if (BushingDCInsulationCheckBox == null) { return; } if (BushingCapacitanceCheckBox == null) { return; } if (DCHvResistanceCurrentComboBox == null) { return; } if (DCMvResistanceCurrentComboBox == null) { return; } if (DCLvResistanceCurrentComboBox == null) { return; } if (ZCWindingDCInsulationCheckBox == null) { return; } if (OLTCCheckBox == null) { return; } if (OLTCRangeTextBox == null) { return; } if (OLTCDCResistanceCheckBox == null) { return; } if (OLTCSwitchingCheckBox == null) { return; } if (WorkList == null) { return; } if (DCInsulationTestVoltageComboBox == null) { return; } if (DCInsulationResThTextBox == null) { return; } if (DCInsulationARTextBox == null) { return; } if (CapacitanceTestVoltageComboBox == null) { return; } if (DCResistanceCurrentComboBox == null) { return; } if (BushingDCInsulationTestVoltageComboBox == null) { return; } if (BushingCapacitanceTestVoltageComboBox == null) { return; } if (Coreinsulation == null) { return; } if (Leakagecurrent == null) { return; } if (Shortcircuitimpedance == null) { return; } changed = true; JobList jobList = new JobList(); jobList.Transformer = currentTransformer; jobList.DCInsulation.HVEnabled = (HVWindingDCInsulationCheckBox.IsChecked == true); jobList.DCInsulation.MVEnabled = (MVWindingDCInsulationCheckBox.IsChecked == true); jobList.DCInsulation.LVEnabled = (LVWindingDCInsulationCheckBox.IsChecked == true); jobList.Capacitance.HVEnabled = (HVWindingCapacitanceCheckBox.IsChecked == true); jobList.Capacitance.MVEnabled = (MVWindingCapacitanceCheckBox.IsChecked == true); jobList.Capacitance.LVEnabled = (LVWindingCapacitanceCheckBox.IsChecked == true); jobList.DCResistance.HVEnabled = (HVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.MVEnabled = (MVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.LVEnabled = (LVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.ZcEnable = (ZCWindingDCInsulationCheckBox.IsChecked == true); jobList.Bushing.DCInsulation = (BushingDCInsulationCheckBox.IsChecked == true); jobList.Bushing.Capacitance = (BushingCapacitanceCheckBox.IsChecked == true); jobList.OLTC.Range = int.Parse(OLTCRangeTextBox.Text); jobList.OLTC.MulRange = int.Parse(OLTCRangeMulTextBox.Text); jobList.OLTC.DCResistance = (OLTCDCResistanceCheckBox.IsChecked == true); jobList.OLTC.SwitchingCharacter = (OLTCSwitchingCheckBox.IsChecked == true); jobList.Shortcircuitimpedance = (Shortcircuitimpedance.IsChecked == true); jobList.CoreDCInsulation = (Coreinsulation.IsChecked == true); jobList.LossDcresistance = (Leakagecurrent.IsChecked == true); var miList = Translator.JobList2MeasurementItems(jobList); //UseUpanDoWork.LocalUsb.Reinitialize(); //foreach (var mi in miList) //{ // UseUpanDoWork.LocalUsb.StartBuiltTestData(mi, jobList); //} //UpanForWriteToFile.writefile("D:\\Mission", "List.lis", jobList); List <string> miListString = new List <string>(); foreach (var mi in miList) { miListString.Add(mi.Description); } WorkList.ItemsSource = miListString; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblOut.Text = ""; string host = Session["host"].ToString(); string token = Session["token"].ToString(); var instJobList = new JobList(host, token); instJobList.ObtenListaJobs(); // instJobList.todoOK = true; if (!instJobList.todoOK) { lblOut.Text = "<font color ='red'> Error retreiving job list." + "<br>"; lblOut.Text += instJobList.info + "</font> " + " < br >"; return; } // vamos a crea la tabla de datos y el datagrid view DataTable joblistTable = new DataTable(); Job job = new Job(); Type type = typeof(Job); PropertyInfo[] properties = type.GetProperties(); DataTable dtt = new DataTable(); BoundField campo; var campohlink = new HyperLinkField(); foreach (PropertyInfo property in properties) { // Debug info // lblOut.Text += string.Format("{0} = {1} Type ({2})<br>", property.Name, property.GetValue(job, null), // property.PropertyType); // campo = new BoundField(); campo.HeaderText = property.Name; campo.DataField = property.Name; campo.ReadOnly = true; campo.Visible = true; string FieldType = property.PropertyType.ToString(); switch (FieldType) { case "System.String": case "System.Int32": // add datatable column and gridviw column dtt.Columns.Add(property.Name, property.PropertyType); gdvJobs.Columns.Add(campo); if (property.Name == "status") // the hyperlink { //special case translation file after sattus // we need to ad columns in the data table dtt.Columns.Add("actual_hyperlink", property.PropertyType); dtt.Columns.Add("translated_file", property.PropertyType); dtt.Columns.Add("actionCan", property.PropertyType); dtt.Columns.Add("actionCom", property.PropertyType); dtt.Columns.Add("actual_translated_text", property.PropertyType); // and alo in the gridview campohlink = new HyperLinkField(); campohlink.HeaderText = "trans_file"; campohlink.DataTextField = "actual_hyperlink"; campohlink.DataNavigateUrlFields = new string[] { "actual_hyperlink" }; campohlink.DataNavigateUrlFormatString = "{0}"; gdvJobs.Columns.Add(campohlink); campohlink = new HyperLinkField(); campohlink.HeaderText = "ComCom"; campohlink.DataTextField = "actionCom"; campohlink.DataTextFormatString = "{0}"; campohlink.DataNavigateUrlFields = new string[] { "job_key", "actionCom" }; campohlink.DataNavigateUrlFormatString = "ActionJob.aspx?job_key={0}&action={1}"; gdvJobs.Columns.Add(campohlink); campohlink = new HyperLinkField(); campohlink.HeaderText = "Can"; campohlink.DataTextField = "actionCan"; campohlink.DataTextFormatString = "{0}"; campohlink.DataNavigateUrlFields = new string[] { "job_key", "actionCan" }; campohlink.DataNavigateUrlFormatString = "ActionJob.aspx?job_key={0}&action={1}"; gdvJobs.Columns.Add(campohlink); campo = new BoundField(); campo.HeaderText = "actual_translated_text"; campo.DataField = "actual_translated_text"; campo.ReadOnly = true; campo.Visible = true; gdvJobs.Columns.Add(campo); } break; default: Console.WriteLine("Default case"); break; } } // ahora cumplimentamos la tabla cada trabajo es una nueva fila DataRow r; foreach (Job j in instJobList.RootJobList.job) { r = dtt.NewRow(); foreach (PropertyInfo property in properties) { // for debug // lblOut.Text += string.Format("{0} = {1} Type ({2})<br>", property.Name, property.GetValue(j, null), // property.PropertyType); string FieldType = property.PropertyType.ToString(); switch (FieldType) { case "System.String": case "System.Int32": // dt.Columns.Add("code"); r[property.Name] = property.GetValue(j, null); if (property.Name == "status") { if (r[property.Name].ToString() == "COMPLETED") { // translated we should look in the list if (j.translation_type == "file") { foreach (TranslatedFile tf in j.translated_file) { r["translated_file"] = tf.tl; r["actual_hyperlink"] = tf.download_url; } } if (j.translation_type == "text") { foreach (TranslatedText tf in j.translated_text) { r["actual_translated_text"] = tf.translation; } } } else if (r[property.Name].ToString() == "QUEUED") { r["actionCan"] = "CANCEL"; r["actionCom"] = "COMPLETE"; } } break; default: //Console.WriteLine("Default case"); break; } } dtt.Rows.Add(r); } // gdvJobs.DataSource = instJobList.RootJobList.job; gdvJobs.DataSource = dtt; gdvJobs.AutoGenerateColumns = false; gdvJobs.DataBind(); } }
protected Command(JobList jobs, IDictionary <string, IEmployee> employees) : this(jobs, employees, new ConsoleWriter(), new EmployeesFactory()) { }
public void ReceiveJob(JobList job) { }
public Task<JobList> ListJobsAsync() { this.LogMessage("Listing jobs"); var jobDetailList = new JobList(); var changedJobs = new List<JobDetails>(); lock (this.cluster.JobQueue) { foreach (JobDetails jobHistoryItem in this.cluster.JobQueue.Values) { JobDetails changedJob = this.ChangeJobState(jobHistoryItem); jobDetailList.Jobs.Add(changedJob); changedJobs.Add(changedJob); } foreach (JobDetails changedJob in changedJobs) { this.cluster.JobQueue[changedJob.JobId] = changedJob; } } return TaskEx2.FromResult(jobDetailList); }
public override void Execute() { WriteLiteral("\r\n"); #line 8 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Layout = new LayoutPage { Title = "Failed Jobs" }; int from, perPage; int.TryParse(Request.Query["from"], out from); int.TryParse(Request.Query["count"], out perPage); var monitor = JobStorage.Current.GetMonitoringApi(); Pager pager = new Pager(from, perPage, monitor.FailedCount()) { BasePageUrl = Request.LinkTo("/failed") }; JobList <FailedJobDto> failedJobs = monitor .FailedJobs(pager.FromRecord, pager.RecordsPerPage); #line default #line hidden WriteLiteral("\r\n"); #line 26 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (pager.TotalPageCount == 0) { #line default #line hidden WriteLiteral(" <div class=\"alert alert-success\">\r\n You have no failed jobs at the mom" + "ent.\r\n </div>\r\n"); #line 31 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar btn-toolbar-top\">" + "\r\n <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n " + " data-url=\""); #line 37 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Request.LinkTo("/failed/requeue")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Enqueueing...""> <span class=""glyphicon glyphicon-repeat""></span> Requeue jobs </button> <button class=""js-jobs-list-command btn btn-sm btn-default"" data-url="""); #line 44 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Request.LinkTo("/failed/delete")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to DELETE ALL selected jobs?""> <span class=""glyphicon glyphicon-remove""></span> Delete selected </button> "); #line 51 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(RenderPartial(new PerPageSelector(pager))); #line default #line hidden WriteLiteral(@" </div> <table class=""table failed-table""> <thead> <tr> <th class=""min-width""> <input type=""checkbox"" class=""js-jobs-list-select-all"" /> </th> <th class=""min-width"">Id</th> <th>Failed</th> <th>Job</th> </tr> </thead> <tbody> "); #line 66 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" var index = 0; #line default #line hidden #line 67 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" foreach (var job in failedJobs) { #line default #line hidden WriteLiteral(" <tr class=\"js-jobs-list-row "); #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(!job.Value.InFailedState ? "obsolete-data" : null); #line default #line hidden WriteLiteral(" "); #line 69 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "hover" : null); #line default #line hidden WriteLiteral("\">\r\n <td rowspan=\""); #line 70 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "2" : "1"); #line default #line hidden WriteLiteral("\">\r\n"); #line 71 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.InFailedState) { #line default #line hidden WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-list-checkb" + "ox\" name=\"jobs[]\" value=\""); #line 73 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Key); #line default #line hidden WriteLiteral("\" />\r\n"); #line 74 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n <td class=\"min-width\" rows" + "pan=\""); #line 76 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.InFailedState ? "2" : "1"); #line default #line hidden WriteLiteral("\">\r\n <a href=\""); #line 77 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 78 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(HtmlHelper.JobId(job.Key)); #line default #line hidden WriteLiteral("\r\n </a>\r\n"); #line 80 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (!job.Value.InFailedState) { #line default #line hidden WriteLiteral(" <span title=\"Job\'s state has been changed while f" + "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); #line 83 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n <td class=\"min-width\">\r\n"); #line 86 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.FailedAt.HasValue) { #line default #line hidden WriteLiteral(" <span data-moment=\""); #line 88 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(JobHelper.ToTimestamp(job.Value.FailedAt.Value)); #line default #line hidden WriteLiteral("\">\r\n "); #line 89 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.FailedAt); #line default #line hidden WriteLiteral("\r\n </span>\r\n"); #line 91 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n <td>\r\n " + " <div>\r\n <a class=\"job-method\" href=\""); #line 95 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 96 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(HtmlHelper.DisplayMethod(job.Value.Job)); #line default #line hidden WriteLiteral("\r\n </a>\r\n </div>\r\n"); #line 99 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (!String.IsNullOrEmpty(job.Value.ExceptionMessage)) { #line default #line hidden WriteLiteral(" <div style=\"color: #888;\">\r\n " + " "); #line 102 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.Reason); #line default #line hidden WriteLiteral(" <a class=\"expander\" href=\"#\">More details...</a>\r\n " + " </div>\r\n"); #line 104 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n </tr>\r\n"); #line 107 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (job.Value.InFailedState) { #line default #line hidden WriteLiteral(" <tr>\r\n <td colspan=\"2\" class=\"" + "failed-job-details\">\r\n <div class=\"expandable\" st" + "yle=\""); #line 111 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(index++ == 0 ? "display: block;" : null); #line default #line hidden WriteLiteral("\">\r\n <h4>"); #line 112 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.ExceptionType); #line default #line hidden WriteLiteral("</h4>\r\n <p>\r\n " + " "); #line 114 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(job.Value.ExceptionMessage); #line default #line hidden WriteLiteral("\r\n </p>\r\n\r\n"); #line 117 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" if (!String.IsNullOrEmpty(job.Value.ExceptionDetails)) { #line default #line hidden WriteLiteral(" <pre class=\"stack-trace\">"); #line 119 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails)); #line default #line hidden WriteLiteral("</pre>\r\n"); #line 120 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </div>\r\n </td>\r\n " + " </tr>\r\n"); #line 124 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } } #line default #line hidden WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n"); #line 129 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" #line default #line hidden #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" Write(RenderPartial(new Paginator(pager))); #line default #line hidden #line 130 "..\..\Dashboard\Pages\FailedJobsPage.cshtml" } #line default #line hidden }
private void JobConfire(object sender = null, RoutedEventArgs e = null) { if (!inited) { return; } if (HVWindingDCInsulationCheckBox == null) { return; } if (MVWindingDCInsulationCheckBox == null) { return; } if (LVWindingDCInsulationCheckBox == null) { return; } if (HVWindingCapacitanceCheckBox == null) { return; } if (MVWindingCapacitanceCheckBox == null) { return; } if (LVWindingCapacitanceCheckBox == null) { return; } if (HVWindingDCResistanceCheckBox == null) { return; } if (MVWindingDCResistanceCheckBox == null) { return; } if (LVWindingDCResistanceCheckBox == null) { return; } if (BushingDCInsulationCheckBox == null) { return; } if (BushingCapacitanceCheckBox == null) { return; } if (DCHvResistanceCurrentComboBox == null) { return; } if (DCMvResistanceCurrentComboBox == null) { return; } if (DCLvResistanceCurrentComboBox == null) { return; } if (ZCWindingDCInsulationCheckBox == null) { return; } if (OLTCCheckBox == null) { return; } if (OLTCRangeTextBox == null) { return; } if (OLTCDCResistanceCheckBox == null) { return; } if (OLTCSwitchingCheckBox == null) { return; } if (WorkList == null) { return; } if (DCInsulationTestVoltageComboBox == null) { return; } if (DCInsulationResThTextBox == null) { return; } if (DCInsulationARTextBox == null) { return; } if (CapacitanceTestVoltageComboBox == null) { return; } if (DCResistanceCurrentComboBox == null) { return; } if (BushingDCInsulationTestVoltageComboBox == null) { return; } if (BushingCapacitanceTestVoltageComboBox == null) { return; } if (Coreinsulation == null) { return; } if (Leakagecurrent == null) { return; } if (Shortcircuitimpedance == null) { return; } changed = true; JobList jobList = new JobList(); jobList.Transformer = currentTransformer; jobList.DCInsulation.HVEnabled = (HVWindingDCInsulationCheckBox.IsChecked == true); jobList.DCInsulation.MVEnabled = (MVWindingDCInsulationCheckBox.IsChecked == true); jobList.DCInsulation.LVEnabled = (LVWindingDCInsulationCheckBox.IsChecked == true); jobList.Capacitance.HVEnabled = (HVWindingCapacitanceCheckBox.IsChecked == true); jobList.Capacitance.MVEnabled = (MVWindingCapacitanceCheckBox.IsChecked == true); jobList.Capacitance.LVEnabled = (LVWindingCapacitanceCheckBox.IsChecked == true); jobList.DCResistance.HVEnabled = (HVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.MVEnabled = (MVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.LVEnabled = (LVWindingDCResistanceCheckBox.IsChecked == true); jobList.DCResistance.ZcEnable = (ZCWindingDCInsulationCheckBox.IsChecked == true); jobList.Shortcircuitimpedance = (Shortcircuitimpedance.IsChecked == true); jobList.CoreDCInsulation = (Coreinsulation.IsChecked == true); jobList.LossDcresistance = (Leakagecurrent.IsChecked == true); jobList.Bushing.DCInsulation = (BushingDCInsulationCheckBox.IsChecked == true); jobList.Bushing.Capacitance = (BushingCapacitanceCheckBox.IsChecked == true); jobList.OLTC.Range = int.Parse(OLTCRangeTextBox.Text); jobList.OLTC.MulRange = int.Parse(OLTCRangeMulTextBox.Text); jobList.OLTC.DCResistance = (OLTCDCResistanceCheckBox.IsChecked == true); jobList.OLTC.SwitchingCharacter = (OLTCSwitchingCheckBox.IsChecked == true); jobList.Parameter.BushingCapacitanceVoltage = (int)Convert.ToDouble(BushingCapacitanceTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000; jobList.Parameter.BushingDCInsulationVoltage = (int)Convert.ToDouble(BushingDCInsulationTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000; jobList.Parameter.CapacitanceVoltage = (int)Convert.ToDouble(CapacitanceTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000; jobList.Parameter.DCInsulationAbsorptionRatio = 5; jobList.Parameter.DCInsulationResistance = 5; jobList.Parameter.DCInsulationVoltage = (int)Convert.ToDouble(DCInsulationTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000; jobList.Parameter.DCResistanceCurrent = Getc(DCResistanceCurrentComboBox); jobList.Parameter.DCHvResistanceCurrent = Getc(DCHvResistanceCurrentComboBox); jobList.Parameter.DCMvResistanceCurrent = Getc(DCMvResistanceCurrentComboBox); jobList.Parameter.DCLvResistanceCurrent = Getc(DCLvResistanceCurrentComboBox); #region var miList = Translator.JobList2MeasurementItems(jobList); TestingInfoWindow testingInfo = new TestingInfoWindow(miList); JobList job = jobList; job.id = GetId(); if (testingInfo.ShowDialog() == true) { job.Information = testingInfo.Information; } UseUpanDoWork.LocalUsb.Reinitialize(); foreach (var mi in miList) { UseUpanDoWork.LocalUsb.StartBuiltTestData(mi, jobList); } //自动检索Upan #if true string[] drives = Environment.GetLogicalDrives(); UpanForWriteToFile.writefile(drives[drives.Length - 1], "List.lis", job, miList, JobNameTextBox.Text.Trim()); #endif // UpanForWriteToFile.writefile("D:\\", "List.lis", jobList, miList); List <string> miListString = new List <string>(); foreach (var mi in miList) { miListString.Add(mi.Description); } WorkList.ItemsSource = miListString; #endregion }
public JobCommand(JobList jobs, IDictionary <string, IEmployee> employees, IWriter writer, IEmployeesFactory employeesFactory) : base(jobs, employees, writer, employeesFactory) { }
public Engine(JobList jobs, ICollection <IEmployee> employees, IEmployeeFactory employeeFactory) { this.jobs = jobs; this.employees = employees; this.employeeFactory = employeeFactory; }
public static DataTable createComments(int intJobRef, string strSuffixCode, string strCountry, AspectResultSet aspectResultSet, HealthResultSet healthResultSet, LevelResultSet levelResultSet, SkillsResultSet skillsResultSet) { string asComment = ""; string geComment = ""; // string htComment = ""; string lvComment = ""; string skcomment = ""; int i,x,cd,sd,od,cdnm,sdnm,slvm,clvm; int tmpcat,cscomm,sscomm; string strTemp; string aspecttblname = strCountry; DataTable dtAspects = CCLib.Cache.GetCachedDataTableWithNoExpire("MM_ALL_JOBS_" + strSuffixCode, "SELECT tblAspects" + aspecttblname + ".OccNumber, Central, Secondary, ID, Other, Education, EssentialSkills, DesirableSkills, OccName FROM Jobinfo" + strSuffixCode + " INNER JOIN tblAspects" + aspecttblname + " ON Jobinfo" + strSuffixCode + ".OccNumber = tblAspects" + aspecttblname + ".OccNumber order by OccName"); bool [] levelvals= new bool[MaxNoOfLevels+1]; bool [] healthvals= new bool[MaxNoOfHealth+1]; int [] aspectres= new int[MaxNoOfAspects+1] ; CreateFastClientArrays(aspectResultSet, levelResultSet, healthResultSet, healthvals, levelvals, aspectres); DataRow[] dr = dtAspects.Select("occnumber=" + intJobRef); //jm 02/11/2006 - added catch here.. if (dr.Length > 0) { DataRow rt = dr[0]; //should probably catch this //score job JobItem ji = new JobItem(); ji.Score = ScoreArticle(rt, healthvals, levelvals, aspectres, ref ji.MatchCat, ref ji.MatchMore); ji.JobRef = Convert.ToInt16(rt["OccNumber"].ToString()); ji.JobTitle = rt["OccName"].ToString(); //prepare general comment tmpcat = ji.MatchCat / 100; if ((ji.MatchMore) && (tmpcat != 7)) { geComment = geComment + "00"; }; cscomm = 0; sscomm = 0; cd = 0; cdnm = 0; clvm = 0; sd = 0; sdnm = 0; slvm = 0; od = 0; // check for unanswered core and secondry and store dislikes and LVM counts strTemp = rt["Central"].ToString(); for (i = 0; (i + 1) < strTemp.Length; i = i + 3) { x = aspectres[Convert.ToInt16(strTemp.Substring(i, 3))]; switch (x) { case 0: cscomm = cscomm + 1; break; case 1: cd = cd + 1; break; case 2: cd = cd + 1; break; case 3: cdnm = cdnm + 1; break; case 5: clvm = clvm + 1; break; case 6: clvm = clvm + 1; break; } } strTemp = rt["Secondary"].ToString(); for (i = 0; (i + 1) < strTemp.Length; i = i + 3) { x = aspectres[Convert.ToInt16(strTemp.Substring(i, 3))]; switch (x) { case 0: sscomm = sscomm + 1; break; case 1: sd = sd + 1; break; case 2: sd = sd + 1; break; case 3: sdnm = sdnm + 1; break; case 5: slvm = slvm + 1; break; case 6: slvm = slvm + 1; break; } } strTemp = rt["Other"].ToString(); for (i = 0; (i + 1) < strTemp.Length; i = i + 3) { x = aspectres[Convert.ToInt16(strTemp.Substring(i, 3))]; switch (x) { case 1: od = od + 1; break; case 2: od = od + 1; break; } } //if unaswered core or secondry then return appropriate comment if (cscomm > 1) { geComment = geComment + "07"; } else if (cscomm == 1) { geComment = geComment + "08"; } else if (sscomm > 1) { geComment = geComment + "09"; } else if (sscomm == 1) { geComment = geComment + "10"; }; if (!ji.MatchMore) { switch (tmpcat) { case 1: geComment = geComment + "01"; break; case 2: geComment = geComment + "02"; break; case 3: geComment = geComment + "03"; break; case 4: geComment = geComment + "04"; break; case 5: geComment = geComment + "04"; break; case 6: geComment = geComment + "05"; break; case 7: geComment = geComment + "05"; break; case 8: geComment = geComment + "06"; break; }; }; //end of general comment //aspect comment asComment = ""; tmpcat = (ji.MatchCat % 100); if (ji.MatchMore) { asComment = "00"; // return positive comments if (clvm == 1) { asComment = asComment + "10"; }; if (clvm > 1) { asComment = asComment + "11"; }; if (slvm == 1) { asComment = asComment + "12"; }; if (slvm > 1) { asComment = asComment + "13"; }; } else { switch (tmpcat) { case 1: asComment = "01"; break; case 2: asComment = "02"; break; case 3: asComment = "03"; break; case 4: asComment = "04"; break; case 5: asComment = "05"; break; } //return negative comments if (cd > 1) { asComment = asComment + "01"; }; if (cd == 1) { asComment = asComment + "02"; }; if (cdnm > 1) { asComment = asComment + "03"; }; if (cdnm == 1) { asComment = asComment + "04"; }; if (sd > 1) { asComment = asComment + "05"; }; if (sd == 1) { asComment = asComment + "06"; }; if (sdnm > 3) { asComment = asComment + "07"; }; if (od > 1) { asComment = asComment + "08"; }; if (od == 1) { asComment = asComment + "09"; }; }; //end of aspect comments //start of level comments lvComment = ""; int iLvlCount = 0; foreach (LevelResult lr in levelResultSet) { iLvlCount = (lr.LevelResponse == true) ? iLvlCount + 1 : iLvlCount; } if (iLvlCount == 0) { lvComment = "07"; }//mrm changed to use flags not levelResultSet.Count else { bool accept = true; //if all levels are selected for (i = 1; i <= 5; i++) { if (levelvals[i] == false) { accept = false; };}; if (accept == true) { lvComment = "06"; } else //else calc comments { //mrm need to look at flags if (levelResultSet.Count > 1) { lvComment = "00"; }; if (iLvlCount > 1) { lvComment = "00"; }; x = 0; for (i = 1; i <= 5; i++) { if (levelvals[i] == true) { x = i; }; }//get highest level switch (rt["Education"].ToString().Substring(x - 1, 1))//mrm 19/4/2006 bug fix - was x { case "+": lvComment = lvComment + "01"; break; case "A": lvComment = lvComment + "02"; break; case "N": lvComment = lvComment + "03"; break; case "B": lvComment = lvComment + "04"; break; case "-": lvComment = lvComment + "05"; break; } } }; //end of level comments //skills comment int e1 = 0; int e2 = 0; int e3 = 0; int e4 = 0; int e5 = 0; int e0 = 0; int d1 = 0; int d2 = 0; int d3 = 0; int d4 = 0; int d5 = 0; int d0 = 0; if (rt["EssentialSkills"].ToString().Length > 0) { for (i = 0; i < rt["EssentialSkills"].ToString().Length; i = i + 3) { SkillsResult skillsResult = skillsResultSet.Find( delegate(SkillsResult sr) { return sr.SkillsRef == Convert.ToInt32(rt["EssentialSkills"].ToString().Substring(i, 3)); } ); if (skillsResult != null) { switch (skillsResult.SkillsResponse) { case 0: e0 = e0 + 1; break; case 1: e1 = e1 + 1; break; case 2: e2 = e2 + 1; break; case 3: e3 = e3 + 1; break; case 4: e4 = e4 + 1; break; case 5: e5 = e5 + 1; break; default: e0 = e0 + 1; break; } } else { e0 = e0 + 1; }; } } if (rt["DesirableSkills"].ToString().Length > 0) { for (i = 0; i < rt["DesirableSkills"].ToString().Length; i = i + 3) { SkillsResult skillsResult = skillsResultSet.Find( delegate(SkillsResult sr) { return sr.SkillsRef == Convert.ToInt32(rt["DesirableSkills"].ToString().Substring(i, 3)); } ); if (skillsResult != null) { switch (skillsResult.SkillsResponse) { case 0: d0 = d0 + 1; break; case 1: d1 = d1 + 1; break; case 2: d2 = d2 + 1; break; case 3: d3 = d3 + 1; break; case 4: d4 = d4 + 1; break; case 5: d5 = d5 + 1; break; default: d0 = d0 + 1; break; } } else { d0 = d0 + 1; }; } } // get skills cat JobList jl = new JobList(); jl.Add(ji); getSkillsCategories(strCountry, jl, skillsResultSet); skcomment = "0" + ji.SkillsCat.ToString() + '0' + ji.SkillsCat.ToString(); if (e2 == 1) { skcomment = skcomment + "01"; }; if (e2 == 2) { skcomment = skcomment + "02"; }; if (e2 == 3) { skcomment = skcomment + "03"; }; if (e2 >= 4) { skcomment = skcomment + "04"; }; if (e1 == 1) { skcomment = skcomment + "05"; }; if (e1 == 2) { skcomment = skcomment + "06"; }; if (e1 == 3) { skcomment = skcomment + "07"; }; if (e1 == 4) { skcomment = skcomment + "08"; }; if (e1 > 4) { skcomment = skcomment + "09"; }; if (d2 == 1) { skcomment = skcomment + "10"; }; if (d2 == 2) { skcomment = skcomment + "11"; }; if (d2 == 3) { skcomment = skcomment + "12"; }; if (d2 == 4) { skcomment = skcomment + "13"; }; if (d2 == 5) { skcomment = skcomment + "14"; }; if (d2 > 5) { skcomment = skcomment + "15"; }; if (d1 == 1) { skcomment = skcomment + "16"; }; if (d1 == 2) { skcomment = skcomment + "17"; }; if (d1 == 3) { skcomment = skcomment + "18"; }; if (d1 == 4) { skcomment = skcomment + "19"; }; if (d1 == 5) { skcomment = skcomment + "20"; }; if (d1 > 5) { skcomment = skcomment + "21"; }; if (skcomment == "") { skcomment = "00"; }; //end skills comment DataTable dt = new DataTable(); dt.Columns.Add("General", typeof(string)); dt.Columns.Add("Aspect", typeof(string)); dt.Columns.Add("Level", typeof(string)); dt.Columns.Add("Skill", typeof(string)); dt.Rows.Add(); dt.Rows[0]["General"] = geComment; dt.Rows[0]["Aspect"] = asComment; dt.Rows[0]["Level"] = lvComment; dt.Rows[0]["Skill"] = skcomment; return (dt); } else { //we didn't find the job aspects DataTable dt = new DataTable(); return (dt); } }
public Apothecary(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.APOTHECARY; _coefficient = 15; }
public IList <QueueWithTopEnqueuedJobsDto> Queues() { return(_dispatcher.QueryAndWait(state => { var result = new List <QueueWithTopEnqueuedJobsDto>(); foreach (var queueEntry in state.Queues) { var queueResult = new JobList <EnqueuedJobDto>(Enumerable.Empty <KeyValuePair <string, EnqueuedJobDto> >()); var counter = 0; var from = 0; var perPage = 5; foreach (var message in queueEntry.Value.Queue) { if (counter < from) { counter++; continue; } if (counter >= from + perPage) { break; } Job job = null; if (state.Jobs.TryGetValue(message, out var jobEntry)) { try { job = jobEntry.InvocationData.DeserializeJob(); } catch (JobLoadException) { } } queueResult.Add(new KeyValuePair <string, EnqueuedJobDto>(message, new EnqueuedJobDto { Job = job, State = jobEntry?.State?.Name, InEnqueuedState = EnqueuedState.StateName.Equals(jobEntry?.State?.Name, StringComparison.OrdinalIgnoreCase), EnqueuedAt = jobEntry?.State?.CreatedAt })); counter++; } result.Add(new QueueWithTopEnqueuedJobsDto { Fetched = 0, Length = queueEntry.Value.Queue.Count, Name = queueEntry.Key, FirstJobs = queueResult }); } return result; })); }
public static TOWList buildTOWList(string strSuffixCountryLangCode, string strSuffixCode, JobList jl, string strCluster) { //first we create a TOWlist TOWList tl = new TOWList(); //now we get each row from the underlying tables... //mrm string strTmpLang = strLangCode; // string strTmpSuffix = strSuffixCode; // if (strTmpLang == "EN"){strTmpLang ="";} // else{strTmpLang = "_"+strTmpLang;}; // if (strTmpSuffix=="CA") {strTmpSuffix ="Canada";}; // DataTable dt = CCLib.Cache.GetCachedDataTableWithNoExpire("ClusterCodes_"+ strCluster + "_" + strTmpLang, "select clustercode as code, clustename"+strTmpLang+" as title from clustercodes where clustertype='"+strCluster+"'"); DataTable dt = CCLib.Cache.GetCachedDataTableWithNoExpire("ClusterCodes_"+strSuffixCode+"_"+strCluster, "select clustercode as code, clustename" + strSuffixCode + " as title from clustercodes where clustertype='" + strCluster + "'"); foreach (DataRow rt in dt.Rows) { TOWItem ti = new TOWItem(); ti.Title = rt["title"].ToString(); ti.Code = rt["code"].ToString(); tl.Add(ti); }; //now we get the cluster vs job list //mrm DataTable dtCluster = CCLib.Cache.GetCachedDataTable("Cluster" + strSuffixCode + "_" + strLangCode, "select * from Clusters" + strSuffixCode + "_" + strLangCode + "_View"); DataTable dtCluster = CCLib.Cache.GetCachedDataTable("Cluster" + strSuffixCountryLangCode, "select * from Clusters" + strSuffixCountryLangCode + "_View"); DataRow[] drsClusterCodes; // string strClusterType = "CCClusters";//mrm remove not used foreach (JobItem ji in jl) { string strSQL="OccNumber=" + ji.JobRef.ToString(); drsClusterCodes = dtCluster.Select(strSQL); //now we find the matching clusters if (drsClusterCodes.Length >0) { //mrm string strFoundCode = drsClusterCodes[0][strClusterType].ToString(); string strFoundCode = drsClusterCodes[0][strCluster].ToString(); List<TOWItem> tltmp = tl.FindAll(delegate(TOWItem towitem){return(strFoundCode.IndexOf(towitem.Code)>=0);}); foreach(TOWItem tOWItem in tltmp) { tOWItem.Score = tOWItem.Score + (jl.Count - ji.Rank)+1; }; }; //yuk!! sequential search - need to check for better way } //sort the list by score tl.Sort(delegate(TOWItem x, TOWItem y) { return Comparer.Default.Compare(y.Score, x.Score); }); if (tl.Count >2) { tl.RemoveRange(2, tl.Count - 2); }; for (int i = 0; i < tl.Count; i++) { if (tl[i].Score < 83) { tl.Remove(tl[i]); i = i - 1; }; }; return(tl); }
private void SaveAPResults(JobList jl) { string strAPMatch = ""; string strAPNotMatch = ""; string strMatchRefs = ""; for (int i = 0; i < jl.Count; i++) { if (strAPMatch != "") { strAPMatch = strAPMatch + ";"; } if (strAPNotMatch != "") { strAPNotMatch = strAPNotMatch + ";"; } if (strMatchRefs != "") { strMatchRefs = strMatchRefs + ";"; }; strMatchRefs = strMatchRefs + jl[i].JobRef.ToString(); strAPMatch += jl[i].APMatchCat.ToString(); strAPNotMatch += jl[i].APNotMatchCat.ToString(); }; if (CCLib.Common.DataAccess.GetValue("select count(SavedMatchMakerID) from Port_SavedMatchMaker where PortfolioID=" + LoginInfo["PID"].ToString()).ToString() != "0") { if (strMMID != null && strMMID != "") strSQL = "update Port_SavedMatchMaker set APMatch='" + strAPMatch.Replace("'", "''") + "',APNotMatch='" + strAPNotMatch.Replace("'", "''") + "' where PortfolioID= " + LoginInfo["PID"].ToString() + " and SavedMatchMakerID=" + strMMID; else strSQL = "update Port_SavedMatchMaker set APMatch='" + strAPMatch.Replace("'", "''") + "',APNotMatch='" + strAPNotMatch.Replace("'", "''") + "' where PortfolioID= " + LoginInfo["PID"].ToString(); CCLib.Common.DataAccess.ExecuteDb(strSQL); } //else //strSQL = "insert into Port_SavedMatchMaker (PortfolioID,OccNumbers,APMatch,APNotMatch) values(" + LoginInfo["PID"].ToString() + ",'" + strMatchRefs.Replace("'", "''") + "','" + strAPMatch.Replace("'", "''") + "','" + strAPNotMatch.Replace("'", "''") + "')"; }
/// <summary> /// Destroy village /// </summary> internal override void OnDestroy() { JobsList.Destroy(); JobsList = null; Debug.Assert(_familiesList.Count == 0, @"(village, OnDestroy) Still family in village"); }
public override void Execute() { WriteLiteral("\n"); #line 7 "..\..\Pages\ScheduledJobsPage.cshtml" Layout = new LayoutPage { Title = "Scheduled Jobs" }; int from, perPage; int.TryParse(Request.QueryString["from"], out from); int.TryParse(Request.QueryString["count"], out perPage); var monitor = JobStorage.Current.GetMonitoringApi(); Pager pager = new Pager(from, perPage, monitor.ScheduledCount()) { BasePageUrl = Request.LinkTo("/scheduled") }; JobList <ScheduledJobDto> scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage); #line default #line hidden WriteLiteral("\n"); #line 24 "..\..\Pages\ScheduledJobsPage.cshtml" if (pager.TotalPageCount == 0) { #line default #line hidden WriteLiteral(" <div class=\"alert alert-info\">\n There are no scheduled jobs.\n </div" + ">\n"); #line 29 "..\..\Pages\ScheduledJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <div class=\"js-jobs-list\">\n <div class=\"btn-toolbar btn-toolbar-top\">\n" + " <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n " + " data-url=\""); #line 35 "..\..\Pages\ScheduledJobsPage.cshtml" Write(Request.LinkTo("/scheduled/enqueue")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Enqueueing...""> <span class=""glyphicon glyphicon-play""></span> Enqueue now </button> <button class=""js-jobs-list-command btn btn-sm btn-default"" data-url="""); #line 42 "..\..\Pages\ScheduledJobsPage.cshtml" Write(Request.LinkTo("/scheduled/delete")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to DELETE ALL selected jobs?""> <span class=""glyphicon glyphicon-remove""></span> Delete selected </button> "); #line 49 "..\..\Pages\ScheduledJobsPage.cshtml" Write(RenderPartial(new PerPageSelector(pager))); #line default #line hidden WriteLiteral(@" </div> <table class=""table""> <thead> <tr> <th class=""min-width""> <input type=""checkbox"" class=""js-jobs-list-select-all"" /> </th> <th class=""min-width"">Id</th> <th>Enqueue</th> <th>Job</th> <th class=""align-right"">Scheduled</th> </tr> </thead> "); #line 64 "..\..\Pages\ScheduledJobsPage.cshtml" foreach (var job in scheduledJobs) { #line default #line hidden WriteLiteral(" <tr class=\"js-jobs-list-row "); #line 66 "..\..\Pages\ScheduledJobsPage.cshtml" Write(!job.Value.InScheduledState ? "obsolete-data" : null); #line default #line hidden WriteLiteral(" "); #line 66 "..\..\Pages\ScheduledJobsPage.cshtml" Write(job.Value.InScheduledState ? "hover" : null); #line default #line hidden WriteLiteral("\">\n <td>\n"); #line 68 "..\..\Pages\ScheduledJobsPage.cshtml" if (job.Value.InScheduledState) { #line default #line hidden WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" " + "name=\"jobs[]\" value=\""); #line 70 "..\..\Pages\ScheduledJobsPage.cshtml" Write(job.Key); #line default #line hidden WriteLiteral("\" />\n"); #line 71 "..\..\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n <td class=\"min-width\">\n " + " <a href=\""); #line 74 "..\..\Pages\ScheduledJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\n "); #line 75 "..\..\Pages\ScheduledJobsPage.cshtml" Write(HtmlHelper.JobId(job.Key)); #line default #line hidden WriteLiteral("\n </a>\n"); #line 77 "..\..\Pages\ScheduledJobsPage.cshtml" if (!job.Value.InScheduledState) { #line default #line hidden WriteLiteral(" <span title=\"Job\'s state has been changed while fetch" + "ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n"); #line 80 "..\..\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n <td class=\"min-width\">\n " + " <span data-moment=\""); #line 83 "..\..\Pages\ScheduledJobsPage.cshtml" Write(JobHelper.ToStringTimestamp(job.Value.EnqueueAt)); #line default #line hidden WriteLiteral("\">\n "); #line 84 "..\..\Pages\ScheduledJobsPage.cshtml" Write(job.Value.EnqueueAt); #line default #line hidden WriteLiteral("\n </span>\n </td>\n <t" + "d>\n <a class=\"job-method\" href=\""); #line 88 "..\..\Pages\ScheduledJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\n "); #line 89 "..\..\Pages\ScheduledJobsPage.cshtml" Write(HtmlHelper.DisplayMethod(job.Value.Job)); #line default #line hidden WriteLiteral("\n </a>\n </td>\n <td c" + "lass=\"align-right\">\n"); #line 93 "..\..\Pages\ScheduledJobsPage.cshtml" if (job.Value.ScheduledAt != null) { #line default #line hidden WriteLiteral(" <span data-moment=\""); #line 95 "..\..\Pages\ScheduledJobsPage.cshtml" Write(JobHelper.ToStringTimestamp(job.Value.ScheduledAt.Value)); #line default #line hidden WriteLiteral("\">\n "); #line 96 "..\..\Pages\ScheduledJobsPage.cshtml" Write(job.Value.ScheduledAt); #line default #line hidden WriteLiteral("\n </span>\n"); #line 98 "..\..\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n </tr>\n"); #line 101 "..\..\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </table>\n </div>\n"); #line 104 "..\..\Pages\ScheduledJobsPage.cshtml" #line default #line hidden #line 105 "..\..\Pages\ScheduledJobsPage.cshtml" Write(RenderPartial(new Paginator(pager))); #line default #line hidden #line 105 "..\..\Pages\ScheduledJobsPage.cshtml" } #line default #line hidden }
public void testSequence() { // Login, generate API key, logout this.apiToken = this.actions.Login(this.config.username, this.config.password); this.secureKey = this.actions.GenerateAPIKey(this.apiToken, this.config.username, true); this.actions.Logout(this.apiToken); this.apiToken = Guid.Empty; // Login using API key this.apiToken = this.actions.Login(this.config.username, this.secureKey); // Create a job using a media URL this.jobId = this.actions.CreateJob(this.apiToken, ".NET_test_job").JobId; this.actions.AddMediaToJob(this.apiToken, this.jobId, this.config.sampleVideoUri); // Assert JobList and JobInfo data JobList list = this.actions.GetJobList(this.apiToken); Assert.IsTrue(this.containsJob(this.jobId, list), "JobId not found in JobList"); Job job = this.actions.GetJobInfo(this.apiToken, this.jobId); Assert.AreEqual(this.jobId, job.JobId, "Wrong JobId found in JobInfo"); // Logout this.actions.Logout(this.apiToken); this.apiToken = Guid.Empty; // Login/logout/change password this.apiToken = this.actions.Login(this.config.username, this.config.password); this.actions.UpdatePassword(this.apiToken, this.config.newPassword); this.actions.Logout(this.apiToken); this.apiToken = Guid.Empty; // Change password back this.apiToken = this.actions.Login(this.config.username, this.config.newPassword); this.actions.UpdatePassword(this.apiToken, this.config.password); this.actions.Logout(this.apiToken); this.apiToken = Guid.Empty; // Login using API key this.apiToken = this.actions.Login(this.config.username, this.secureKey); // Delete job and assert JobList data this.actions.DeleteJob(this.apiToken, this.jobId); JobList list2 = this.actions.GetJobList(this.apiToken); Assert.IsFalse(this.containsJob(this.jobId, list2), "JobId should not be in JobList"); // Delete current API key and try to re-login (should fail) this.actions.RemoveAPIKey(this.apiToken, this.secureKey); this.actions.Logout(this.apiToken); this.apiToken = Guid.Empty; try { this.apiToken = this.actions.Login(this.config.username, this.secureKey); Assert.Fail("Should not be able to login using invalid API key"); } catch (EnumWebException e) { Assert.AreEqual(ErrorType.ACCOUNT_UNPRIVILEGED.ToString(), e.ErrorType, "Unexpected error type"); } }
public IHttpActionResult DeleteJob(int jobId, JobList jobList) { _repository.Delete(jobId); return(CreatedAtRoute("GetJobLists", new { Id = jobList.JobListID }, jobList)); }
public JobRepeatBase GetJobBase(string key) { return(JobList.Find(x => x.key == key)); }
bool EnoughFarms; // Just for the event #endregion Fields #region Constructors public Farmer(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.FARMER; _coefficient = 10; }
public Blacksmith(Game game, JobList list, string name) : base(game, list, name) { _job = Jobs.BLACKSMITH; _coefficient = 10; }
private string _findArmorUnidentifiedResource <TKey>(ReadableTuple <int> tupleSource, ReadableTuple <TKey> item) { List <Job> jobs = JobList.GetApplicableJobsFromHex(tupleSource.GetValue <string>(ServerItemAttributes.ApplicableJob)); int location = _getInt(ServerItemAttributes.Location, tupleSource); if (_is(location, 32)) { return("°¡µå"); } if (_is(location, 1, 256, 512, 1024, 2048, 4096)) { if (_overridableString(item, ClientItemAttributes.UnidentifiedResourceName, "¸Ó¸®¶ì", "±Û·¡½º", "Ç︧", "ĸ", "½º¸¶ÀÏ")) { return(null); } if (location == 513) { return("½º¸¶ÀÏ"); } if (location == 512) { return("±Û·¡½º"); } if (_is(location, 256)) { if (jobs.All(p => JobList.GetFirstClass(p) == JobList.Swordman)) { return("Ç︧"); } } return("ĸ"); } if (_is(location, 16)) { if (_overridableString(tupleSource, ServerItemAttributes.Name, "Armor")) { return("¿ìµç¸ÞÀÏ"); } if (_overridableString(tupleSource, ServerItemAttributes.Name, "Clothe", "Robe", " Suit", "Coat")) { return("ÄÚÆ°¼ÅÃ÷"); } if (jobs.Contains(JobList.Novice) || jobs.Any(p => JobList.GetFirstClass(p) == JobList.Acolyte)) { return("ÄÚÆ°¼ÅÃ÷"); } int weight = _getInt(ServerItemAttributes.Weight, tupleSource); if (weight >= 1000) { return("¿ìµç¸ÞÀÏ"); } return("ÄÚÆ°¼ÅÃ÷"); } if (_is(location, 64)) { return("»÷µé"); } if (_is(location, 4)) { return("Èĵå"); } if (_is(location, 8, 128)) { return("¸µ"); } return(null); }
private void UpdateScore(JobList jl) { DataTable dtCareer; double dblAR, dblCM, dblVA, dblSA, dblCP, dblFP, dblStuAR, dblStuCM, dblStuVA, dblStuSA, dblStuCP, dblStuFP; scoTest = new CareerCruisingWeb.CCLib.AbilityProfiler.Score(); string strSQL = "select b.APTestID,SectionID,Answers,Percentile from AP_SavedSection a join AP_SavedTest b on a.APTestID = b.APTestID and PortfolioID=" + LoginInfo["PID"].ToString() + " and IsActiveStatus = 1 order by a.SectionID"; DataTable dtAnswers = CCLib.Common.DataAccess.GetDataTable(strSQL); if (dtAnswers.Rows.Count >= 6) { if (dtAnswers.Rows[0]["Percentile"].ToString() == "") { for (int i = 0; i < dtAnswers.Rows.Count; i++) { strAnswers[i] = dtAnswers.Rows[i]["Answers"].ToString(); } scoTest.ScoreTest(strAnswers); dtCareer = scoTest.Occupations; strSQL = ""; for (int j = 0; j < 6; j++) { strSQL += "update AP_SavedSection set CorrectAnswers = " + scoTest.CorrectAnswers[j].ToString() + ", ConvertedScore = " + scoTest.ScaledScores[scoTest.SubTestMatchingAbilityNameIndex[j]].ToString() + ", Percentile = " + scoTest.PercentileScores[j].ToString() + " where APTestID=" + dtAnswers.Rows[0]["APTestID"].ToString() + " and SectionID = " + Convert.ToString(j + 1) + "; "; } CCLib.Common.DataAccess.ExecuteNonQuery(strSQL); strSQL = "select b.APTestID,SectionID,Answers,Percentile from AP_SavedSection a join AP_SavedTest b on a.APTestID = b.APTestID and PortfolioID=" + LoginInfo["PID"].ToString() + " and IsActiveStatus = 1 order by a.SectionID"; dtAnswers = CCLib.Common.DataAccess.GetDataTable(strSQL); } else { scoTest.IdentifyOccupations(); dtCareer = scoTest.Occupations; } foreach (JobItem ji in jl) { DataRow[] dr = dtCareer.Select("OccNumber=" + ji.JobRef.ToString()); if (dr.Length > 0) { dblAR = Convert.ToDouble(dr[0]["ARPercentile"].ToString()); dblCM = Convert.ToDouble(dr[0]["CMPPercentile"].ToString()); dblVA = Convert.ToDouble(dr[0]["Vpercentile"].ToString()); dblSA = Convert.ToDouble(dr[0]["Spercentile"].ToString()); dblCP = Convert.ToDouble(dr[0]["Qpercentile"].ToString()); dblFP = Convert.ToDouble(dr[0]["Ppercentile"].ToString()); dblStuAR = Convert.ToDouble(dtAnswers.Rows[0]["Percentile"].ToString()); dblStuCM = Convert.ToDouble(dtAnswers.Rows[3]["Percentile"].ToString()); dblStuVA = Convert.ToDouble(dtAnswers.Rows[1]["Percentile"].ToString()); dblStuSA = Convert.ToDouble(dtAnswers.Rows[2]["Percentile"].ToString()); dblStuCP = Convert.ToDouble(dtAnswers.Rows[4]["Percentile"].ToString()); dblStuFP = Convert.ToDouble(dtAnswers.Rows[5]["Percentile"].ToString()); //get Difference int intAPMatch = 0; int intAPNotMatch = 0; if (getDifference(dblStuAR, dblAR) == 1) intAPMatch++; else intAPNotMatch++; if (getDifference(dblStuCM, dblCM) == 1) intAPMatch++; else intAPNotMatch++; if (getDifference(dblStuVA, dblVA) == 1) intAPMatch++; else intAPNotMatch++; if (getDifference(dblStuSA, dblSA) == 1) intAPMatch++; else intAPNotMatch++; if (getDifference(dblStuCP, dblCP) == 1) intAPMatch++; else intAPNotMatch++; if (getDifference(dblStuFP, dblFP) == 1) intAPMatch++; else intAPNotMatch++; ji.APMatchCat = intAPMatch.ToString(); ji.APNotMatchCat = intAPNotMatch.ToString(); } else { ji.APMatchCat = "N/A"; ji.APNotMatchCat = "N/A"; } } SaveAPResults(jl); } }
private IEnumerator CoJobHandle(string key) { yield return(null); JobRepeatBase findJob = JobList.Find(x => x.key == key); if (findJob == null) { yield break; } switch (findJob.state) { case JOB_STATE.JOB_EMPTY: yield break; case JOB_STATE.JOB_STANDBY: if (findJob.jobToDoCheck != null) { if (findJob.jobToDoCheck(findJob.parameter)) { findJob.state = JOB_STATE.JOB_WORKING; findJob.jobTodo?.Invoke(findJob.parameter); if (findJob.jobCoroutine != null) { yield return(StartCoroutine(findJob.jobCoroutine)); } findJob.excuteCount++; if (findJob.excuteCount >= findJob.repeatCount && findJob.repeatCount != 0) { findJob.state = JOB_STATE.JOB_DROP; } else { findJob.state = JOB_STATE.JOB_WAITING; } } } else { findJob.state = JOB_STATE.JOB_WORKING; findJob.jobTodo?.Invoke(findJob.parameter); if (findJob.jobCoroutine != null) { yield return(StartCoroutine(findJob.jobCoroutine)); } findJob.excuteCount++; if (findJob.excuteCount >= findJob.repeatCount && findJob.repeatCount != 0) { findJob.state = JOB_STATE.JOB_DROP; } else { findJob.state = JOB_STATE.JOB_WAITING; } } if (findJob.jobAutoDropCheck != null) { if (findJob.jobAutoDropCheck(findJob.parameter)) { findJob.state = JOB_STATE.JOB_DROP; break; } } break; case JOB_STATE.JOB_WAITING: WaitForSeconds WaitForDelay = new WaitForSeconds(findJob.repeatDelay); yield return(WaitForDelay); findJob.state = JOB_STATE.JOB_STANDBY; break; case JOB_STATE.JOB_DROP: yield break; } yield return(StartCoroutine(CoJobHandle(findJob.key))); }
public async Task UpdateJob(JobList job) { _jobDbContext.Entry(job).State = EntityState.Modified; await _jobDbContext.SaveChangesAsync(); }
public override void Execute() { WriteLiteral("\r\n"); #line 8 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Layout = new LayoutPage { Title = "Deleted Jobs" }; int from, perPage; int.TryParse(Request.Query["from"], out from); int.TryParse(Request.Query["count"], out perPage); var monitor = JobStorage.Current.GetMonitoringApi(); Pager pager = new Pager(from, perPage, monitor.DeletedListCount()) { BasePageUrl = Request.LinkTo("/deleted") }; JobList <DeletedJobDto> jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage); #line default #line hidden WriteLiteral("\r\n"); #line 25 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (pager.TotalPageCount == 0) { #line default #line hidden WriteLiteral(" <div class=\"alert alert-info\">\r\n No deleted jobs found.\r\n </div>\r\n"); #line 30 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar btn-toolbar-top\">" + "\r\n <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n " + " data-url=\""); #line 36 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Request.LinkTo("/deleted/requeue")); #line default #line hidden WriteLiteral("\"\r\n data-loading-text=\"Enqueueing...\">\r\n <span " + "class=\"glyphicon glyphicon-repeat\"></span>\r\n Requeue jobs\r\n " + " </button>\r\n "); #line 41 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(RenderPartial(new PerPageSelector(pager))); #line default #line hidden WriteLiteral(@" </div> <table class=""table""> <thead> <tr> <th class=""min-width""> <input type=""checkbox"" class=""js-jobs-list-select-all"" /> </th> <th class=""min-width"">Id</th> <th>Job</th> <th class=""align-right"">Deleted</th> </tr> </thead> <tbody> "); #line 55 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" foreach (var job in jobs) { #line default #line hidden WriteLiteral(" <tr class=\"js-jobs-list-row "); #line 57 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Value != null && !job.Value.InDeletedState ? "obsolete-data" : null); #line default #line hidden WriteLiteral(" "); #line 57 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null); #line default #line hidden WriteLiteral("\">\r\n <td>\r\n"); #line 59 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value != null && job.Value.InDeletedState) { #line default #line hidden WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-list-checkb" + "ox\" name=\"jobs[]\" value=\""); #line 61 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Key); #line default #line hidden WriteLiteral("\" />\r\n"); #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n <td class=\"min-width\">\r\n " + " <a href=\""); #line 65 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 66 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(HtmlHelper.JobId(job.Key)); #line default #line hidden WriteLiteral("\r\n </a>\r\n"); #line 68 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value != null && !job.Value.InDeletedState) { #line default #line hidden WriteLiteral(" <span title=\"Job\'s state has been changed while f" + "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n"); #line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n\r\n"); #line 74 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value == null) { #line default #line hidden WriteLiteral(" <td colspan=\"2\">\r\n <em" + ">Job has expired.</em>\r\n </td>\r\n"); #line 79 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <td>\r\n <a class=\"job-m" + "ethod\" href=\""); #line 83 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\r\n "); #line 84 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(HtmlHelper.DisplayMethod(job.Value.Job)); #line default #line hidden WriteLiteral("\r\n </a>\r\n </td>\r\n"); WriteLiteral(" <td class=\"align-right\">\r\n"); #line 88 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" if (job.Value.DeletedAt.HasValue) { #line default #line hidden WriteLiteral(" <span data-moment=\""); #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(JobHelper.ToTimestamp(job.Value.DeletedAt.Value)); #line default #line hidden WriteLiteral("\">\r\n "); #line 91 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(job.Value.DeletedAt); #line default #line hidden WriteLiteral("\r\n </span>\r\n"); #line 93 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\r\n"); #line 95 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </tr>\r\n"); #line 97 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n"); #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" #line default #line hidden #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" Write(RenderPartial(new Paginator(pager))); #line default #line hidden #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml" } #line default #line hidden }
public void SaveCharacterData(DatabaseConnection dbConnection) { if (loaded && !SavingLocked) { dataLock.EnterWriteLock(); try { if (playerData.AvailableModules == null) { playerData.AvailableModules = ""; } PlayerDataManager.SavePlayerAvailableExpKitModules(dbConnection.Database, playerData); PlayerDataManager.SavePlayerCharacteristics(dbConnection.Database, playerData); PlayerDataManager.SavePlayerGuild(dbConnection.Database, playerData); PlayerDataManager.SavePlayerItemGenerals(dbConnection.Database, playerData); JobList.SaveJobList(dbConnection); //PlayerDataManager.SavePlayerJobList(dbConnection.Database, playerData); PlayerDataManager.SavePlayerLocation(dbConnection.Database, playerData); //PlayerDataManager.SavePlayerMissionBoardGenerals(dbConnection.Database, playerData); missionBoard.SaveMissionBoardData(); PlayerDataManager.SavePlayerMissionBoardMissions(dbConnection.Database, playerData); PlayerDataManager.SavePlayerMissionGenerals(dbConnection.Database, playerData); PlayerDataManager.SavePlayerStoryGenerals(dbConnection.Database, playerData); PlayerDataManager.SavePlayerStoryHelperStateSettings(dbConnection.Database, playerData); PlayerDataManager.SavePlayerStatistics(dbConnection.Database, playerData); // Save inventory ListPair <int, Characters.InventoryItem> updatedInventory = new ListPair <int, Characters.InventoryItem>(); for (int i = 1; i <= Inventory.Count; i++) { if (Inventory[i].Updated) { updatedInventory.Add(i, Inventory[i].BaseInventoryItem); Inventory[i].Updated = false; } } PlayerDataManager.SavePlayerInventoryUpdates(dbConnection.Database, CharID, updatedInventory); // Save bank ListPair <int, Characters.InventoryItem> updatedBank = new ListPair <int, Characters.InventoryItem>(); for (int i = 1; i <= Bank.Count; i++) { if (Bank[i].Updated) { updatedBank.Add(i, Bank[i].BaseInventoryItem); Bank[i].Updated = false; } } PlayerDataManager.SavePlayerBankUpdates(dbConnection.Database, CharID, updatedBank); // Save trigger events playerData.TriggerEvents.Clear(); for (int i = 0; i < triggerEvents.Count; i++) { PlayerDataTriggerEvent triggerEvent = new PlayerDataTriggerEvent(); triggerEvents[i].Save(triggerEvent); playerData.TriggerEvents.Add(triggerEvent); } PlayerDataManager.SavePlayerTriggerEvents(dbConnection.Database, playerData); // Save team for (int i = 0; i < team.Length; i++) { playerData.TeamMembers[i].RecruitIndex = team[i].RecruitIndex; playerData.TeamMembers[i].UsingTempStats = team[i].InTempMode; if (team[i].Loaded) { team[i].Save(dbConnection); } } PlayerDataManager.SavePlayerTeam(dbConnection.Database, playerData); IMap map = GetCurrentMap(); if (map != null && (map.MapType == Enums.MapType.Instanced || map.MapType == Enums.MapType.RDungeonMap || map.MapType == Enums.MapType.House)) { map.Save(); //mInstancedMapManager.SaveActiveMap(); } lock (mapsToDelete) { AI.AIProcessor.mapGC.AddMaps(mapsToDelete); mapsToDelete.Clear(); } } catch (Exception ex) { ServerConsole.WriteLine("Map: " + MapID + System.Environment.NewLine + ex.ToString()); } finally { dataLock.ExitWriteLock(); } } }
public JobCommand(JobList jobs, IDictionary <string, IEmployee> employees) : base(jobs, employees) { }
public async Task <JobList> CreateJob(JobList job) { var res = await _jobListRepo.CreateJob(job); return(res); }
private JobList <T> GetJobsWithProperties <T>( [NotNull] IDatabase redis, [NotNull] string[] jobIds, string[] properties, string[] stateProperties, [NotNull] Func <Job, IReadOnlyList <string>, IReadOnlyList <string>, T> selector) { if (jobIds == null) { throw new ArgumentNullException(nameof(jobIds)); } if (selector == null) { throw new ArgumentNullException(nameof(selector)); } if (jobIds.Length == 0) { return(new JobList <T>(new List <KeyValuePair <string, T> >())); } var jobs = new Dictionary <string, Task <RedisValue[]> >(jobIds.Length, StringComparer.OrdinalIgnoreCase); var states = new Dictionary <string, Task <RedisValue[]> >(jobIds.Length, StringComparer.OrdinalIgnoreCase); properties = properties ?? new string[0]; var extendedProperties = properties .Concat(new[] { "Type", "Method", "ParameterTypes", "Arguments" }) .ToRedisValues(); var pipeline = redis.CreateBatch(); var tasks = new List <Task>(jobIds.Length * 2); foreach (var jobId in jobIds.Distinct()) { var jobTask = pipeline.HashGetAsync( _storage.GetRedisKey($"job:{jobId}"), extendedProperties); tasks.Add(jobTask); jobs.Add(jobId, jobTask); if (stateProperties != null) { var taskStateJob = pipeline.HashGetAsync( _storage.GetRedisKey($"job:{jobId}:state"), stateProperties.ToRedisValues()); tasks.Add(taskStateJob); states.Add(jobId, taskStateJob); } } pipeline.Execute(); Task.WaitAll(tasks.ToArray()); var jobList = new JobList <T>(jobIds .Select(jobId => new { JobId = jobId, Job = jobs[jobId].Result.ToStringArray(), Method = TryToGetJob( jobs[jobId].Result[properties.Length], jobs[jobId].Result[properties.Length + 1], jobs[jobId].Result[properties.Length + 2], jobs[jobId].Result[properties.Length + 3]), State = stateProperties != null ? states[jobId].Result.ToStringArray() : null }) .Select(x => new KeyValuePair <string, T>( x.JobId, x.Job.Any(y => y != null) ? selector(x.Method, x.Job, x.State) : default(T)))); return(jobList); }
public async Task UpdateJob(int id, JobList job) { job.ID = id; await _jobListRepo.UpdateJob(job); }
public override void Execute() { WriteLiteral("\n"); #line 7 "..\..\Pages\ProcessingJobsPage.cshtml" Layout = new LayoutPage { Title = "Processing Jobs" }; int from, perPage; int.TryParse(Request.QueryString["from"], out from); int.TryParse(Request.QueryString["count"], out perPage); var monitor = JobStorage.Current.GetMonitoringApi(); Pager pager = new Pager(from, perPage, monitor.ProcessingCount()) { BasePageUrl = Request.LinkTo("/processing") }; JobList <ProcessingJobDto> processingJobs = monitor .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage); #line default #line hidden WriteLiteral("\n"); #line 25 "..\..\Pages\ProcessingJobsPage.cshtml" if (pager.TotalPageCount == 0) { #line default #line hidden WriteLiteral(" <div class=\"alert alert-info\">\n No jobs are being processed right now." + "\n </div>\n"); #line 30 "..\..\Pages\ProcessingJobsPage.cshtml" } else { #line default #line hidden WriteLiteral(" <div class=\"js-jobs-list\">\n <div class=\"btn-toolbar btn-toolbar-top\">\n" + " <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n " + " data-url=\""); #line 36 "..\..\Pages\ProcessingJobsPage.cshtml" Write(Request.LinkTo("/processing/requeue")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Enqueueing...""> <span class=""glyphicon glyphicon-repeat""></span> Requeue jobs </button> <button class=""js-jobs-list-command btn btn-sm btn-default"" data-url="""); #line 43 "..\..\Pages\ProcessingJobsPage.cshtml" Write(Request.LinkTo("/processing/delete")); #line default #line hidden WriteLiteral(@""" data-loading-text=""Deleting..."" data-confirm=""Do you really want to DELETE ALL selected jobs?""> <span class=""glyphicon glyphicon-remove""></span> Delete selected </button> "); #line 50 "..\..\Pages\ProcessingJobsPage.cshtml" Write(RenderPartial(new PerPageSelector(pager))); #line default #line hidden WriteLiteral(@" </div> <table class=""table""> <thead> <tr> <th class=""min-width""> <input type=""checkbox"" class=""js-jobs-list-select-all"" /> </th> <th class=""min-width"">Id</th> <th class=""min-width"">Server</th> <th>Job</th> <th class=""align-right"">Started</th> </tr> </thead> <tbody> "); #line 66 "..\..\Pages\ProcessingJobsPage.cshtml" foreach (var job in processingJobs) { #line default #line hidden WriteLiteral(" <tr class=\"js-jobs-list-row "); #line 68 "..\..\Pages\ProcessingJobsPage.cshtml" Write(!job.Value.InProcessingState ? "obsolete-data" : null); #line default #line hidden WriteLiteral(" "); #line 68 "..\..\Pages\ProcessingJobsPage.cshtml" Write(job.Value.InProcessingState ? "hover" : null); #line default #line hidden WriteLiteral("\">\n <td>\n"); #line 70 "..\..\Pages\ProcessingJobsPage.cshtml" if (job.Value.InProcessingState) { #line default #line hidden WriteLiteral(" <input type=\"checkbox\" class=\"js-jobs-list-checkb" + "ox\" name=\"jobs[]\" value=\""); #line 72 "..\..\Pages\ProcessingJobsPage.cshtml" Write(job.Key); #line default #line hidden WriteLiteral("\" />\n"); #line 73 "..\..\Pages\ProcessingJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n <td class=\"min-width\">\n " + " <a href=\""); #line 76 "..\..\Pages\ProcessingJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\n "); #line 77 "..\..\Pages\ProcessingJobsPage.cshtml" Write(HtmlHelper.JobId(job.Key)); #line default #line hidden WriteLiteral("\n </a>\n"); #line 79 "..\..\Pages\ProcessingJobsPage.cshtml" if (!job.Value.InProcessingState) { #line default #line hidden WriteLiteral(" <span title=\"Job\'s state has been changed while f" + "etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n"); #line 82 "..\..\Pages\ProcessingJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n <td class=\"min-width\">\n " + " "); #line 85 "..\..\Pages\ProcessingJobsPage.cshtml" Write(job.Value.ServerId.ToUpperInvariant()); #line default #line hidden WriteLiteral("\n </td>\n <td>\n " + " <a class=\"job-method\" href=\""); #line 88 "..\..\Pages\ProcessingJobsPage.cshtml" Write(Request.LinkTo("/job/" + job.Key)); #line default #line hidden WriteLiteral("\">\n "); #line 89 "..\..\Pages\ProcessingJobsPage.cshtml" Write(HtmlHelper.DisplayMethod(job.Value.Job)); #line default #line hidden WriteLiteral("\n </a>\n </td>\n " + " <td class=\"align-right\">\n"); #line 93 "..\..\Pages\ProcessingJobsPage.cshtml" if (job.Value.StartedAt.HasValue) { #line default #line hidden WriteLiteral(" <span data-moment=\""); #line 95 "..\..\Pages\ProcessingJobsPage.cshtml" Write(JobHelper.ToStringTimestamp(job.Value.StartedAt.Value)); #line default #line hidden WriteLiteral("\">\n "); #line 96 "..\..\Pages\ProcessingJobsPage.cshtml" Write(job.Value.StartedAt); #line default #line hidden WriteLiteral("\n </span>\n"); #line 98 "..\..\Pages\ProcessingJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </td>\n </tr>\n"); #line 101 "..\..\Pages\ProcessingJobsPage.cshtml" } #line default #line hidden WriteLiteral(" </tbody>\n </table>\n </div>\n"); #line 105 "..\..\Pages\ProcessingJobsPage.cshtml" #line default #line hidden #line 105 "..\..\Pages\ProcessingJobsPage.cshtml" Write(RenderPartial(new Paginator(pager))); #line default #line hidden #line 105 "..\..\Pages\ProcessingJobsPage.cshtml" } #line default #line hidden }
public List <string> TestItem(ReadableTuple <int> tuple, MultiGrfReader grf, Type compare = null) { var result = new List <string>(); _metaGrf = grf; _lastTuple = tuple; foreach (var preview in _previews) { if (preview.CanRead(tuple) && !(preview is NullPreview) && (compare == null || preview.GetType() == compare)) { string jobt = tuple.GetValue <string>(ServerItemAttributes.ApplicableJob); var jobs = JobList.GetJobsFromHex("0x" + ((jobt == "") ? "FFFFFFFF" : jobt), tuple.GetIntNoThrow(ServerItemAttributes.Upper)); preview.Read(tuple, this, jobs); _jobs.Clear(); _jobs.AddRange(jobs); if (PreviewSprite == SpriteNone) { return(result); } var gender = _lastTuple.GetValue <GenderType>(ServerItemAttributes.Gender); foreach (var job in jobs) { _listView.SelectedItem = job; if (_listView.SelectedItem == null) { continue; } if (gender == GenderType.Undefined) { gender = GenderType.Both; } if (gender == GenderType.Both || gender == GenderType.Female) { _overrideGender = GenderType.Female; var act = preview.GetSpriteFromJob(tuple, this); var spr = act.ReplaceExtension(".spr"); result.Add(act); result.Add(spr); } if (gender == GenderType.Both || gender == GenderType.Male) { _overrideGender = GenderType.Male; var act = preview.GetSpriteFromJob(tuple, this); var spr = act.ReplaceExtension(".spr"); result.Add(act); result.Add(spr); } _overrideGender = null; } break; } } return(result); }