Example #1
0
 public CourseCtrl(CourseScope scope, CourseService service, Sce sce) : base(scope, service, sce)
 {
     this.scope   = scope;
     this.service = service;
     scope.gridOpts.columnDefs = new List <ColumnDef> {
         new ColumnDef {
             name = "AC", width = 50, enableSorting = false, cellTemplate = "<div style='text-align:center'><a ng-click=\"getExternalScopes().EditAction(row)\" href=\"javascript:;\"> <i class=\"fa fa-pencil\"></i>  </a><a ng-click=\"getExternalScopes().RemoveAction(row)\" href=\"javascript:;\"> <i class=\"fa fa-trash\"></i>  </a></div>"
         }
         , new ColumnDef {
             name = "Title"
         }
         , new ColumnDef {
             name = "Credits"
         }
     };
     scope.gridOpts.onRegisterApi = gridApi => {
         gridApi.paging.on.pagingChanged(scope, (newPage, pageSize) => {
             this.pageNo   = newPage;
             this.pageSize = pageSize;
             this.GetPaged();
         });
     };
     this.GetPaged();
     this.LoadRelationalData();
 }
Example #2
0
        public async Task <IActionResult> InsertCourseScope(string scope)
        {
            var courseScope = new CourseScope()
            {
                Scope = scope,
            };

            var courseScopeInserted = await unitOfWork.GetRepository <CourseScope>().InsertAsync(courseScope);

            return(ApiResponder.RespondSuccessTo(HttpStatusCode.Ok, courseScopeInserted));
        }