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