private void ManageStages_Load(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.WorkFlowStages[] response = agent.operation.GetWorkFlowStages(SBFAMain.currentWorkFlow); foreach (sbfa.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; } catch { ShowErrorMessage("Error initializing stage configuration"); } }
private void ReceiveOldRepayment_Load(object sender, EventArgs e) { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { Globals.SetPickList(cmbPayMethod, "paymet"); Globals.SetPickList(cmbBranch, "bra"); Globals.SetPickList(cmbCurrency, "cur"); Globals.SetPickList(cmbFeePayMethod, "paymet"); Globals.SetPickList(cmbFeeBranch, "bra"); Globals.SetPickList(cmbFeeCurrency, "cur"); if (SBFAMain.oldAccount != "" && SBFAMain.oldLoan != "") { txtAccount.Text = SBFAMain.oldAccount; txtLoan.Text = SBFAMain.oldLoan; sbfa.BusinessRegistration reg = agent.operation.GetOldBusinessRegistrationByRegistration(txtAccount.Text, txtLoan.Text); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtAccount.Text, txtLoan.Text); double bal = bus.AccountBalance;// CalculateBalance(bus.AccountBalance.ToString(), bus.IntrestRate.ToString(), bus.LastCalculationDate); lblTotal.Text = bal.ToString(); lblDue.Text = bal.ToString(); } } }
private void ProcessInvoice_Load(object sender, EventArgs e) { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { //check documents sbfa.Invoice invoice = agent.operation.GetInvoice(SBFAMain.currentInvoiceId); lblAmount.Text = invoice.Currency + invoice.Amount.ToString(); lbSur.Text = invoice.Currency + invoice.AmountSurcharge.ToString(); lblDisc.Text = invoice.Currency + invoice.AmountDiscount.ToString(); lblTotal.Text = invoice.Currency + invoice.AmountTotal.ToString(); lblPaid.Text = invoice.CurrencyPaid + invoice.AmountPaid.ToString(); lblDue.Text = invoice.Currency + (invoice.AmountTotal - invoice.AmountPaid); lblReference.Text = invoice.FK_ReferenceNumber; lblFor.Text = invoice.DocumentType.ToUpper(); lblReceipt.Text = invoice.ReceiptNumber; due = invoice.AmountTotal - invoice.AmountPaid; cur = invoice.Currency; Globals.SetPickList(cmbPayMethod, "paymet"); Globals.SetPickList(cmbBranch, "bra"); Globals.SetPickList(cmbCurrency, "cur"); if (due <= 0) { btnOpenPay.Visible = false; pnlPay.Visible = false; btnPrint.Visible = true; } else { btnOpenPay.Visible = true; btnPrint.Visible = false; } //get applicant details if registration if (invoice.DocumentType == "loan") { sbfa.LoanRequest reg = agent.operation.GetLoanRequest(invoice.FK_DocumentId); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); } else if (invoice.DocumentType == "repayment") { sbfa.BusinessRegistration reg = agent.operation.GetBusinessRegistrationByRegistration(invoice.FK_ReferenceNumber.Split('_')[0]); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); } sbfa.InvoiceItem[] items = agent.operation.GetInvoiceItems(SBFAMain.currentInvoiceId); foreach (sbfa.InvoiceItem item in items) { string[] row = { item.Id.ToString(), item.Description, item.Amount.ToString() }; var listViewItem = new ListViewItem(row); lstItems.Items.Add(listViewItem); } } }
private void ReceiveRepayment_Load(object sender, EventArgs e) { btnPrint.Visible = false; SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { Globals.SetPickList(cmbPayMethod, "paymet"); Globals.SetPickList(cmbBranch, "bra"); Globals.SetPickList(cmbCurrency, "cur"); Globals.SetPickList(cmbFeePayMethod, "paymet"); Globals.SetPickList(cmbFeeBranch, "bra"); Globals.SetPickList(cmbFeeCurrency, "cur"); } }
private void AddUser_Load(object sender, EventArgs e) { try { txtPassword.ReadOnly = true; txtConfirm.ReadOnly = true; txtUsername.ReadOnly = true; SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { //get application user group roles sbfa.ApplicationRoleGroups[] rolesGroup = agent.operation.GetApplicationGroupRoles("default"); foreach (sbfa.ApplicationRoleGroups role in rolesGroup) { cmbRoleGroups.Items.Add(role.Name); } Globals.SetPickList(cmbStakeholder, "stahol"); } } catch { ShowErrorMessage("There has been an error initializing user"); } }
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"); } }