Esempio n. 1
0
 public ActionResult MeettheDoctors()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("MeettheDoctors", "Home"), "Meet Dr. Tekle");
     return(View("MeettheDoctors", "_AdsLayout1"));
 }
Esempio n. 2
0
        private Tuple <Course, Module, Activity> MakeBreadCrumbs(int?courseId, int?moduleId, int?activityId)
        {
            BreadCrumb.Clear();
            BreadCrumb.Add("/", "Home");

            // Fetch DB Activity, Module and Course
            var activity = db.Activities.Find(activityId);
            var module   = db.Modules.Find(moduleId);
            var course   = db.Courses.Find(courseId);

            // Create return object
            var ret = new Tuple <Course, Module, Activity>(course, module, activity);

            // Make sure we have a course, fall back on module.Course or activity.Module.Course if course is null
            course = course ?? module?.Course ?? activity?.Module?.Course;
            if (course != null)
            {
                BreadCrumb.Add(Url.Action("Index", "Modules", new { courseId = course.Id }), course.Name);
                // Make sure we have a module, fall back on activity.Module if module is null
                module = module ?? activity?.Module;
                if (module != null)
                {
                    BreadCrumb.Add(Url.Action("Index", "Activities", new { moduleId = module.Id }), module.Name);
                    if (activity != null)
                    {
                        BreadCrumb.Add(Url.Action("Index", "Activities", new { moduleId = activity.ModuleId }), activity.Name);
                    }
                }
            }
            return(ret);
        }
Esempio n. 3
0
 public ActionResult PhotoGallery()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("PhotoGallery", "Home"), "Photo Gallery");
     return(View("PhotoGallery", "_AdsLayout1"));
 }
Esempio n. 4
0
        private void UpdateBreadCrumb()
        {
            if (OldVer == 0 || NewVer == 0 || OldVer == NewVer)
            {
                Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("PageHistoryList.aspx"), PageNameUtil.Decode(WikiPage)), this);
            }

            string pageName = PageNameUtil.Decode(WikiPage);

            if (string.IsNullOrEmpty(pageName))
            {
                pageName = WikiResource.MainWikiCaption;
            }

            BreadCrumb.Clear();
            BreadCrumb.Add(new ASC.Web.Controls.BreadCrumb()
            {
                Caption = pageName, NavigationUrl = ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), PageNameUtil.Decode(WikiPage))
            });
            BreadCrumb.Add(new ASC.Web.Controls.BreadCrumb()
            {
                Caption = WikiResource.wikiHistoryCaption, NavigationUrl = ActionHelper.GetViewPagePath(this.ResolveUrlLC("PageHistoryList.aspx"), PageNameUtil.Decode(WikiPage))
            });
            BreadCrumb.Add(new ASC.Web.Controls.BreadCrumb()
            {
                Caption = string.Format(WikiResource.wikiDiffDescriptionFormat, OldVer, NewVer)
            });
        }
Esempio n. 5
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            television television = db.televisions.Find(id);

            if (television == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Save Energy");
            BreadCrumb.Add(Url.Action("Index", "televisions"), "Television");
            BreadCrumb.Add("", television.Model_No);

            // Smiliar products display logic

            var results = from x in db.televisions
                          select x;
            var list = results.Where(x => x.Brand_Reg.Contains(television.Brand_Reg)).OrderBy(x => Guid.NewGuid()).Take(3).ToList();

            ViewData["SimilarProducts"] = list;
            return(View(television));
        }
 // GET: recycling_centres
 public ActionResult Index()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Recycling centre map");
     return(View(db.recycling_centres.ToList()));
 }
        public ActionResult LeftoverRecipe()
        {
            ViewBag.Message = "LeftoverRecipe";
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("ReduceFoodWaste", "Home"), "Reduce Waste");
            BreadCrumb.Add("", "Left-Over Food Recipes");
            List <SelectListItem> Difficulty_level = new List <SelectListItem>();

            Difficulty_level.Add(new SelectListItem()
            {
                Text = "All", Value = null
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Easy", Value = "easy"
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Average", Value = "average"
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Challenging", Value = "Challenging"
            });
            this.ViewBag.Difficulty = new SelectList(Difficulty_level, "Value", "Text");
            return(View());
        }
 public ActionResult Composting()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Composting");
     return(View());
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            clothes_dryer clothes_dryer = db.clothes_dryer.Find(id);

            if (clothes_dryer == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Save Energy");
            BreadCrumb.Add(Url.Action("Index", "clothes_dryer"), "Clothes Dryer");
            BreadCrumb.Add("", clothes_dryer.Model_No);

            // Smiliar products display logic

            var results = from x in db.clothes_dryer
                          select x;
            var list = results.Where(x => x.Brand.Contains(clothes_dryer.Brand)).OrderBy(x => Guid.NewGuid()).Take(3).ToList();

            ViewData["SimilarProducts"] = list;
            return(View(clothes_dryer));
        }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            monitor monitor = db.monitors.Find(id);

            if (monitor == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Save Energy");
            BreadCrumb.Add(Url.Action("Index", "monitors"), "Monitor");
            BreadCrumb.Add("", monitor.Model_Number);

            // Smiliar products display logic

            var results = from x in db.monitors
                          select x;
            var list = results.Where(x => x.Brand_Name.Contains(monitor.Brand_Name)).Take(3).ToList();

            ViewData["SimilarProducts"] = list;
            return(View(monitor));
        }
 public ActionResult AppliancesType()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Save Energy");
     return(View());
 }
