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; }
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, "")); }