public int AddSubject(Base_Subject mdl) { using (_db = new ApplicationDbContext()) { _db.Base_Subject.Add(mdl); return(_db.SaveChanges()); } }
public int EditSubject(Base_Subject mdl) { using (_db = new ApplicationDbContext()) { _db.Entry(mdl).State = System.Data.Entity.EntityState.Modified; return(_db.SaveChanges()); } }
public ActionResult subjectEdit(Base_Subject mdl) { int i = 0; if (ModelState.IsValid) { i = trainBaseSv.EditSubject(mdl); } return(Json(new { i }, JsonRequestBehavior.AllowGet)); }
public ActionResult subjectAdd(Base_Subject mdl) { bool t = false; mdl.Id = Guid.NewGuid().ToString("n"); if (ModelState.IsValid) { mdl.IsBasic = false; mdl.MakeDay = DateTime.Now; mdl.Maker = MyUserId; mdl.SchoolId = base.BaseSchoolId; int s = trainBaseSv.AddSubject(mdl); t = s > 0; } return(Json(new { t }, JsonRequestBehavior.AllowGet)); }
public bool UpdateSubject(Base_Subject mdl) { throw new NotImplementedException(); }