Esempio n. 12
0
 public ActionResult OurPhilosophy()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("OurPhilosophy", "Home"), "Our Philosophy");
     return(View("OurPhilosophy", "_AdsLayout1"));
 }
Esempio n. 13
0
 public ActionResult MeetOurStaff()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("MeetOurStaff", "Home"), "Meet Our Staff");
     return(View("MeetOurStaff", "_AdsLayout1"));
 }
Esempio n. 14
0
 // GET: Herbs
 public ActionResult Index()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("ReduceFoodWaste", "Home"), "Reduce Food Waste");
     BreadCrumb.Add("", "Grow Your Own Herb");
     return(View(db.Herbs.ToList()));
 }
 public ActionResult About()
 {
     ViewBag.Message = "Description";
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Learn More");
     return(View());
 }
 public ActionResult ReduceFoodWaste()
 {
     ViewBag.Message = "Reduce waste";
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Reduce Waste");
     return(View());
 }
 public ActionResult ReduceWasteQuiz()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("Quiz", "Home"), "Household Assessment");
     BreadCrumb.Add("", "Reduce Waste Assessment");
     return(View());
 }
 public ActionResult Quiz()
 {
     ViewBag.Message = "How much do you know about saving money and energy?";
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add("", "Household Assessment");
     return(View());
 }
 public ActionResult rural_household()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("Composting", "Home"), "Composting");
     BreadCrumb.Add("", "Rural Household");
     return(View());
 }
 public ActionResult EnergyQuiz()
 {
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
     BreadCrumb.Add(Url.Action("Quiz", "Home"), "Household Assessment");
     BreadCrumb.Add("", "Save Energy Assessment");
     return(View());
 }
Esempio n. 21
0
        public ActionResult Contact()
        {
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("Contact", "Home"), "Contact");
            ViewBag.Message = "Your contact page.";

            return(View("Contact", "_AdsLayout1"));
        }
Esempio n. 22
0
        public ActionResult About()
        {
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("About", "Home"), "About");
            ViewBag.Message = "Your app description page.";

            return(View());
        }
Esempio n. 23
0
 private void MakeBreadCrumbs(object routeValues = null)
 {
     if (routeValues == null)
     {
         routeValues = TempData["routeValues"];
     }
     TempData["routeValues"] = routeValues;
     BreadCrumb.Clear();
     BreadCrumb.Add(Url.Action("Index", "Users", routeValues), "Home");
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            recipe recipes = db.recipes.Find(id);

            if (recipes == null)
            {
                return(HttpNotFound());
            }

            // showing the navigation map using the bread crumbs.

            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("ReduceFoodWaste", "Home"), "Reduce Waste");
            BreadCrumb.Add(Url.Action("LeftoverRecipe", "Home"), "Left-Over Food Recipes");
            BreadCrumb.Add("", recipes.name);

            //adding the values in dropdown list

            List <SelectListItem> Difficulty_level = new List <SelectListItem>();

            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Difficulty", Value = null
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Easy", Value = "easy"
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Average", Value = "average"
            });
            Difficulty_level.Add(new SelectListItem()
            {
                Text = "Challenging", Value = "Challenging"
            });
            this.ViewBag.Difficulty = new SelectList(Difficulty_level, "Value", "Text");

            // logic to display the similar recipes.

            var results = from x in db.recipes
                          select x;
            var list = results.Where(x => x.difficulty_assignment.Contains(recipes.difficulty_assignment) && x.recipe_type_id == recipes.recipe_type_id).OrderBy(x => Guid.NewGuid()).Take(3).ToList();

            ViewData["SimilarRecipes"] = list;
            return(View(recipes));
        }
