public void Save_RoleApplication(string json) { try { KeyValuePair <string, string>[] selectIDs = JSON.Deserialize <KeyValuePair <string, string>[]>(json); List <String> list = new List <string>(); foreach (KeyValuePair <string, string> row in selectIDs) { list.Add(row.Key); } SystemRoleWrapper.PatchAssignRoleApplications(SystemRoleWrapper.FindById(RoleID), list); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; } }
public void Save_RoleApplication(string json) { try { List <SystemApplicationWrapper> applications = JSON.Deserialize <List <SystemApplicationWrapper> >(json); List <String> list = new List <string>(); foreach (SystemApplicationWrapper systemApplicationWrapper in applications) { list.Add(systemApplicationWrapper.SystemApplicationID.ToString()); } SystemRoleWrapper.PatchAssignRoleApplications(SystemRoleWrapper.FindById(RoleID), list); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; } }
protected void btnAdd_Click(object sender, DirectEventArgs e) { try { string json = e.ExtraParams["addItem"]; List <SystemApplicationWrapper> companies = JSON.Deserialize <List <SystemApplicationWrapper> >(json); List <int> assignedAppIDs = new List <int>(); foreach (SystemApplicationWrapper systemApplicationWrapper in companies) { assignedAppIDs.Add(systemApplicationWrapper.SystemApplicationID); } SystemRoleWrapper systemRoleWrapper = SystemRoleWrapper.FindById(RoleID); SystemRoleWrapper.PatchAssignRoleApplications(systemRoleWrapper, assignedAppIDs); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), ex.Message); } }