public JobEvent AddJobAction(AddJob message) { var jobTask = BatchPublisher.SearchNews(new CriteriaSearchNews { Target = message.Command }); var job = jobTask.Result; //var job = this.Jobs //.FirstOrDefault(p => p.Id == message.JobId); if (job is Job) { //if (job.InQueue + message.Command >= 0) //{ job.InQueue++; return(new JobAdded(job)); //} //else //{ // return new InsuffientJob(); //} } return(new JobNotFound()); }
public ActionResult EditJ(AddJob job) { if (ModelState.IsValid) { HttpCookie cookie = Request.Cookies["EditID"]; if (cookie != null) { string id = cookie["Id"]; var confJob = db.JobSeekers.FirstOrDefault(x => x.Id.ToString() == id); if (confJob != null) { confJob.first_name = job.first_name; confJob.last_name = job.last_name; confJob.name_pref_job = job.name_pref_job; confJob.my_experience_job = job.my_experience_job; confJob.my_skills = job.my_skills; confJob.pref_salary = job.pref_salary; db.SaveChanges(); if (Request.Cookies["EditID"] != null) { HttpCookie cookii = new HttpCookie("EditID"); cookii.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(cookii); } } return(RedirectToAction("Private")); } } return(RedirectToAction("Edit")); }
public IActionResult ProcessAddJob(AddJob job) { if(ActiveUser == null) { return RedirectToAction("Login", "Home"); } if(ModelState.IsValid) { if(job.to_date >= DateTime.Now) { ViewBag.to_date = "Present"; } Job newJob = new Job { user_id = ActiveUser.user_id, job_title = job.job_title, job_rating = job.job_rating, job_description = job.job_description, company = job.company, from_date = job.from_date, to_date = job.to_date, skills = job.skills }; _iContext.jobs.Add(newJob); _iContext.SaveChanges(); ViewBag.user = ActiveUser; return Redirect("/Profile/"+ActiveUser.user_id); } return View("AddJobToProfile", "Profile"); }
public JobManagement_Should(ITestOutputHelper output) { _output = output ?? throw new ArgumentNullException(nameof(output)); _searchCmd = new SearchJobs() { Config = OpnSenseDevice.Instance, Logger = this }; _addCmd = new AddJob() { Config = OpnSenseDevice.Instance, Logger = this }; _updateCmd = new UpdateJob() { Config = OpnSenseDevice.Instance, Logger = this }; _toggleCmd = new ToggleJob() { Config = OpnSenseDevice.Instance, Logger = this }; _getCmd = new GetJobDetails() { Config = OpnSenseDevice.Instance, Logger = this }; _deleteCmd = new DeleteJob() { Config = OpnSenseDevice.Instance, Logger = this }; }
public async Task <ActionResult <AddJob> > Add_Jobs(AddJob jobDTO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var job = new Jobs() { Name = jobDTO.Name }; await _context.Jobs.AddAsync(job); await _context.SaveChangesAsync(); var jobs_description = new Jobs_Description() { jobs_id = job.id, Salary = jobDTO.Salary, Skills_required = jobDTO.Skills_required, Employers_id = jobDTO.Employers_id }; await _context.AddAsync(jobs_description); await _context.SaveChangesAsync(); return(CreatedAtAction("GetJobs", new { id = job.id }, jobDTO)); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var job = new AddJob() { Adders = _adderGroup.GetComponentDataArray <Adder>() }; return(job.Schedule(_adderGroup.CalculateLength(), 64, inputDeps)); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var job = new AddJob(); job.commandBuffer = m_Barrier.CreateCommandBuffer().ToConcurrent(); inputDeps = job.Schedule(this, inputDeps); m_Barrier.AddJobHandleForProducer(inputDeps); return(inputDeps); }
public ActionResult addJob(AddJob job) { if (ModelState.IsValid) { return(Ok(service.AddJob(job.TaskId, job.JobName))); } return(BadRequest()); }
// Start is called before the first frame update void Start() { var beforeTime1 = Time.realtimeSinceStartup;; // Create a native array of a single float to store the result in. This example waits for the job to complete NativeArray <float> result = new NativeArray <float>(1, Allocator.TempJob); // Setup the data for job #1 AddJob jobData = new AddJob(); jobData.a = 10; jobData.b = 10; jobData.result = result; // Schedule job #1 JobHandle firstHandle = jobData.Schedule(); // Setup the data for job #2 MulResultJob mulJobData = new MulResultJob(); mulJobData.value = 5; mulJobData.result = result; // Schedule job #2 JobHandle secondHandle = mulJobData.Schedule(firstHandle);//firstHandle // job #3 AddResultJob addJobData = new AddResultJob(); addJobData.value = 9; addJobData.result = result; JobHandle thirdHandle = addJobData.Schedule(secondHandle);//secondHandle // Wait for job #3 to complete thirdHandle.Complete(); // All copies of the NativeArray point to the same memory, you can access the result in "your" copy of the NativeArray float aPlusB = result[0]; Debug.Log("Result:" + aPlusB); text.text += aPlusB + " "; // Free the memory allocated by the result array result.Dispose(); Debug.Log("cost " + (Time.realtimeSinceStartup - beforeTime1)); text.text += Time.realtimeSinceStartup - beforeTime1 + " "; beforeTime1 = Time.realtimeSinceStartup; int a = 10; int b = 10; int c = a + b; c *= 5; c += 9; Debug.Log("cost " + (Time.realtimeSinceStartup - beforeTime1)); text.text += Time.realtimeSinceStartup - beforeTime1 + " "; }
async public Task <IActionResult> AddJob([FromBody] AddJob job, int cpId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (job == null) { return(BadRequest(new { success = false, error = "Body can not be null" })); } try { Job createdJob = await jobRepository.Create(job.job); if (createdJob == null) { return(StatusCode(StatusCodes.Status500InternalServerError)); } DanhSachDN_Job temp = new DanhSachDN_Job { ma_cong_viec = createdJob.ma_cong_viec, ma_doanh_nghiep = cpId, ngay_dang = DateTime.Now, trang_thai = false }; DanhSachDN_Job createdDN_Job = await danhSachDNJobRepository.Create(temp); if (createdDN_Job == null) { return(StatusCode(StatusCodes.Status500InternalServerError)); } bool createdJobSkills = await jobService.CapNhatJobSkill(job.skills, createdJob.ma_cong_viec); if (createdJobSkills == false) { return(StatusCode(StatusCodes.Status500InternalServerError)); } queue.Enqueue(job); return(Ok(new { success = true, })); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }
private void OpenNewJobWindow()// otwarcie okna zgloszenia pracy { AddJob AddJobWin = new AddJob(); AddJobWin.ShowDialog(); if (AddJobWin.Focusable) { tabelaZgl(); } }
public void AddMarketJob() { //Login loginobj2 = new Login test = extent.StartTest("Adding the New job"); AddJob jobobj = new AddJob(); jobobj.AddJobSteps(); }
public void SetUpHashSet() { if (testHashSet.IsCreated) { testHashSet.Dispose(); } testHashSet = new NativeHashSet <int>(uniqueRandomNumbers.Length, Allocator.TempJob); var addJob = new AddJob { HashSet = testHashSet.ToConcurrent(), ToAdd = uniqueRandomNumbers.AsArray() }.Schedule(uniqueRandomNumbers.Length, 1); addJob.Complete(); }
public ActionResult AddJob(AddJob job) { HttpCookie cookie = Request.Cookies["AuthID"]; if (cookie != null) { if (ModelState.IsValid) { db.JobSeekers.Add(new JobSeeker { user_id = cookie["Id"], first_name = job.first_name, last_name = job.last_name, my_skills = job.my_skills, my_experience_job = job.my_experience_job, name_pref_job = job.name_pref_job, pref_salary = job.pref_salary, create_date = job.create_date, end_data = job.end_data }); db.SaveChanges(); return(RedirectToAction("Private")); } } return(RedirectToAction("AddVacanci")); }
// Start is called before the first frame update void Start() { var a = 10; var b = 15; NativeArray <float> result = new NativeArray <float>(1, Allocator.TempJob); var job = new AddJob { m_a = a, m_b = b, m_result = result }; JobHandle jobHandle = job.Schedule(); jobHandle.Complete(); print(result[0]); result.Dispose(); }
public ActionResult Create(Job job) { try { var request = new AddJob() { Title = job.Title, VehicleId = job.VehicleId, AssigneeId = job.AssigneeId, Scheduled = job.Scheduled, Status = "Created", Description = job.Description }; mediator.Send(request); return(RedirectToAction(nameof(Index))); } catch { return(View(job.VehicleId)); } }
private static void TestIJob() { ExecuteJobOrJobParallelFor((values1, values2, results) => { AddAllJob addAllJob1 = new AddAllJob(); addAllJob1.adder = 1; addAllJob1.values = values1; JobHandle addAllJob1Handle = addAllJob1.Schedule(); AddAllJob addAllJob2 = new AddAllJob(); addAllJob2.adder = 1; addAllJob2.values = values2; JobHandle addAllJob2Handle = addAllJob2.Schedule(); AddJob addJob = new AddJob(); addJob.a = values1; addJob.b = values2; addJob.result = results; return(addJob.Schedule(JobHandle.CombineDependencies(addAllJob1Handle, addAllJob2Handle))); }); }
private void Start() { // 1. 결과 배열 생성 NativeArray <float> result = new NativeArray <float>(1, Allocator.TempJob); // 잡 생성 AddJob jobData = new AddJob { a = 15, b = 20, result = result }; // 스케줄링 JobHandle handle = jobData.Schedule(); // 대기 handle.Complete(); // 결과 확인 float aPlusB = result[0]; // 해제 result.Dispose(); }
// Update is called once per frame void Update() { var powJob = new PowJob { dataSize = dataSize, dataIn = dataA[READ], dataOut = dataB[WRITE] }; powJobHndl = powJob.Schedule(); var addJob = new AddJob { dataSize = dataSize, dataIn = dataB[READ], dataOut = dataC[WRITE] }; addJobHndl = addJob.Schedule(); JobHandle.ScheduleBatchedJobs(); }
//private void DataValidation() //{ // //Validate Name property // List<string> listErrors; // if (propErrors.TryGetValue("charOfJob", out listErrors) == false) // listErrors = new List<string>(); // else // listErrors.Clear(); // if (charOfJob ==null) // listErrors.Add("Name should not be empty!!!"); // propErrors["charOfJob"] = listErrors; // if (listErrors.Count > 0) // { // OnErrorsChanged(); // } //} private void AddNewJob() { _job = new Praca { Numer = short.Parse(_numberOfJob), Rok = short.Parse(currentYear), DataZgloszenia = _dateOfJob, DataZakonczeniaPrac = _dateOfJobEnd, PolozenieOpis = _jobLocality, CharakterOb = (CharakterOb)Enum.Parse(typeof(CharakterOb), _charOfJob), Aktualne = true, PrefiksId = 2, GminaId = _gminaJob, ObrebId = _obrebJob, UzytkownikId = 1,//poprawic WykonawcaId = _jobContractor, AsortymentId = _jobTarget, StatusId = 1, PolozenieId = 0,//poprawić RodzpracyId = _kindOfJob, NumerDzialki = _plotJob }; try { _zgloszenie.Praca.Add(_job); _zgloszenie.SaveChanges(); MessageBox.Show("Dodano nowy rekord"); AddJob win = App.Current.Windows.OfType <AddJob>().First();// zamknięcie okna zapisu win.Close(); } catch (Exception e) { MessageBox.Show(e.ToString()); } }
static void Main(string[] args) { Program p = new Program(); // create instance of delegates AddDelegate ad = new AddDelegate(Program.Add); AddName an = new AddName(p.Name); AddJob aj = new AddJob(Program.Job);// normal call also applicable , keeping Class Name by calling is optional // in case of static methods // now call the delegate , by pass the value so that the method which is bound with delegate internally should execute ad(100, 200); ad.Invoke(2000, 20200); an.Invoke("laxman"); an("shukla"); string s1 = aj("ved"); string s = aj.Invoke("praksh"); Console.WriteLine(s1); Console.WriteLine(s); Console.WriteLine("Complete"); Console.Read(); }
public async Task CapNhat(AddJob job, CancellationToken cancellationToken = default) { await jobService.CapNhatBoTuDien(job.skills); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var job = new AddJob(); return(job.Schedule(this, inputDeps)); }
private void CloseAddJob() { AddJob win = App.Current.Windows.OfType <AddJob>().First(); win.Close(); }