public async Task <IActionResult> Edit(int id, [Bind("Id,JobName,FunctionalAreaId,InterviewLocation,IndustryId,CompanyId,JobTypeId")] WalkIn walkIn) { if (id != walkIn.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _repo.Update(walkIn); await _repo.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(RedirectToAction(nameof(Index))); } ViewData["FunctionalAreaId"] = new SelectList(_repo.FunctionalAreas, "Id", "Id", walkIn.FunctionalAreaId); ViewData["IndustryId"] = new SelectList(_repo.Industries, "Id", "Id", walkIn.IndustryId); ViewData["JobTypeId"] = new SelectList(_repo.JobTypes, "Id", "Id", walkIn.JobTypeId); return(View(walkIn)); }
protected override void OnViewSet() { base.OnViewSet(); if (WorkingMode == AddVisitorToQueueWorkingMode.AddVisitor) { _walkIn = CreateWalkin(); } }
public void AddWalkin(WalkIn walkIn, string reason, string description) { QueueEntry entry = new QueueEntry(); entry.QueueEntryID = Queue.Count.ToString(); entry.Person = walkIn; entry.ReasonCode = reason; entry.Description = description; Queue.Add(entry); }
private WalkIn CreateWalkin() { WalkIn result = new WalkIn(); result.Addresses = new Address[] { new Address() }; result.EmailAddresses = new EmailAddress[] { new EmailAddress() }; result.PhoneNumbers = new PhoneNumber[] { new PhoneNumber(), new PhoneNumber(), new PhoneNumber() }; result.PhoneNumbers[0].PhoneType = PhoneType.Home; result.PhoneNumbers[1].PhoneType = PhoneType.Work; result.PhoneNumbers[2].PhoneType = PhoneType.Mobile; return(result); }
public async Task <IActionResult> Create([Bind("Id,JobName,FunctionalAreaId,InterviewLocation,IndustryId,CompanyId,JobTypeId")] WalkIn walkIn) { if (ModelState.IsValid) { _repo.Add(walkIn); await _repo.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FunctionalAreaId"] = new SelectList(_repo.FunctionalAreas, "Id", "Id", walkIn.FunctionalAreaId); ViewData["IndustryId"] = new SelectList(_repo.Industries, "Id", "Id", walkIn.IndustryId); ViewData["JobTypeId"] = new SelectList(_repo.JobTypes, "Id", "Id", walkIn.JobTypeId); return(View(walkIn)); }
public void ShowWalkin(WalkIn walkIn) { Walkin = walkIn; }
public async Task Update(WalkIn walkIn) { _myJob.WalkIns.Update(walkIn); await _myJob.SaveChangesAsync(); }
public async Task Add(WalkIn walkIn) { await _myJob.WalkIns.AddAsync(walkIn); await _myJob.SaveChangesAsync(); }
public void AddWalkin(WalkIn walkIn, string reason, string description) { throw new Exception("The method or operation is not implemented."); }
public void ShowWalkin(WalkIn walkIn) { UpdateControlsToWorkingMode(AddVisitorToQueueWorkingMode.AddVisitor); ShowPerson(walkIn); }