Пример #1
0
        public IActionResult specificContact(int id)
        {
            Models.Employee_Profile Contact = _context.Employee_Profiles.Where(e => e.Employee_ProfileID == id).FirstOrDefault();

            if (Contact == null)
            {
                return(RedirectToAction(null, "no Employee found in Database"));
            }

            return(View(Contact));
        }
Пример #2
0
        public IActionResult Index()
        {
            ViewData["HeaderBackgroundImg"] = _context.Photos.ToList()[58].PhotoPath;
            Models.Employee_Profile Contact = _context.Employee_Profiles.FirstOrDefault();
            if (_context.Employee_Profiles != null)
            {
                // ViewBag.Contacten = new List<Models.Employee_Profile> { Contact, Contact, Contact, Contact, Contact, Contact, Contact, Contact, Contact };

                ViewBag.Contacten = _context.Employee_Profiles.ToList();
            }
            else
            {
                ViewBag.Contacten = new List <Models.Employee_Profile>();
            }
            PageContent ContactView = new PageContent(_context);

            PageContent T15contact = new PageContent(
                new int[] //photo
            {
                14, 15, 16, 17
            },
                new int[] //text
            {
                16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
            },
                _context);

            ContactView.addPage(T15contact);

            PageContent HowToContacts = new PageContent(
                new int[]
            {
                2, 3, 4, 5, 6, 7, 8
            },
                new int[]
            {
                2, 3, 4, 5, 6, 7, 8, 10
            },
                _context);

            ContactView.addPage(HowToContacts);


            List <Branch_Category> Branches = _context.Branch_Categories.ToList();

            ViewBag.Branches = Branches;



            return(View(ContactView));
        }
Пример #3
0
        public IActionResult Index(int BranchID, string[] typestring, string[] catstring)
        {
            Models.Employee_Profile Contact = _context.Employee_Profiles.FirstOrDefault();
            ViewBag.Contact = Contact;
            ViewData["HeaderBackgroundImg"] = _context.Photos.ToList()[58].PhotoPath;
            BranchID++;
            List <Models.Type_Category> selectedTypes = getTypes(typestring);

            List <Models.Normal_Category> selectedCategories = GetCategories(catstring);

            ViewBag.SelectedTypes      = selectedTypes;
            ViewBag.SelectedCategories = selectedCategories;

            //when nothing is selected, select everything
            if (selectedTypes.Count() == 0)
            {
                selectedTypes = _context.Type_Categories.Where(s => s.BranchCategory.BranchID.Equals(BranchID)).ToList();
            }
            if (selectedCategories.Count() == 0)
            {
                selectedCategories = (from C in _context.Normal_Categories
                                      join TC in selectedTypes on C.TypeID equals TC.TypeID
                                      select C).ToList();
            }
            fillBags(BranchID, selectedTypes, selectedCategories);

            //Data to send to the Pages
            PageContent ProductView = new PageContent(_context);
            PageContent SubHeader   = new PageContent(
                new int[] //photo
            {
                1
            },
                new int[] //text
            {
                30, 29, 31, 14
            },
                _context);

            ProductView.addPage(SubHeader);

            return(View(ProductView));
        }