Ejemplo n.º 1
0
        public ActionResult Edit(int?id)
        {
            Instance = this;

            if (!id.HasValue)
            {
                return(HttpNotFound());
            }

            var Invoice = db.Invoices.Find(id.Value);

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

            return(View(Invoice));
        }
Ejemplo n.º 2
0
        public ActionResult View(int?id)
        {
            if (!id.HasValue)
            {
                return(HttpNotFound());
            }
            Instance = this;

            var Invoice = db.Invoices.Find(id.Value);

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

            if (User.Identity.GetUserId() != Invoice.UserId && !User.IsInRole("Medewerker") && !User.IsInRole("Eigenaar"))
            {
                return(HttpNotFound());
            }

            return(View(Invoice));
        }
Ejemplo n.º 3
0
 public ActionResult Manage()
 {
     Instance = this;
     return(View(db.Invoices.Where(x => !x.InleverDatum.HasValue).OrderBy(x => x.VanafDatum).ToList()));
 }