public IActionResult Index()
        {
            PrincipalDAO dao      = new PrincipalDAO(_context);
            string       username = HttpContext.Session.GetString("USER");
            Principal    dto      = dao.FindByUsername(username);

            if (dto != null)
            {
                ViewData["deliveryAddress"] = dto.Address;
                ViewData["deliveryPhone"]   = dto.Phone;
            }
            else
            {
                ViewData["msg"] = "Load checkout failed";
                return(View("Error Page"));
            }
            Dictionary <string, DTO.Accessory> shoppingCart = HttpContext.Session.GetCollectionFromJson <Dictionary <string, DTO.Accessory> >("cart");
            Dictionary <string, DTO.Accessory> cart         = new Dictionary <string, DTO.Accessory>();

            foreach (var item in shoppingCart)
            {
                string        id         = item.Key;
                DTO.Accessory dtoSession = item.Value;
                AccessoryDAO  accDAO     = new AccessoryDAO(_context);
                DTO.Accessory accDTO     = accDAO.FindByPrimaryKey(id);
                accDTO.Quantity = dtoSession.Quantity;
                cart.Add(id, accDTO);
            }
            return(View(cart));
        }
        public IActionResult LoadProfile([FromBody] string txtUsernameLg)
        {
            PrincipalDAO dao = new PrincipalDAO(_context);
            Principal    dto = dao.FindByUsername(txtUsernameLg);

            return(new JsonResult(dto));
        }