public async Task <IActionResult> SubDivisionCreate([Bind("Id,SubDivisionTitle,SubDivisionCode,DivisionId")]
                                                            SubDivision subDivision)
        {
            if (!ModelState.IsValid)
            {
                var divisionList = await _wpbService.GetDivisionDropListAsync();

                ViewData["Division"] = new SelectList(divisionList, "Id", "DivisionName");
                return(View(subDivision));
            }

            subDivision.SubDivisionCode = subDivision.SubDivisionCode.ToUpper();

            var subDivCodeExist = _wpbService.SubdivisionCodeExist(subDivision.SubDivisionCode);

            if (subDivCodeExist)
            {
                var divisionList = await _wpbService.GetDivisionDropListAsync();

                ViewData["Division"] = new SelectList(divisionList, "Id", "DivisionName");
                ModelState.AddModelError("", "$Subdivision code {subDivision.SubDivisionCode} is already in use.");
                return(View(subDivision));
            }


            await _wpbService.CreateSubDivisionAsync(subDivision);

            return(RedirectToAction(nameof(SubDivisionsAll)));
        }