/// <summary> /// Gets the matter type id for the project. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="projectId">The project id.</param> /// <returns></returns> public MatterTypeReturnValue GetMatterTypeId(HostSecurityToken oHostSecurityToken, Guid projectId) { MatterTypeReturnValue returnValue = new MatterTypeReturnValue(); if (Functions.ValidateIWSToken(oHostSecurityToken)) { oMatterService = new MatterService(); returnValue = oMatterService.GetMatterTypeId(Functions.GetLogonIdFromToken(oHostSecurityToken), projectId); } else { returnValue = new MatterTypeReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Dont allow to add associations for special matters. /// </summary> private void CheckForClientOnSpecialMatters() { if (Session[SessionName.ProjectId] != null && _ddlRole.SelectedIndex != -1) { MatterServiceClient matterService = new MatterServiceClient(); try { MatterTypeReturnValue returnValue = matterService.GetMatterTypeId(_logonSettings.LogonId, (Guid)Session[SessionName.ProjectId]); if (returnValue.Success) { int roleId = Convert.ToInt32(_ddlRole.SelectedValue); Button nextButton = (Button)_wizardAddAssociationsForMatter.FindControl("StartNavigationTemplateContainerID").FindControl("_btnWizardStartNextButton"); bool disabled = false; if ((returnValue.MatterTypeId != 1) && (returnValue.MatterTypeId != 6) && (roleId <= 2)) { disabled = true; } ScriptManager.RegisterStartupScript(this, Page.GetType(), "SpecialMatters", string.Format("$(\"#{0}\").attr(\"disabled\", {1});", nextButton.ClientID, disabled.ToString().ToLower()), true); } else { throw new Exception(returnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (matterService.State != System.ServiceModel.CommunicationState.Faulted) { matterService.Close(); } } } }