Exemple #1
0
    public void loadClientInformation(int ClientID)
    {
        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        mainDS.ClientDataTable cinfo = client.GetClientProfile(ClientID);
        if (cinfo.Count > 0)
        {
            try
            {
                mainDS.ClientRow rinfo = cinfo[0];
                lblClientName.InnerText = rinfo.datClientName.ToString();
                lblClientNo.InnerText   = rinfo.datClientNumber.ToString();
                string ctype = "Individual";
                if (rinfo.datClientType == 2)
                {
                    ctype = "Corporate";
                }
                lblClientType.InnerText = ctype;

                lblEmail.InnerText         = rinfo.datEmailAddress;
                lblMobile.InnerText        = rinfo.datMobileNumber1 + " " + rinfo.datMobileNumber2;
                lblNationality.InnerText   = rinfo.datNationality.ToString();
                lblPostalAddress.InnerText = rinfo.datPostalAddress;
                lblResAddress.InnerText    = rinfo.datCurrentResidentialAddress;
                lblTelephone.InnerText     = rinfo.datHomeTelephoneNumber;
            }
            catch (Exception ex) { }
        }
    }
    public void createAccount()
    {
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        mainDSTableAdapters.ClientTableAdapter           client  = new mainDSTableAdapters.ClientTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        mainDS.ClientDataTable           tblClient  = client.GetClientProfile(MySessionManager.ClientID);

        decimal interestrate = Convert.ToDecimal(tblLoanApp[0].datInterestRate.ToString());

        decimal IntAmt = (Convert.ToDecimal(lbltotalamt.InnerText) * (interestrate / 100));

        interestamt = IntAmt;
        decimal  AmtOut = Convert.ToDecimal(lbltotalamt.InnerText);
        decimal  FinRptBalance_monthly = IntAmt + AmtOut;
        DateTime enddate = addMonth(DateTime.Now, Convert.ToInt32(tblLoanApp[0].datDuration.ToString()));

        if ((tblClient.Rows.Count > 0) || (tblLoanApp.Rows.Count > 0))
        {
            int refreshedID = 0;
            if (tblLoanApp[0].IsdatRefreshedIDNull() == false)
            {
                refreshedID = tblLoanApp[0].datRefreshedID;
            }
            LoanAccountDSTableAdapters.GetLoanAccountTableAdapter account = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter();
            account.InsertLoanAccount(createAccountNumber(MySessionManager.ClientID),
                                      Convert.ToDecimal(tblLoanApp[0].datFees.ToString()),
                                      MySessionManager.ClientID,
                                      MySessionManager.AppID,
                                      Convert.ToInt32(tblLoanApp[0].datTeamID.ToString()),
                                      DateTime.Now,
                                      enddate,
                                      Convert.ToInt32(tblLoanApp[0].datInterestRate),
                                      Convert.ToInt32(tblLoanApp[0].datDuration.ToString()),
                                      0,
                                      IntAmt,
                                      AmtOut,
                                      FinRptBalance_monthly,
                                      MySessionManager.CurrentUser.UserID,
                                      FinRptBalance_monthly,
                                      DateTime.Now,
                                      DateTime.Now,
                                      Convert.ToInt32(tblLoanApp[0].datPurpose.ToString()),
                                      IntAmt,
                                      refreshedID,
                                      Convert.ToInt32(tblLoanApp[0].datCreditTeamID.ToString()),
                                      tblClient[0].datClientName.ToString(),
                                      Convert.ToInt32(tblLoanApp[0].datLoanType.ToString()));
        }
        LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter();
        LoanAccountDS.GetLoanAccountDataTable tblLoanAc = loanAc.GetLoanAccount1(MySessionManager.AppID, MySessionManager.ClientID);

        if (tblLoanAc.Rows.Count > 0)
        {
            MySessionManager.AccountID   = tblLoanAc[0].datID;
            MySessionManager.AppBranchID = tblLoanApp[0].datTeamID;
        }
    }