Esempio n. 25
0
 private void ClearCurrent()
 {
     Items.Clear();
     Guides.Clear();
     BreadCrumb.Clear();
     this.BackgroundImageUrl = string.Empty;
     this.CategoryName       = string.Empty;
     this.Description        = string.Empty;
     this.LongDescription    = string.Empty;
     this.ImageUrl           = string.Empty;
     this.CategoryBreadcrumb = string.Empty;
     this.DisplayTitle       = string.Empty;
     this.ImageUrl           = string.Empty;
     HasGuides = true;
 }
        public ActionResult TopRecommendations()
        {
            var results = from x in db.clothes_dryer
                          select x;
            int    pagesize = 9, pageindex = 1;
            CdList temp = new CdList();

            results = results.Where(x => x.New_Star >= 5).OrderBy(x => Guid.NewGuid()).Take(9);
            var list = results.ToList();

            temp.Clothes_dryers = list.ToPagedList(pageindex, pagesize);
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Save Energy");
            BreadCrumb.Add(Url.Action("Index", "clothes_dryer"), "Clothes Dryer");
            BreadCrumb.Add("", "Top Recommendations");
            List <SelectListItem> Ratings_level = new List <SelectListItem>();

            Ratings_level.Add(new SelectListItem()
            {
                Text = "All Ratings", Value = "-1"
            });
            Ratings_level.Add(new SelectListItem()
            {
                Text = "1 Star", Value = "1"
            });
            Ratings_level.Add(new SelectListItem()
            {
                Text = "2 Star", Value = "2"
            });
            Ratings_level.Add(new SelectListItem()
            {
                Text = "3 Star", Value = "3"
            });
            Ratings_level.Add(new SelectListItem()
            {
                Text = "4 Star", Value = "4"
            });
            Ratings_level.Add(new SelectListItem()
            {
                Text = "5 Star", Value = "5"
            });
            this.ViewBag.Ratings = new SelectList(Ratings_level, "Value", "Text");
            return(View(temp));
        }
Esempio n. 27
0
 private void MakeBreadCrumbs(Module module)
 {
     BreadCrumb.Clear();
     BreadCrumb.Add("/", "Home");
     if (module != null)
     {
         if (User.IsInRole("Teacher"))
         {
             BreadCrumb.Add(Url.Action("Index", "Modules", new { courseId = module.CourseId }), module.Course.Name);
             BreadCrumb.Add(Url.Action("Index", "Activities", new { moduleId = module.Id }), module.Name);
         }
         else
         {
             BreadCrumb.Add(Url.Action("Details", "Courses"), module.Course.Name);
             BreadCrumb.Add(Url.Action("Details", "Modules", new { id = module.Id }), module.Name);
         }
     }
 }
Esempio n. 28
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            air_conditioner air_conditioner = db.air_conditioner.Find(id);

            if (air_conditioner == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Appliance Type");
            BreadCrumb.Add(Url.Action("Index", "air_conditioner"), "Air Conditioner");
            return(View(air_conditioner));
        }
Esempio n. 29
0
        public ActionResult ManageUser(SearchUserViewModel model)
        {
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("ManageUser", "Home"), "Manage User");

            var pageIndex = 1;

            if (!string.IsNullOrEmpty(model.SearchButton) || model.Page.HasValue)
            {
                pageIndex           = model.Page ?? 1;
                model.SearchResults = _unitOfWork.UserProfile.GetAll()
                                      .Select(u => new UserInfoListViewModel()
                {
                    UserName  = u.UserName,
                    FirstName = u.FirstName,
                    LastName  = u.LastName,
                    Email     = u.Email,
                    Phone     = u.Phone
                }).Where(c => (c.LastName.StartsWith(model.LastName) || string.IsNullOrEmpty(model.LastName)) &&
                         (c.Email.StartsWith(model.Email) || string.IsNullOrEmpty(model.Email)))
                                      .OrderBy(o => o.LastName)
                                      .ToPagedList(pageIndex, 15);
            }
            else
            {
                model.SearchResults = _unitOfWork.UserProfile.GetAll()
                                      .Select(u => new UserInfoListViewModel()
                {
                    UserName  = u.UserName,
                    FirstName = u.FirstName,
                    LastName  = u.LastName,
                    Email     = u.Email,
                    Phone     = u.Phone
                }).Where(c => (c.LastName.StartsWith(model.LastName) || string.IsNullOrEmpty(model.LastName)) &&
                         (c.Email.StartsWith(model.Email) || string.IsNullOrEmpty(model.Email)))
                                      .OrderBy(o => o.LastName)
                                      .ToPagedList(pageIndex, 15);
            }
            return(Request.IsAjaxRequest()
                ? (ActionResult)PartialView("_UserInfo", model)
                : View("ManageUser", "_AdsLayout1", model));
        }
Esempio n. 30
0
 private void MakeBreadCrumbs(Course course, bool index = false)
 {
     BreadCrumb.Clear();
     BreadCrumb.Add("/", "Home");
     if (course != null)
     {
         if (User.IsInRole("Teacher"))
         {
             BreadCrumb.Add(Url.Action("Index", "Modules", new { courseId = course.Id }), course.Name);
         }
         else if (!index)
         {
             BreadCrumb.Add(Url.Action("Details", "Courses"), course.Name);
         }
         else
         {
             BreadCrumb.Add(Url.Action("Index", "Modules"), "Schedule for " + course.Name);
         }
     }
 }