Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ClassStandard classstandard = db.ClassStandards.Find(id);

            db.ClassStandards.Remove(classstandard);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Roomno,FloorNo,Section,EmployeeID,MaxStudents,CreatedDate,UpdatedDate")] ClassStandard classstandard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classstandard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID);
     return(View(classstandard));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Roomno,FloorNo,Section,EmployeeID,MaxStudents,CreatedDate,UpdatedDate")] ClassStandard classstandard)
        {
            classstandard.CreatedDate = DateTime.Now;
            classstandard.UpdatedDate = DateTime.Now;
            if (ModelState.IsValid)
            {
                db.ClassStandards.Add(classstandard);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID);
            return(View(classstandard));
        }
Example #4
0
        // GET: /ClassStandard/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClassStandard classstandard = db.ClassStandards.Find(id);

            if (classstandard == null)
            {
                return(HttpNotFound());
            }
            return(View(classstandard));
        }
Example #5
0
        // GET: /ClassStandard/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClassStandard classstandard = db.ClassStandards.Find(id);

            if (classstandard == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID);
            return(View(classstandard));
        }