Пример #1
0
        // GET: IssueVoucher
        public async Task <IActionResult> Index()
        {
            ADTeam5User user = await _userManager.GetUserAsync(HttpContext.User);

            List <string> identity = userCheck.checkUserIdentityAsync(user);
            int           userID   = user.WorkID;

            List <TempVoucherDetails> tempVoucherDetailsList = b.GetTempVoucherDetailsList(userID);

            List <Catalogue> categoryList = new List <Catalogue>();
            var q = _context.Catalogue.GroupBy(x => new { x.Category }).Select(x => x.FirstOrDefault());

            foreach (var item in q)
            {
                categoryList.Add(item);
            }
            categoryList.Insert(0, new Catalogue {
                ItemNumber = "0", Category = "---Select Category---"
            });
            ViewBag.ListofCategory = categoryList;

            List <Catalogue> itemNameList = new List <Catalogue>();

            itemNameList = (from x in _context.Catalogue select x).ToList();
            itemNameList.Insert(0, new Catalogue {
                ItemNumber = "0", ItemName = "---Select Item---"
            });
            ViewBag.ListofItemName = itemNameList;



            return(View(tempVoucherDetailsList));
        }