private void lstRules_SelectedIndexChanged(object sender, EventArgs e) { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { try { currentId = long.Parse(lstRules.SelectedItems[0].SubItems[0].Text); sbfa.FeeRules response = agent.operation.GetFeeRule(currentId); Globals.SetPickListValue(cmbField, response.RuleField); chkActive.Checked = response.Active; txtName.Text = response.RuleName; Globals.SetPickListValue(cmbDataType, response.RuleType); Globals.SetPickListValue(cmbExecutiontype, response.RuleExecutionType); txtValue.Text = response.RuleExecutionValue; Globals.SetPickListValue(cmbEvalField, response.RuleEvaluationField); Globals.SetPickListValue(cmbEvalDataType, response.RuleEvaluationDataType); Globals.SetPickListValue(cmbEvaluationType, response.RuleEvaluationType); txtEvalValue.Text = response.RuleEvaluationValue; txtEvalValueMax.Text = response.RuleEvaluationMaxValue; } catch { } } }
private void lstDocuments_SelectedIndexChanged(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.WorkFlowStageDocuments response = agent.operation.GetWorkFlowStageDocument(long.Parse(lstDocuments.SelectedItems[0].SubItems[0].Text)); Globals.SetPickListValue(cmbDocType, response.FK_DocumentTypeId); chkRequired.Checked = response.DocumentRequired; } } catch { ShowErrorMessage("Error viewing existing document configuration"); } }
private void lstDocuments_SelectedIndexChanged(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.WorkFlowStagesAutoDocuments response = agent.operation.GetWorkFlowStagesAutoDocument(long.Parse(lstDocuments.SelectedItems[0].SubItems[0].Text)); currentId = response.Id; Globals.SetPickListValue(cmbEmail, response.SendEmail); Globals.SetPickListValue(cmbSMS, response.SendSMS); Globals.SetPickListValue(cmbTemplate, response.FK_AutoDocumentName); chkActive.Checked = response.Active; } } catch { ShowErrorMessage("Error fetching record details"); } }
private void treeStages_AfterSelect(object sender, TreeViewEventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { if (treeStages.SelectedNode.Text.ToLower() != "stages") { currentWorkFlowStage = long.Parse(treeStages.SelectedNode.Name.Split('_')[1]); sbfa.WorkFlowStages wrk = agent.operation.GetWorkFlowStage(currentWorkFlowStage); txtName.Text = wrk.StageName; txtDescription.Text = wrk.StageDescription; Globals.SetPickListValue(cmbGroup, wrk.FK_RoleGroupId); cmbAssign.SelectedIndex = wrk.StageAssignMode; chkDoc.Checked = wrk.RequireDocuments; chkOptional.Checked = wrk.StageOptional; chkPay.Checked = wrk.RequirePayment; chkSite.Checked = wrk.RequireSiteVisit; chkReco.Checked = wrk.RequireRecommendations; Globals.SetPickListValue(cmbEmail, wrk.SendEmail); Globals.SetPickListValue(cmbSMS, wrk.SendSMS); Globals.SetPickListValue(cmbTemplate, wrk.FK_AutoDocumentName); lstDocuments.Items.Clear(); sbfa.WorkFlowStageDocuments[] response = agent.operation.GetWorkFlowStageDocuments(currentWorkFlowStage); foreach (sbfa.WorkFlowStageDocuments wrkFlow in response) { string[] row = { wrkFlow.Id.ToString(), agent.operation.GetDocumentTypeName(wrkFlow.FK_DocumentTypeId), ((wrkFlow.DocumentRequired) ? "Yes" : "No") }; var listViewItem = new ListViewItem(row); lstDocuments.Items.Add(listViewItem); } } } } catch { ShowErrorMessage("Error retriving stage details from server"); } }
private void lstRules_SelectedIndexChanged(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { chkNew.Checked = false; currentId = long.Parse(lstRules.SelectedItems[0].SubItems[0].Text); sbfa.WorkFlowFieldValidations response = agent.operation.GetValidation(currentId); Globals.SetPickListValue(cmbField, response.ParameterField); chkActive.Checked = response.Active; Globals.SetPickListValue(cmbDataType, response.ParameterDataType); txtText.Text = response.ParameterFieldName; txtValue.Text = response.ParameterValue; txtValueMax.Text = response.ParameterMaxValue; Globals.SetPickListValue(cmbEvaluationType, response.ParameterEvaluationType); } } catch { ShowErrorMessage("Failed to retrieve rule details"); } }
private void ManagerUserProperties_Load(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.ApplicationUsers response = agent.operation.GetUser(SBFAMain.currentUsername); lblUsername.Text = SBFAMain.currentUsername; chkActive.Checked = response.Active; chkExpires.Checked = response.PasswordExpires; chkLocked.Checked = response.Locked; lblChanged.Text = response.PasswordLastChanged.ToShortDateString(); lblExpiry.Text = response.PasswordExpiryDate.ToShortDateString(); txtEmail.Text = response.EmailAddress; txtMobile.Text = response.MobileNumber; txtName.Text = response.FirstName; txtSurname.Text = response.Surname; Globals.SetPickList(cmbStakeholder, "stahol"); Globals.SetPickListValue(cmbStakeholder, response.FK_StakeholderId); //get application user roles sbfa.ApplicationRoles[] roles = agent.operation.GetApplicationRoles("default"); foreach (sbfa.ApplicationRoles role in roles) { string currentRole = role.Name; treeSystemRoles.Nodes["systemRoles"].Nodes.Add(currentRole, currentRole); treeSystemRoles.Nodes["systemRoles"].Nodes[currentRole].Nodes.Add(role.Description); } //get selected user roles sbfa.ApplicationRoles[] userRoles = agent.operation.GetApplicationRoles(SBFAMain.currentUsername); foreach (sbfa.ApplicationRoles role in userRoles) { string currentRole = role.Name; treeUserRoles.Nodes["userSystemRoles"].Nodes.Add(currentRole, currentRole); treeUserRoles.Nodes["userSystemRoles"].Nodes[currentRole].Nodes.Add(role.Description); //remove from system roles treeSystemRoles.Nodes["systemRoles"].Nodes[currentRole].Remove(); } //get user group roles //get application user group roles sbfa.ApplicationRoleGroups[] rolesGroup = agent.operation.GetApplicationGroupRoles("default"); foreach (sbfa.ApplicationRoleGroups role in rolesGroup) { string currentRole = role.Name; treeSystemRoles.Nodes["systemGroupRoles"].Nodes.Add(currentRole, currentRole); treeSystemRoles.Nodes["systemGroupRoles"].Nodes[currentRole].Nodes.Add(role.Description); } //get selected user roles sbfa.ApplicationRoleGroups[] userRolesGroup = agent.operation.GetApplicationGroupRoles(SBFAMain.currentUsername); foreach (sbfa.ApplicationRoleGroups role in userRolesGroup) { string currentRole = role.Name; treeUserRoles.Nodes["userSystemGroupRoles"].Nodes.Add(currentRole, currentRole); treeUserRoles.Nodes["userSystemGroupRoles"].Nodes[currentRole].Nodes.Add(role.Description); //remove from system roles treeSystemRoles.Nodes["systemGroupRoles"].Nodes[currentRole].Remove(); } } } catch { ShowErrorMessage("Failed to initialize status"); } }