private void treeStakeholder_AfterSelect(object sender, TreeViewEventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { if (treeStakeholder.SelectedNode.Text.ToLower() != "stakeholders") { currentStakeholder = int.Parse(treeStakeholder.SelectedNode.Name.Split('_')[1]); senpa.Stakeholder stake = agent.operation.GetStakeholder(currentStakeholder); txtName.Text = stake.Name; txtDescription.Text = stake.Description; txtMobile.Text = stake.Mobile; txtEmail.Text = stake.Email; chkActive.Checked = stake.Active; lstBusiness.Items.Clear(); senpa.ReferenceTable[] response = agent.operation.GetStakeholderBusinessTypes(currentStakeholder); foreach (senpa.ReferenceTable busType in response) { string[] row = { busType.Id.ToString(), busType.Name, busType.Description }; var listViewItem = new ListViewItem(row); lstBusiness.Items.Add(listViewItem); } } } }
private void treeUserGroups_AfterSelect(object sender, TreeViewEventArgs e) { treeSystemRoles.Nodes["systemRoles"].Nodes.Clear(); treeUserRoles.Nodes["userSystemRoles"].Nodes.Clear(); SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get application user roles senpa.ApplicationRoles[] roles = agent.operation.GetApplicationRoles("default"); foreach (senpa.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 senpa.ApplicationRoles[] userRoles = agent.operation.GetApplicationUserGroupRoles(treeUserGroups.SelectedNode.Text); foreach (senpa.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(); } } }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { string loginResponse = SenpaApi.SignIn(username, password); signInSuccessful = loginResponse; if (loginResponse.Equals("successful")) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get user group roles senpa.ApplicationRoleGroups[] accessGroupRoles = agent.operation.GetApplicationGroupRoles(Globals.userLogged); foreach (senpa.ApplicationRoleGroups roleName in accessGroupRoles) { Globals.userGroupRoles.Add(roleName.Name); } //get user roles senpa.ApplicationRoles[] accessRoles = agent.operation.GetApplicationRoles(Globals.userLogged); foreach (senpa.ApplicationRoles roleName in accessRoles) { Globals.userRoles.Add(roleName.Name); } } signInSuccessful = loginResponse; } }
private void treeStages_AfterSelect(object sender, TreeViewEventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { if (treeStages.SelectedNode.Text.ToLower() != "stages") { currentWorkFlowStage = long.Parse(treeStages.SelectedNode.Name.Split('_')[1]); senpa.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(); senpa.WorkFlowStageDocuments[] response = agent.operation.GetWorkFlowStageDocuments(currentWorkFlowStage); foreach (senpa.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); } } } }
private void btnSave_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { string password = ""; if (chkDefaultPassword.Checked) { password = agent.operation.DefaultPassword(); } else { password = txtPassword.Text; } senpa.UserActionResponse response = agent.operation.AddUser(txtUsername.Text, password, Globals.GetComboBoxValue(cmbStakeholder), cmbRoleGroups.Text, txtName.Text, txtSurname.Text, txtEmail.Text, txtMobile.Text, chkPasswordExpires.Checked, chkActive.Checked, chkLocked.Checked); if (response.actionStatus) { txtName.Text = ""; txtSurname.Text = ""; txtUsername.Text = ""; txtEmail.Text = ""; txtMobile.Text = ""; txtPassword.Text = ""; } else { MessageBox.Show(response.responseMessage); } } }
private void ManageUserGroupProperties_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get application user roles senpa.ApplicationRoles[] roles = agent.operation.GetApplicationRoles("default"); foreach (senpa.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 user group roles //get application user group roles senpa.ApplicationRoleGroups[] rolesGroup = agent.operation.GetApplicationGroupRoles("default"); foreach (senpa.ApplicationRoleGroups role in rolesGroup) { string currentRole = role.Name; treeUserGroups.Nodes["userGroups"].Nodes.Add(currentRole, currentRole); treeUserGroups.Nodes["userGroups"].Nodes[currentRole].Nodes.Add(role.Description); } } }
private void lstRules_SelectedIndexChanged(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { try { currentId = long.Parse(lstRules.SelectedItems[0].SubItems[0].Text); senpa.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 printReceipt() { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { Byte[] doc = agent.operation.GetAutoDocument("receipt", long.Parse(lblReceipt.Text)); string filePath = Application.StartupPath + "\\filer\\" + lblReceipt.Text + ".pdf"; FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write); fs.Write(doc, 0, doc.Length); fs.Flush(); fs.Close(); System.Diagnostics.Process newProcess = new System.Diagnostics.Process(); newProcess.StartInfo = new System.Diagnostics.ProcessStartInfo(filePath); newProcess.Start(); newProcess.WaitForExit(); try { System.IO.File.Delete(filePath); } catch { } this.Close(); } }
private void btnRemoveRole_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { TreeNode temp = treeUserRoles.SelectedNode; senpa.UserRoleActionResponse response; if (FindRootNode(temp).Name == "userSystemRoles") { response = agent.operation.RemoveRole(SEnPAMain.currentUsername, treeUserRoles.SelectedNode.Text); } else { response = agent.operation.RemoveGroupRole(SEnPAMain.currentUsername, treeUserRoles.SelectedNode.Text); } if (response.actionStatus) { if (FindRootNode(temp).Name == "userSystemRoles") { treeUserRoles.SelectedNode.Remove(); treeSystemRoles.Nodes["systemRoles"].Nodes.Add(temp); } else { treeUserRoles.SelectedNode.Remove(); treeSystemRoles.Nodes["systemGroupRoles"].Nodes.Add(temp); } } else { ; } } }
private void ManagerUserProperties_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { senpa.ApplicationUsers response = agent.operation.GetUser(SEnPAMain.currentUsername); lblUsername.Text = SEnPAMain.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 senpa.ApplicationRoles[] roles = agent.operation.GetApplicationRoles("default"); foreach (senpa.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 senpa.ApplicationRoles[] userRoles = agent.operation.GetApplicationRoles(SEnPAMain.currentUsername); foreach (senpa.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 senpa.ApplicationRoleGroups[] rolesGroup = agent.operation.GetApplicationGroupRoles("default"); foreach (senpa.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 senpa.ApplicationRoleGroups[] userRolesGroup = agent.operation.GetApplicationGroupRoles(SEnPAMain.currentUsername); foreach (senpa.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(); } } }
private void chkExpires_CheckedChanged(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { senpa.UserActionResponse response = agent.operation.UpdateUser(SEnPAMain.currentUsername, ((chkExpires.Checked) ? "expire" : "notexpire")); chkExpires.Checked = response.actionStatus; } }
private void ManageStakeholder_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { senpa.Stakeholder[] response = agent.operation.GetStakeholders(); foreach (senpa.Stakeholder stake in response) { string currentStake = "_" + stake.Id.ToString(); treeStakeholder.Nodes["stakeHolder"].Nodes.Add(currentStake, stake.Name); } } }
private void lstDocuments_SelectedIndexChanged(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { try { senpa.WorkFlowStageDocuments response = agent.operation.GetWorkFlowStageDocument(long.Parse(lstDocuments.SelectedItems[0].SubItems[0].Text)); Globals.SetPickListValue(cmbDocType, response.FK_DocumentTypeId); chkRequired.Checked = response.DocumentRequired; } catch { } } }
private void UserAccountSettings_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get user profile senpa.ApplicationUsers tempUser = agent.operation.GetUser(Globals.userLogged); txtName.Text = tempUser.FirstName; txtSurname.Text = tempUser.Surname; txtEmail.Text = tempUser.EmailAddress; txtPhone.Text = tempUser.MobileNumber; } }
private void btnSave_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { long stake = agent.operation.SaveStakeholder(txtName.Text, txtDescription.Text, txtMobile.Text, txtEmail.Text, chkActive.Checked); if (stake > 0) { lstBusiness.Items.Clear(); string currentStake = "_" + stake.ToString(); treeStakeholder.Nodes["stakeHolder"].Nodes.Add(currentStake, txtName.Text); } } }
private void btnAdd_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get application user roles senpa.UserRoleActionResponse response = agent.operation.AddUserGroup(txtGroup.Text, txtDescription.Text); if (response.actionStatus) { string currentRole = txtGroup.Text; treeUserGroups.Nodes["userGroups"].Nodes.Add(currentRole, currentRole); treeUserGroups.Nodes["userGroups"].Nodes[currentRole].Nodes.Add(txtDescription.Text); } } }
private void btnPay_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { string response = agent.operation.PayInvoice(SEnPAMain.currentInvoiceId, cmbCurrency.Text, float.Parse(txtPayAmount.Text), float.Parse(lblChange.Text), Globals.GetComboBoxValue(cmbBranch), Globals.GetComboBoxValue(cmbPayMethod)); if (response != "0") { lblReceipt.Text = response; pnlPay.Visible = false; btnOpenPay.Visible = false; btnPrint.Visible = true; } } }
private void btnPay_Click_1(object sender, EventArgs e) { if (txtPayAmount.Text.Equals("")) { ShowValidationError("Please enter the amount to be paid."); return; } if (isNumeric(txtPayAmount.Text) == false) { ShowValidationError("Please enter a valid amount to be paid."); txtPayAmount.Focus(); return; } SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { string response = agent.operation.PayInvoice(SEnPAMain.currentInvoiceId, cmbCurrency.Text, float.Parse(txtPayAmount.Text), float.Parse(lblChange.Text), Globals.GetComboBoxValue(cmbBranch), Globals.GetComboBoxValue(cmbPayMethod)); if (response != "0") { lblReceipt.Text = response; pnlPay.Visible = false; btnOpenPay.Visible = false; btnPrint.Visible = true; } if (response != "0") { lblReceipt.Text = response; pnlPay.Visible = false; btnOpenPay.Visible = false; btnPrint.Visible = false; ShowSuccessMessage("Payment successful. The receipt number for this payment is " + lblReceipt.Text); if (chkPrint.Checked == true) { printReceipt(); } } else { ShowErrorMessage("An error occured making the payment!"); } } }
private void lstDocuments_SelectedIndexChanged(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { try { senpa.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 { } } }
private void AddUser_Load(object sender, EventArgs e) { txtPassword.ReadOnly = true; txtConfirm.ReadOnly = true; txtUsername.ReadOnly = true; SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { //get application user group roles senpa.ApplicationRoleGroups[] rolesGroup = agent.operation.GetApplicationGroupRoles("default"); foreach (senpa.ApplicationRoleGroups role in rolesGroup) { cmbRoleGroups.Items.Add(role.Name); } Globals.SetPickList(cmbStakeholder, "stahol"); } }
private void btnAddRole_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { senpa.UserRoleActionResponse response = agent.operation.AddUserGroupRole(treeUserGroups.SelectedNode.Text, treeSystemRoles.SelectedNode.Text); if (response.actionStatus) { TreeNode temp = treeSystemRoles.SelectedNode; treeSystemRoles.SelectedNode.Remove(); treeUserRoles.Nodes["userSystemRoles"].Nodes.Add(temp); } else { ; } } }
private void btnSave_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { long wrk = agent.operation.CreateWorkFlowStage(SEnPAMain.currentWorkFlow, 0, txtName.Text, txtDescription.Text, Globals.GetComboBoxValue(cmbGroup), cmbAssign.SelectedIndex, chkOptional.Checked, chkDoc.Checked, chkPay.Checked, chkSite.Checked, chkReco.Checked, cmbTemplate.SelectedValue.ToString(), Globals.GetComboBoxValue(cmbEmail), Globals.GetComboBoxValue(cmbSMS)); if (wrk > 0) { lstDocuments.Items.Clear(); string currentFlow = "_" + wrk.ToString(); treeStages.Nodes["workStages"].Nodes.Add(currentFlow, txtName.Text); } else if (wrk == -1) { ;//error msg } } }
private void btnSave_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { try { long save = agent.operation.SaveFeeRule(currentTypeId, txtName.Text, cmbDataType.SelectedValue.ToString(), cmbField.SelectedValue.ToString(), cmbExecutiontype.SelectedValue.ToString(), txtValue.Text, cmbEvalField.SelectedValue.ToString(), cmbEvalDataType.SelectedValue.ToString(), cmbEvaluationType.SelectedValue.ToString(), txtEvalValue.Text, txtEvalValueMax.Text, chkActive.Checked); if (save > 0) { currentId = save; string[] row = { save.ToString(), txtName.Text, cmbDataType.SelectedText, cmbField.SelectedText, cmbExecutiontype.SelectedText, txtValue.Text, cmbEvalField.SelectedText, cmbEvalDataType.SelectedText, cmbEvaluationType.SelectedText, txtEvalValue.Text, txtEvalValueMax.Text, ((chkActive.Checked) ? "Yes" : "No") }; var listViewItem = new ListViewItem(row); lstRules.Items.Add(listViewItem); } } catch { } } }
private void btnDocs_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { bool wrk = agent.operation.CreateWorkFlowStageDocument(currentWorkFlowStage, Globals.GetComboBoxValue(cmbDocType), chkRequired.Checked); if (wrk) { lstDocuments.Items.Clear(); senpa.WorkFlowStageDocuments[] response = agent.operation.GetWorkFlowStageDocuments(currentWorkFlowStage); foreach (senpa.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); } } } }
private void ManageStageAutoDocuments_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { lstDocuments.Items.Clear(); senpa.WorkFlowStagesAutoDocuments[] response = agent.operation.GetWorkFlowStagesAutoDocuments(ManageStages.currentWorkFlowStage); foreach (senpa.WorkFlowStagesAutoDocuments wrkFlow in response) { string[] row = { wrkFlow.Id.ToString(), wrkFlow.FK_AutoDocumentName, ((wrkFlow.SendEmail) == -1 ? "No" : ((wrkFlow.SendEmail) == 0 ? "On Enter" : "On Leave")), ((wrkFlow.SendSMS) == -1 ? "No" : ((wrkFlow.SendSMS) == 0 ? "On Enter" : "On Leave")) }; var listViewItem = new ListViewItem(row); lstDocuments.Items.Add(listViewItem); } } Globals.SetStageMessagingPickList(cmbEmail); Globals.SetStageMessagingPickList(cmbSMS); Globals.SetAutoDocumentPickList(cmbTemplate); }
private void btnSave_Click(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { long wrk = agent.operation.CreateWorkFlowStagesAutoDocument(ManageStages.currentWorkFlowStage, cmbTemplate.SelectedValue.ToString(), Globals.GetComboBoxValue(cmbEmail), Globals.GetComboBoxValue(cmbSMS), chkActive.Checked); if (wrk > -1) { lstDocuments.Items.Clear(); senpa.WorkFlowStagesAutoDocuments[] response = agent.operation.GetWorkFlowStagesAutoDocuments(ManageStages.currentWorkFlowStage); foreach (senpa.WorkFlowStagesAutoDocuments wrkFlow in response) { string[] row = { wrkFlow.Id.ToString(), wrkFlow.FK_AutoDocumentName, ((wrkFlow.SendEmail) == -1 ? "No" : ((wrkFlow.SendEmail) == 0 ? "On Enter" : "On Leave")), ((wrkFlow.SendSMS) == -1 ? "No" : ((wrkFlow.SendSMS) == 0 ? "On Enter" : "On Leave")) }; var listViewItem = new ListViewItem(row); lstDocuments.Items.Add(listViewItem); } } } }
private void ManageStages_Load(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { senpa.WorkFlowStages[] response = agent.operation.GetWorkFlowStages(SEnPAMain.currentWorkFlow); foreach (senpa.WorkFlowStages wrkFlow in response) { string currentFlow = "_" + wrkFlow.Id.ToString(); treeStages.Nodes["workStages"].Nodes.Add(currentFlow, wrkFlow.StageName); } Globals.SetPickList(cmbGroup, "rolgro"); Globals.SetPickList(cmbDocType, "doctyp"); } Globals.SetStageMessagingPickList(cmbEmail); Globals.SetStageMessagingPickList(cmbSMS); Globals.SetAutoDocumentPickList(cmbTemplate); cmbAssign.SelectedIndex = 0; }
private void treeDocuments_AfterSelect(object sender, TreeViewEventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { if (treeDocuments.SelectedNode.Text.ToLower() != "documents") { currentDoc = treeDocuments.SelectedNode.Name; Globals.SetFieldsPickList(cmbField, currentDoc); lstRules.Items.Clear(); senpa.WorkFlowFieldValidations[] response = agent.operation.GetValidationsList(currentDoc); foreach (senpa.WorkFlowFieldValidations rule in response) { string[] row = { rule.Id.ToString(), rule.ParameterField, rule.ParameterFieldName, rule.ParameterDataType, rule.ParameterValue, rule.ParameterMaxValue, rule.ParameterEvaluationType, ((rule.Active)?"Yes":"No") }; var listViewItem = new ListViewItem(row); lstRules.Items.Add(listViewItem); } } } }
private void lstRules_SelectedIndexChanged(object sender, EventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { try { chkNew.Checked = false; currentId = long.Parse(lstRules.SelectedItems[0].SubItems[0].Text); senpa.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 { } } }
private void treeFees_AfterSelect(object sender, TreeViewEventArgs e) { SenpaApi agent = new SenpaApi(); using (new OperationContextScope(agent.context)) { if (treeFees.SelectedNode.Text.ToLower() != "fees") { currentTypeId = int.Parse(treeFees.SelectedNode.Name.Split('_')[0]); Globals.SetFieldsPickList(cmbField, treeFees.SelectedNode.Name.Split('_')[1]); Globals.SetFieldsPickList(cmbEvalField, treeFees.SelectedNode.Name.Split('_')[1]); lstRules.Items.Clear(); senpa.FeeRules[] response = agent.operation.GetFeeRulesList(treeFees.SelectedNode.Name.Split('_')[1]); foreach (senpa.FeeRules rule in response) { string[] row = { rule.Id.ToString(), rule.RuleName, rule.RuleType, rule.RuleField, rule.RuleExecutionType, rule.RuleExecutionValue, rule.RuleEvaluationField, rule.RuleEvaluationDataType, rule.RuleEvaluationType, rule.RuleEvaluationValue, rule.RuleEvaluationMaxValue, ((rule.Active) ? "Yes" : "No") }; var listViewItem = new ListViewItem(row); lstRules.Items.Add(listViewItem); } } } }