Пример #1
0
 public static void FillDto(Models.CourseType entity, ViewModels.CourseType coursetype)
 {
     coursetype.Id                   = entity.Id;
     coursetype.CalenderTypeId       = entity.CalenderTypeId;
     coursetype.CourseCategoryId     = entity.CourseCategoryId;
     coursetype.LicenseResultBasicId = entity.LicenseResultBasicId;
     coursetype.Title                = entity.Title;
     coursetype.Remark               = entity.Remark;
     coursetype.Interval             = entity.Interval;
     coursetype.IsGeneral            = entity.IsGeneral;
     coursetype.Status               = entity.Status;
 }
Пример #2
0
        public virtual CustomActionResult CanDelete(Models.CourseType entity)
        {
            //  if (HasChildren(entity.Id))
            //     return Exceptions.getCanNotDeleteException("Location-03");
            var course = this.context.ViewCourses.Where(q => q.CourseTypeId == entity.Id).Count();

            if (course > 0)
            {
                return(Exceptions.getCanNotDeleteException("CourseType-02-Courses found"));
            }

            return(new CustomActionResult(HttpStatusCode.OK, ""));
        }