Ejemplo n.º 1
0
        private void Guarantor_Load(object sender, EventArgs e)
        {
            txtDonorNoOfDependents.Properties.Mask.MaskType     = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtDonorYearsOfEmployment.Properties.Mask.MaskType  = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtDonorMonthlyIncome.Properties.Mask.MaskType      = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtDonorMonthlyExpenditure.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            try
            {
                SBFAApi agent = new SBFAApi();
                using (new OperationContextScope(agent.context))
                {
                    sbfa.Guarantor[] gua = agent.operation.GetGuarantors(SBFAMain.currentId);
                    gridGuarantors.DataSource = gua;
                    gridGuarantors.RefreshDataSource();

                    sbfa.WorkFlowStages currentStage = agent.operation.GetDocumentWorkFlowStage(SBFAMain.currentId, "loan");
                    if (currentStage.StageName == "Complete")
                    {
                        btnAddGuarantor.Visible = false;
                    }
                    else
                    {
                        btnAddGuarantor.Visible = true;
                    }
                }
            }
            catch
            {
                ShowErrorMessage("Error initializing guarantors");
            }
        }
Ejemplo n.º 2
0
        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");
            }
        }