Beispiel #1
0
        // GET: Report
        public ActionResult Local()
        {
            var         identity = (System.Web.HttpContext.Current.User as MyIdentity.MyPrincipal).Identity as MyIdentity;
            ReportLocal model    = new ReportLocal();

            model.Restaurants = new SelectList(db.PR_RestaurantInfo(identity.User.IdCard).ToList(), "IdRestaurant", "Name");
            model.DateStart   = DateTime.Now.AddMonths(-1).ToString("yyyy-M-d");
            model.DateEnd     = DateTime.Now.ToString("yyyy-M-d");
            model.Result      = new List <ReportLocalResult>();

            return(View(model));
        }
        // GET: Restaurants
        public ActionResult Index()
        {
            var  identity   = (System.Web.HttpContext.Current.User as MyIdentity.MyPrincipal).Identity as MyIdentity;
            User loggedUser = db.User.Find(identity.User.IdCard);

            RestaurantsViewModel model = new RestaurantsViewModel();

            model.restaurant = db.PR_RestaurantInfo(identity.User.IdCard).ToList();
            return(View(model));
        }