//[Authorize(Roles = "Administrator")]
        public ActionResult DeleteConfirmed(string id)
        {
            ProgrammeMaster programmeMaster = db.ProgrammeMaster.Find(id);

            db.ProgrammeMaster.Remove(programmeMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 //[Authorize(Roles = "Administrator")]
 public ActionResult Edit([Bind(Include = "ProgrammeId,ProgrammeName,ModuleId")] ProgrammeMaster programmeMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(programmeMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(programmeMaster));
 }
        //[Authorize(Roles = "Administrator")]
        public ActionResult Create([Bind(Include = "ProgrammeId,ProgrammeName,ModuleId")] ProgrammeMaster programmeMaster)
        {
            if (ModelState.IsValid)
            {
                db.ProgrammeMaster.Add(programmeMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(programmeMaster));
        }
        public ActionResult Create([Bind(Include = "CustomerId,ProgrammeId,ProgrammeName,CreatedDate,IsDeleted")] ProgrammeMaster programmeMaster)
        {
            if (ModelState.IsValid)
            {
                db.ProgrammeMasters.Add(programmeMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(programmeMaster));
        }
Beispiel #5
0
        // GET: ProgrammeMasters/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProgrammeMaster programmeMaster = db.ProgrammeMasters.Find(id);

            if (programmeMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(programmeMaster));
        }
        // GET: Admin/Programme/Details/5
        //[Authorize(Roles = "Administrator")]
        public ActionResult Details(string id)
        {
            UserViewModel userdetails = generic.GetUserDetail(User.Identity.GetUserId());

            ViewData["UserProfile"] = userdetails;
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProgrammeMaster programmeMaster = db.ProgrammeMaster.Find(id);

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

            return(View(programmeMaster));
        }