Esempio n. 1
0
        public ActionResult Store()
        {
            String          user    = User.Identity.GetUserName();
            UserDataLayer   uctx    = new UserDataLayer();
            UserDetails     usrdtls = uctx.getUser(user);
            EdibleDataLayer ectx    = new EdibleDataLayer();
            //List<string> NearByZipCodes = new List<string>();
            List <Edible> StoresAround1 = new List <Edible>();

            if (!string.IsNullOrEmpty(usrdtls.Zipcode.ToString()))
            {
                List <Edible> StoresAround = ectx.GetEdiblePages(usrdtls.Zipcode.ToString());
                StoresAround1 = StoresAround;
            }

            return(View(StoresAround1));
        }
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            if (User != null)
            {
                var username = User.Identity.Name;

                if (!string.IsNullOrEmpty(username))
                {
                    String        user    = User.Identity.Name;
                    UserDataLayer uctx    = new UserDataLayer();
                    UserDetails   usrdtls = uctx.getUser(user);
                    //string fullName = string.Concat(new string[] { usrdtls.Fname, " ", usrdtls.Lname });
                    string fullName = "";
                    fullName = usrdtls.Fname + " " + usrdtls.Lname;
                    ViewData.Add("FullName", fullName);
                }
            }
            base.OnActionExecuted(filterContext);
        }