public int DelBinding(Base_DataBindViewModel base_DataBindViewModel) { int[] needDelId = GetBindId(base_DataBindViewModel); int f = 0; if (needDelId != null && needDelId.Length > 0) { LessonBLL lsnBll = new LessonBLL(); for (int i = 0; i < needDelId.Length; i++) { //check there is lesson binded. if (!lsnBll.ExistByFk(needDelId[i])) { using (_db = new ApplicationDbContext()) { var m = _db.Base_DataBind.Find(needDelId[i]); if (m != null) { _db.Entry(m).State = EntityState.Deleted; f += _db.SaveChanges(); } } } } } return(f); }
public ActionResult DelLessonImage(string path) { int i = 0; if (!string.IsNullOrEmpty(path)) { if (path.IndexOf("/Content") != -1) { i = 1; } else { Common.Utility.DeleteFile(path); //Delete image file. i = new LessonBLL().DelLessonImage(path); } } return(Json(new { result = i }, JsonRequestBehavior.AllowGet)); }
public DefaultController() { lessonBLL = new LessonBLL(); }
public BasicLessonSvc() { _lessonBLL = new LessonBLL(); _vcrBLL = new TrainVcrBLL(); }
public VcrSvc() { trainVcrBLL = new TrainVcrBLL(); lessonBLL = new LessonBLL(); }
public TrainLessonController() { _lessonBLL = new LessonBLL(); _lessonSv = new TrainBaseLessonSv(); }