public async Task <IActionResult> ProcessAfteBulkEntry()
        {
            var cards = _context.IdentityCards.ToList().Where(c => c.CardNumber == null);

            var identitycardInfo = _context.IdentityCards.ToList().Where(c => c.CardNumber != null);
            var lastcardNumber   = identitycardInfo.LastOrDefault()?.CardNumber;

            IdentityCardViewModel viewModel = new IdentityCardViewModel();

            foreach (var card in cards)
            {
                card.CardNumber  = viewModel.GetCardNumber(lastcardNumber);
                card.CompanyName = "Interlink Technologies Ltd.";
                card.CardInfo    = "This card should be used by card holder only. If this card is found ownerless, please, return" +
                                   "it to the issuing authority. This card is not transferable to anybody.";
                card.CompanyAddress  = "Office No. 801 (7th Floor) 1205, 185 Sonargaon Road, Dhaka";
                card.CompanyLogoPath = "";
                card.ImagePathOfAuthorizedSignature = "";
                _context.Update(card);
                var save = await _context.SaveChangesAsync();

                lastcardNumber = viewModel.GetCardNumber(lastcardNumber);

                ViewBag.Info = "Process Completed";
            }

            return(View("Excel"));
        }
        public IActionResult Create()
        {
            IdentityCardViewModel model = new IdentityCardViewModel();

            ViewData["BloodGroups"]    = new SelectList(_context.BloodGroups, "Id", "Name");
            ViewData["Designations"]   = new SelectList(_context.Designations, "Id", "Title");
            ViewData["Departments"]    = new SelectList(_context.Departments, "Id", "Name");
            ViewData["CardCategories"] = new SelectList(_context.CardCategories, "Id", "CategoryName");

            var identitycardInfo = _context.IdentityCards.ToList();
            var cardNumber       = identitycardInfo.LastOrDefault()?.CardNumber;

            model.CardNumber = model.GetCardNumber(cardNumber);
            return(View(model));
        }