public void SaveFormContent_AddNewUserGroup_ReturnSuccessfully() { var expect = "Successfully"; var result = ManageFormSave <UserGroup> .SaveFormContent("Add", _obj, _para); Assert.AreEqual(expect, result.Substring(0, 12), $"Add User Group action {result}"); _ids = int.Parse(result.Replace("Successfully", "")); }
public void SaveFormContent_DeleteTeacherGroupMember_ReturnSuccessfully() { PerpareForTest("Add"); var expect = "Successfully"; var result = ManageFormSave <UserGroupMemberTeacher> .DeleteFormContent(_ids, _obj, _para); Assert.AreEqual(expect, result, $"Delete User Group teacher member action {result}"); }
public void SaveFormContent_RemoveUserGroup_ReturnSuccessfully() { PerpareForTest("Add"); var expect = "Successfully"; var result = ManageFormSave <UserGroup> .SaveFormContent("Remove", _obj, _para); Assert.AreEqual(expect, result, $"Add User Group action {result}"); }
public void SaveFormContent_UpdateStudentGroupMember_ReturnSuccessfully() { PerpareForTest("Add"); _para.Comments = _para + " Update Student group member test"; var expect = "Successfully"; var result = ManageFormSave <UserGroupMemberStudent> .SaveFormContent("Edit", _obj, _para); Assert.AreEqual(expect, result, $"Edit User Group student member action {result}"); }
public void TestCleanup() { try { ManageFormSave <UserGroupMemberTeacher> .DeleteFormContent(_ids, _obj, _para); } catch (Exception) { throw; } }
public string SaveSecurityGroup2(string operation, UserGroup parameter) { try { string result = ManageFormSave <UserGroup> .SaveFormContent(operation, "UserGroup", parameter); return(result); } catch (Exception ex) { var em = ex.Message; return("Failed"); } }
public string PushGroupToAnotherApp(string operate, UserGroupPush parameter) { try { string result = ManageFormSave <UserGroupPush> .SaveFormContent(operate, "UserGroupPush", parameter); // string result = AppsBase.GeneralValue<string>("SecurityManage", "PushGroupToApps", parameter); return(result); } catch (Exception ex) { var em = ex.Message; return("Failed"); } }
public void SaveFormContent_AddNewTeacherGroupMember_ReturnSuccessfully() { // Arrange _para.Operate = "Add"; var expect = "Successfully"; //Act var result = ManageFormSave <UserGroupMemberTeacher> .SaveFormContent("Add", _obj, _para); var id = result.Replace("Successfully", ""); _para.IDs = id; _ids = int.Parse(id); //Assert StringAssert.Contains(result, expect, $"Add User Group teacher member action {result}"); }
private void PerpareForTest(string action) { try { _para.IDs = "0"; _para.GroupID = "UnitTestGroup_" + action; // var pList = new List<UserGroup> { _para }; var result = ManageFormSave <UserGroup> .SaveFormContent("Add", _obj, _para); var id = result.Replace("Successfully", ""); _para.IDs = id; _ids = int.Parse(id); } catch (Exception) { _ids = 0; } }
protected void btnRequest_Click(object sender, EventArgs e) { var parameter = new RequestPermission() { Operate = "Add", //"formInformation", UserID = WorkingProfile.UserId, IDs = hfIDs.Value, SchoolYear = WorkingProfile.SchoolYear, SchoolCode = ddlSchool.SelectedValue, AppID = ddlApps.SelectedValue, ModelID = ddlModel.SelectedValue, StaffUserID = TextUserID.Text, UserRole = TextUserRole.Text, Permission = rblPermission.SelectedValue, RequestType = "UserRequest", RequestValue = ddlScopeValue.SelectedValue, AccessScope = ddlAccessScope.SelectedValue, StartDate = dateStart.Value, EndDate = dateEnd.Value, Comments = TextComments.Text }; var result = ManageFormSave <RequestPermission> .SaveFormContent("Add", "RequestPermission", parameter); }
public string SaveSecurityGroupMemberTeacher(string memberType, string operation, UserGroupMemberTeacher para) { try { string result = ""; if (WebConfig.DataSource() == "API") { string uri = "UserGroupTeacher"; result = ManageFormSave <UserGroupMemberTeacher> .SaveFormContent("API", uri, para); } else { result = ManageFormSave <UserGroupMemberTeacher> .SaveFormContent(operation, "UserGroupTeacher", para); } return(result); } catch (Exception ex) { var em = ex.Message; return("Failed"); } }
protected void btnRequest_Click(object sender, EventArgs e) { var parameter = new RequestClassMatch() { Operate = "Add", //"formInformation", UserID = WorkingProfile.UserId, IDs = hfIDs.Value, SchoolYear = WorkingProfile.SchoolYear, SchoolCode = ddlSchool.SelectedValue, AppID = ddlApps.SelectedValue, ModelID = ddlModel.SelectedValue, StaffUserID = TextUserID.Text, UserRole = TextUserRole.Text, Semester = ddlSemester.SelectedValue, Term = ddlTerm.SelectedValue, MatchType = ddlMatchType.SelectedValue, MatchValue = ddlMatchValue.SelectedValue, StartDate = dateStart.Value, EndDate = dateEnd.Value, Comments = TextComments.Text }; var result = ManageFormSave <RequestClassMatch> .SaveFormContent("Add", "RequestClassMatch", parameter); }