Beispiel #1
0
        public ActionResult Create([Bind(Include = "SchoolDesc,FirstName,LastName,SchoolId,RoleId,UserEmail,UserId")] SchoolTeacher schoolteacher)
        {
            if (ModelState.IsValid)
            {
                db.SchoolTeachers.Add(schoolteacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(schoolteacher));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ImportId,ImportTypeId,ImportFile,UserId,ReadyToProcess,ProcesseDateTime,CreateDatetime")] tblImport tblimport)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblimport).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ImportTypeId = new SelectList(db.tblImportTypes, "ImportTypeId", "ImportTypeDesc", tblimport.ImportTypeId);
     ViewBag.UserId       = new SelectList(db.tblUsers, "UserId", "UserEmail", tblimport.UserId);
     return(View(tblimport));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "SchoolId,DistrictId,SchoolDesc,AddressId,CreateDatetime,ChangeDatetime")] tblSchool tblschool)
        {
            if (ModelState.IsValid)
            {
                db.tblSchools.Add(tblschool);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AddressId  = new SelectList(db.tblAddresses, "AddressId", "Address1", tblschool.AddressId);
            ViewBag.DistrictId = new SelectList(db.tblDistricts, "DistrictId", "DistrictDesc", tblschool.DistrictId);
            return(View(tblschool));
        }
Beispiel #4
0
        public ActionResult Create([Bind(Include = "ClassTeacherId,ClassId,UserId,CreateDatetime,ChangeDatetime")] tblClassTeacher tblclassteacher)
        {
            if (ModelState.IsValid)
            {
                _db.tblClassTeachers.Add(tblclassteacher);
                _db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ClassId = new SelectList(_db.tblClasses, "ClassId", "ClassDesc", tblclassteacher.ClassId);
            ViewBag.UserId  = new SelectList(_db.tblUsers, "UserId", "UserEmail", tblclassteacher.UserId);
            return(View(tblclassteacher));
        }