Exemple #3
0
    public void loadPersonalInformation()
    {
        try
        {
            mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            mainDS.ClientDataTable tblClient = client.GetClientProfile(MySessionManager.ClientID);

            if (tblClient.Rows.Count > 0)
            {
                this.editskip.Value = "2";
                if (tblClient[0].IsdatFirstNameNull() == false)
                {
                    txtfirstname.Value = tblClient[0].datFirstName.ToString();
                }
                if (tblClient[0].IsdatSurnameNull() == false)
                {
                    txtSurname.Value = tblClient[0].datSurname.ToString();
                }
                if (tblClient[0].IsdatMiddleNameNull() == false)
                {
                    txtMiddlename.Value = tblClient[0].datMiddleName.ToString();
                }
                if (tblClient[0].IsdatIDType1Null() == false)
                {
                    ddlNo1.SelectedValue = tblClient[0].datIDType1;
                }
                if (tblClient[0].IsdatIDType2Null() == false)
                {
                    ddlNo2.SelectedValue = tblClient[0].datIDType2;
                }
                if (tblClient[0].IsdatIDType3Null() == false)
                {
                    ddlidNo3.SelectedValue = tblClient[0].datIDType3;
                }
                if (tblClient[0].IsdatGenderNull() == false)
                {
                    ddlGender.SelectedValue = tblClient[0].datGender.ToString();
                }
                if (tblClient[0].IsdatTitleNull() == false)
                {
                    ddlTitle.SelectedValue = tblClient[0].datTitle.ToString();
                }
                if (tblClient[0].IsdatRegionNull() == false)
                {
                    ddlRegion.SelectedValue = tblClient[0].datRegion.ToString();
                }
                if (tblClient[0].IsdatMaritalStatusNull() == false)
                {
                    ddlMaritalStatus.SelectedValue = tblClient[0].datMaritalStatus.ToString();
                }
                if (tblClient[0].IsdatNationalityNull() == false)
                {
                    ddlNationality.SelectedValue = tblClient[0].datNationality.ToString();
                }
                if (tblClient[0].IsdatResidentialStatusNull() == false)
                {
                    ddlRecStatus.SelectedValue = tblClient[0].datResidentialStatus.ToString();
                }
                if (tblClient[0].IsdatIDValue1Null() == false)
                {
                    txtidNo1.Value = tblClient[0].datIDValue1.ToString();
                }
                if (tblClient[0].IsdatIDValue2Null() == false)
                {
                    txtidNo2.Value = tblClient[0].datIDValue2.ToString();
                }
                if (tblClient[0].IsdatIDValue3Null() == false)
                {
                    txtidNo3.Value = tblClient[0].datIDValue3.ToString();
                }
                if (tblClient[0].IsdatResidentialStatusNull() == false)
                {
                    ddlRecStatus.SelectedValue = tblClient[0].datResidentialStatus.ToString();
                }
                if (tblClient[0].IsdatSpouseNull() == false)
                {
                    txtSpouse.Text = tblClient[0].datSpouse.ToString();
                }
                if (tblClient[0].IsdatNoChildrenNull() == false)
                {
                    txtNoChildren.Text = tblClient[0].datNoChildren.ToString();
                }
                if (tblClient[0].IsdatMobileNumber1Null() == false)
                {
                    txtMobileNo1.Value = tblClient[0].datMobileNumber1.ToString();
                }
                if (tblClient[0].IsdatMobileNumber2Null() == false)
                {
                    txtMobileNo2.Value = tblClient[0].datMobileNumber2.ToString();
                }
                if (tblClient[0].IsdatOfficeTelephoneNumberNull() == false)
                {
                    txtOfficePhone.Value = tblClient[0].datOfficeTelephoneNumber.ToString();
                }
                if (tblClient[0].IsdatPostalAddressNull() == false)
                {
                    txtPostalAddress.Value = tblClient[0].datPostalAddress.ToString();
                }
                if (tblClient[0].IsdatNearestLandMarkNull() == false)
                {
                    txtLandMark.Value = tblClient[0].datNearestLandMark.ToString();
                }
                if (tblClient[0].IsdatCurrentResidentialAddressNull() == false)
                {
                    txthomeAddress.Value = tblClient[0].datCurrentResidentialAddress.ToString();
                }
                if (tblClient[0].IsdatPreviousResidentialAddressNull() == false)
                {
                    txtpreviousAddress.Value = tblClient[0].datPreviousResidentialAddress.ToString();
                }
                if (tblClient[0].IsdatHomeTelephoneNumberNull() == false)
                {
                    txttelephone.Value = tblClient[0].datHomeTelephoneNumber.ToString();
                }
                if (tblClient[0].IsdatFaxNumberNull() == false)
                {
                    txtfaxnumber.Value = tblClient[0].datFaxNumber.ToString();
                }
                if (tblClient[0].IsdatEmailAddressNull() == false)
                {
                    txtEmail.Value = tblClient[0].datEmailAddress.ToString();
                }
                if (tblClient[0].IsdatDateOfBirthNull() == false)
                {
                    txtBirthdate.Text = Convert.ToDateTime(tblClient[0].datDateOfBirth.ToString()).ToString("dd-MM-yyyy");
                }
            }
        }
        catch
        {
        }
    }