private void simpleButton4_Click(object sender, EventArgs e) { if (txtFeePayAmount.Text.Equals("")) { ShowValidationError("Please enter the amount to be paid."); return; } if (isNumeric(txtFeePayAmount.Text) == false) { ShowValidationError("Please enter a valid amount to be paid."); txtFeePayAmount.Focus(); return; } SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { string rec = agent.operation.ReceiptFeeRepayment(txtFeeAccount.Text, cmbFeeCurrency.Text, float.Parse(txtFeePayAmount.Text), Globals.GetComboBoxValue(cmbFeeBranch), Globals.GetComboBoxValue(cmbFeePayMethod)); if (rec != "0") { lblReceipt.Text = rec; btnPrint.Visible = true; } if (rec != "0") { lblReceipt.Text = rec; btnPrint.Visible = false; ShowSuccessMessage("Payment successful. The receipt number for this payment is " + lblReceipt.Text); if (chkPrint.Checked == true) { try { printReceipt(rec); } catch (Exception ex) { ShowError("An error occured in printing. Please install a PDF Reader and try again."); } } } else { ShowErrorMessage("An error occured making the payment!"); } } }
private void btnSave_Click(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); 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(); sbfa.WorkFlowStagesAutoDocuments[] response = agent.operation.GetWorkFlowStagesAutoDocuments(ManageStages.currentWorkFlowStage); foreach (sbfa.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); } } } } catch { ShowErrorMessage("Error saving your stage document config"); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtUsername.Text == "" || txtName.Text == "") { ShowErrorMessage("Please enter all main fields"); return; } if (!chkDefaultPassword.Checked && (txtPassword.Text != txtConfirm.Text)) { ShowErrorMessage("Password mismatch"); return; } try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { string password = ""; if (chkDefaultPassword.Checked) { password = agent.operation.DefaultPassword(); } else { password = txtPassword.Text; } sbfa.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 { ShowErrorMessage(response.responseMessage); } } } catch { ShowErrorMessage("There has been an error saving user"); } }
private void btnDocs_Click(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { bool wrk = agent.operation.CreateWorkFlowStageDocument(currentWorkFlowStage, Globals.GetComboBoxValue(cmbDocType), chkRequired.Checked); if (wrk) { 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 refreshing documents"); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtName.Text == "") { ShowErrorMessage("Please name is required"); return; } try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { long wrk = agent.operation.CreateWorkFlowStage(SBFAMain.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 } } } catch { ShowErrorMessage("Failed to save your details"); } }
private void btnPay_Click(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."); txtFeePayAmount.Focus(); return; } SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtAccount.Text, txtLoan.Text); // DateTime lDt = GetLastCalculationDate(bus.LastCalculationDate); DateTime lDt = DateTime.Parse(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "-01 06:00:00.000"); string rec = agent.operation.OldReceiptRepayment(bus.AccountNumber, bus.LoanNumber, cmbCurrency.Text, float.Parse(lblDue.Text), float.Parse(txtPayAmount.Text), Globals.GetComboBoxValue(cmbBranch), Globals.GetComboBoxValue(cmbPayMethod), lDt); if (rec != "0") { lblReceipt.Text = rec; btnPrint.Visible = true; } if (rec != "0") { lblReceipt.Text = rec; btnPrint.Visible = false; ShowSuccessMessage("Payment successful. The receipt number for this payment is " + lblReceipt.Text); if (chkPrint.Checked == true) { try { printReceipt(rec); } catch (Exception ex) { ShowError("An error occured in printing. Please install a PDF Reader and try again."); } } } else { ShowErrorMessage("An error occured making the payment!"); } } }