Exemple #1
0
        private void updateInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lv.SelectedItems.Count > 0) {

                Member mem, sel = new Member();
                //MessageBox.Show(lv.SelectedItems[0].SubItems[1].Text);
                sel.memid = lv.SelectedItems[0].SubItems[1].Text;

                mem= sel.SELECT_BY_ID();
                mem.GET_IMAGE_BY_ID();

                if (mem != null) {
                    pnlops.Controls.Clear();
                    mem_update c = new mem_update();
                    c.mem = mem;
                    c.Width = pnlops.Width;
                    pnlops.Height = c.Height;
                    pnlops.Controls.Add(c);
                }

            }
        }
Exemple #2
0
        private void cboMem_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtinterest.Text = "";
            txtinterest_amort.Text = "";
            txtprincipal.Text = "";
            txtprincipal_amort.Text = "";
            txttotal_amort.Text = "";
            cbocollection_day.Text = "";
            cbopayment_mode.Text = "";
            txtinterest.Text = "";
            cboamortization_period.Text = "";
            MAXIMUM_ALLOWED_LOAN = 0;

            lbmembersdata.Items.Clear();
            lblatestloan.Items.Clear();
            cboComaker.Text = "";
            pbcomaker.Image = null;
            lblcomaker.Text = "";
            lblcomaker.BackColor = Color.Transparent;
            lbcomakersdata.Items.Clear();
            lbcomakerslatestloan.Items.Clear();

            if (cboMem.Text != "")
            {
                String[] c = cboMem.Text.ToString().Split('-');
                String id = c[c.Length-2] + "-" + c[c.Length-1];

                Member m2 = new Member();
                //MessageBox.Show(id);
                m2.memid = id;
                applicant = m2.SELECT_BY_ID();
                m2.GET_IMAGE_BY_ID();

                lblmem.Text = applicant.fullname.ToString().ToUpper() + " - " + applicant.occupation.ToString();

                Member_Capital mc = new Member_Capital();
                mc.memid = applicant.memid;

                decimal cbu = mc.GET_CURRENT_PAID_UP_CAPITAL();

                lbmembersdata.Items.Add("MEMBER'S VERIFICATION DATA");
                lbmembersdata.Items.Add("MEMBER SINCE : " + applicant.acceptance_date.ToShortDateString());
                lbmembersdata.Items.Add("MEMBER STANDING : " + applicant.standing);
                lbmembersdata.Items.Add("CBU AS OF " + DateTime.Now.ToShortDateString() + " : PhP " + cbu.ToString("#,##0.00"));

                l.empid = applicant.memid;

                Loan applicant_latest_loan = l.GET_LATEST_LOAN("MICRO");
                PREV_LOAN = applicant_latest_loan;
                // GET THE LATEST MICRO LOAN OF A MEMBER
                lblatestloan.Items.Add("LATEST MICRO LOAN");
                LATEST_MICRO_LOAN = (applicant_latest_loan != null) ? applicant_latest_loan.principal : 0;

                if (LATEST_MICRO_LOAN != 0) {

                    lblatestloan.Items.Add("APPLICATION NO : " + applicant_latest_loan.application_no);
                    lblatestloan.Items.Add("PRINCIPAL : PhP " + applicant_latest_loan.principal.ToString("#,##0.00"));
                    lblatestloan.Items.Add("INTEREST : PhP " + applicant_latest_loan.interest.ToString("#,##0.00"));
                    lblatestloan.Items.Add("MONTHLY AMORTIZATION: PhP " + (applicant_latest_loan.amortization_on_interest + applicant_latest_loan.amortization_on_principal).ToString("#,##0.00"));
                    lblatestloan.Items.Add("BALANCE: ---(under development)---");
                }
                else
                {

                    lblatestloan.Items.Add("Nothing found...");

                }

                //lblmemdata2.Text = "CAPITAL BUILD-UP :" +cbu.ToString("#,##0.00");

                if (cbu >= MINIMUM_SHARED_CAPITAL_TO_AVAIL_LOAN)
                {
                    lbmembersdata.Items.Add("PASSED THE MINIMUM : " + MINIMUM_SHARED_CAPITAL_TO_AVAIL_LOAN.ToString("#,##0.00") + " SHARE TO AVAIL LOAN");
                    lblmem.BackColor = Color.Green;

                    //subtract minimum shared capital from the CBU
                    //then get the 60% -- because 60% of (CBU-MINIMUM_SHARED_CAPITAL) is the
                    //LOANABLE_AMOUNT
                    MAXIMUM_ALLOWED_LOAN = (cbu - MINIMUM_SHARED_CAPITAL) * PERCENTAGE_TOGET_LOANABLE_AMOUNT;
                    lbmembersdata.Items.Add("MAX LOANABLE AMOUNT : PhP " + MAXIMUM_ALLOWED_LOAN.ToString("#,##0.00"));

                }
                else {

                    lbmembersdata.Items.Add("DID NOT PASSED THE MINIMUM : " + MINIMUM_SHARED_CAPITAL_TO_AVAIL_LOAN.ToString("#,##0.00") + " SHARE TO AVAIL LOAN");
                    lblmem.BackColor = Color.Red;
                }

                if (m2.pic != null)
                {
                    MemoryStream ms = new MemoryStream(m2.pic);
                    pb.Image = Image.FromStream(ms);
                    pb.SizeMode = PictureBoxSizeMode.Zoom;
                }
                else
                {
                    pb.Image = Properties.Resources.noimagefound;
                    pb.SizeMode = PictureBoxSizeMode.Zoom;
                }
            }
        }