Exemple #1
0
        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);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public DefaultController()
 {
     lessonBLL = new LessonBLL();
 }
Exemple #4
0
 public BasicLessonSvc()
 {
     _lessonBLL = new LessonBLL();
     _vcrBLL    = new TrainVcrBLL();
 }
Exemple #5
0
 public VcrSvc()
 {
     trainVcrBLL = new TrainVcrBLL();
     lessonBLL   = new LessonBLL();
 }
Exemple #6
0
 public TrainLessonController()
 {
     _lessonBLL = new LessonBLL();
     _lessonSv  = new TrainBaseLessonSv();
 }