๐ง๐ผ๐ฑ๐ฎ๐ ๐ ๐ถ๐บ๐ฝ๐น๐ฒ๐บ๐ฒ๐ป๐๐ฒ๐ฑ ๐๐ผ๐น๐น๐ผ๐-๐จ๐ฝ ๐ณ๐๐ป๐ฐ๐๐ถ๐ผ๐ป๐ฎ๐น๐ถ๐๐ ๐ถ๐ป ๐บ๐ ๐ท๐ผ๐ฏ ๐๐ฟ๐ฎ๐ฐ๐ธ๐ถ๐ป๐ด ๐ฎ๐ฝ๐ฝ!

While researching how to manage follow-ups, I faced a few challenges:
โ Associating a follow-up with a specific job application
โ Restricting status selection (`NotStarted`, `InProgress`) during creation
โ Updating to `Completed`, `Deferred`, or `Cancelled` only during edit
โ Dynamically loading dropdowns with enums and job applications
Hereโs a quick look at how I solved it:
// Load FollowUpStatus dropdown
ViewBag.FollowUpStatusList = Enum.GetValues(typeof(FollowUpStatus))
.Cast<FollowUpStatus>()
.Select(s => new SelectListItem { Value = ((int)s).ToString(), Text = s.ToString() });
// Load JobApplication dropdown
ViewBag.JobApplicationList = _context.JobApplications
.Select(j => new SelectListItem { Value = j.Id.ToString(), Text = j.CompanyName });
In the view:
l@Html.DropDownListFor(model => model.JobApplicationId,
(IEnumerable<SelectListItem>)ViewBag.JobApplicationList,
"-- Select Application --")
@Html.DropDownListFor(model => model.Status,
(IEnumerable<SelectListItem>)ViewBag.FollowUpStatusList,
"-- Select Status --")
๐ฌ ๐๐ผ๐ ๐ฑ๐ผ ๐๐ผ๐ ๐บ๐ฎ๐ป๐ฎ๐ด๐ฒ ๐ณ๐ผ๐น๐น๐ผ๐-๐๐ฝ๐ ๐ผ๐ฟ ๐ฟ๐ฒ๐บ๐ถ๐ป๐ฑ๐ฒ๐ฟ๐ ๐ถ๐ป ๐๐ผ๐๐ฟ ๐ท๐ผ๐ฏ ๐ผ๐ฟ ๐ฝ๐ฒ๐ฟ๐๐ผ๐ป๐ฎ๐น ๐ฝ๐ฟ๐ผ๐ท๐ฒ๐ฐ๐๐? ๐๐ผ ๐๐ผ๐ ๐ฝ๐ฟ๐ฒ๐ณ๐ฒ๐ฟ ๐๐ฎ๐ด๐ด๐ถ๐ป๐ด?
Subscribe to my newsletter
Read articles from Supraja Tangella directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
