public JsonResult GetClasses()
        {
            ClassController obj      = new ClassController();
            List <Class>    objClass = obj.GetClasses();

            return(Json(objClass, JsonRequestBehavior.AllowGet));
        }
        public async void Delete_Removes_Item()
        {
            // Arrange
            var toRemove = new Class()
            {
                ID = "1", color = "green", icon = "important", name = "iet", userID = "0"
            };
            var lengthBefore = controller.GetClasses().Result.Value.Count;

            // Act
            await controller.DeleteClass(toRemove.ID);

            // Assert
            var lengthAfter = repository.GetClasses("0").Result.Count;

            Assert.Equal(lengthBefore - 1, lengthAfter);
        }
Exemple #3
0
        protected void ddlStudentNameOnSelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlStudentName.SelectedIndex == 0)  // Refresh page to view control
            {
                Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
            }

            // Else
            var tc = new ClassController();
            int x  = int.Parse(ddlStudentName.SelectedValue);

            rptSubjectList.DataSource = tc.GetClasses(x);  // Get Classes based on studentId
            rptSubjectList.DataBind();

            ddlSubjects_build();  // Rebuild dllSubjects
        }