Ejemplo n.º 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) { }
        }
    }
Ejemplo n.º 2
0
    public void loadCompanyDetails(int clientID)
    {
        try
        {
            mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];
            LoanDSTableAdapters.CoporateInformationTableAdapter companyDetails = new LoanDSTableAdapters.CoporateInformationTableAdapter();
            LoanDS.CoporateInformationDataTable tblCompanyDetails = companyDetails.GetCoporateInformation(MySessionManager.ClientID);

            if (tblCompanyDetails.Rows.Count > 0)
            {
                txtCompanyName.Value       = tblCompanyDetails[0].datCompanyName.ToString();
                txtCommencementDate.Text   = tblCompanyDetails[0].datCommencementDate.ToShortDateString();
                txtNatureofbusiness.Value  = tblCompanyDetails[0].datNatureOfBusiness.ToString();
                txtPhysicalAddress.Value   = tblCompanyDetails[0].datPhysicalAddress.ToString();
                txtRegistrationNumber.Text = tblCompanyDetails[0].datRegistrationNumber.ToString();
                txtRegistrationDate.Text   = tblCompanyDetails[0].datRegistrationDate.ToShortDateString();
                txtYearsInBusiness.Value   = tblCompanyDetails[0].datYearsInBusiness.ToString();
                txtwebsite.Value           = tblCompanyDetails[0].datWebsite.ToString();
                txtVATNo.Value             = tblCompanyDetails[0].datVATNumber.ToString();
                txtTIN.Value = tblCompanyDetails[0].datTIN.ToString();
                if (tblCompanyDetails[0].IsdatTelephoneNumber1Null() == false)
                {
                    txtTel1.Value = tblCompanyDetails[0].datTelephoneNumber1.ToString();
                }
                else if (tblClient.IsdatMobileNumber1Null() == false)
                {
                    txtTel1.Value = tblClient.datMobileNumber1.ToString();
                }
                if (tblCompanyDetails[0].IsdatTelephoneNumber2Null() == false)
                {
                    txtTel2.Value = tblCompanyDetails[0].datTelephoneNumber2.ToString();
                }
                else if (tblClient.IsdatMobileNumber2Null() == false)
                {
                    txtTel2.Value = tblClient.datMobileNumber2.ToString();
                }
                txtTel2.Value = tblCompanyDetails[0].datTelephoneNumber2.ToString();
                txtFax.Value  = tblCompanyDetails[0].datFaxNumber.ToString();
                if (tblCompanyDetails[0].IsdatIndustryTypeNull() == false)
                {
                    ddlIndustryType.SelectedValue = tblCompanyDetails[0].datIndustryType.ToString();
                }
                //if (tblCompanyDetails[0].IsdatSectorNull()==false) { if(ddlIndustryType.SelectedValue = tblCompanyDetails[0].datSector.ToString(); }
                if (tblCompanyDetails[0].IsdatPremissesStatusNull() == false)
                {
                    ddlPremisesStatus.SelectedValue = tblCompanyDetails[0].datPremissesStatus.ToString();
                }
                if (tblCompanyDetails[0].IsdatIsRegisteredNull() == false)
                {
                    ddlRegistered.SelectedValue = tblCompanyDetails[0].datIsRegistered.ToString();
                }
                this.type.Value     = "update";
                this.editskip.Value = "2";
            }
        }
        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;
        }
    }
Ejemplo n.º 4
0
    public void UpdateIndividualClient()
    {
        //Get Clients profile information
        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];

        string Fullname = tblClient.datFirstName.ToString() + " " + tblClient.datMiddleName.ToString() + " " + tblClient.datSurname.ToString();

        //Delete all initiators tied up the application
        LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
        initiator.DeleteInitiator(MySessionManager.AppID, MySessionManager.ClientID);

        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        loanApp.UpdateClientName(Fullname, MySessionManager.ClientID);
    }
    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 = tblClient[0].datDateOfBirth.ToString("dd-MM-yyyy"); }
            }
        }
        catch
        {

        }

    }
    public void loadCompanyDetails(int clientID)
    {
        try
        {
            mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];
            LoanDSTableAdapters.CoporateInformationTableAdapter companyDetails = new LoanDSTableAdapters.CoporateInformationTableAdapter();
            LoanDS.CoporateInformationDataTable tblCompanyDetails = companyDetails.GetCoporateInformation(MySessionManager.ClientID);

            if (tblCompanyDetails.Rows.Count > 0)
            {
                txtCompanyName.Value = tblCompanyDetails[0].datCompanyName.ToString();
                txtCommencementDate.Text = tblCompanyDetails[0].datCommencementDate.ToShortDateString();
                txtNatureofbusiness.Value = tblCompanyDetails[0].datNatureOfBusiness.ToString();
                txtPhysicalAddress.Value = tblCompanyDetails[0].datPhysicalAddress.ToString();
                txtRegistrationNumber.Text = tblCompanyDetails[0].datRegistrationNumber.ToString();
                txtRegistrationDate.Text = tblCompanyDetails[0].datRegistrationDate.ToShortDateString();
                txtYearsInBusiness.Value = tblCompanyDetails[0].datYearsInBusiness.ToString();
                txtwebsite.Value = tblCompanyDetails[0].datWebsite.ToString();
                txtVATNo.Value = tblCompanyDetails[0].datVATNumber.ToString();
                txtTIN.Value = tblCompanyDetails[0].datTIN.ToString();
                if (tblCompanyDetails[0].IsdatTelephoneNumber1Null() == false)
                { txtTel1.Value = tblCompanyDetails[0].datTelephoneNumber1.ToString(); }
                else if (tblClient.IsdatMobileNumber1Null() == false)
                { txtTel1.Value = tblClient.datMobileNumber1.ToString(); }
                if (tblCompanyDetails[0].IsdatTelephoneNumber2Null() == false)
                { txtTel2.Value = tblCompanyDetails[0].datTelephoneNumber2.ToString(); }
                else if (tblClient.IsdatMobileNumber2Null() == false)
                { txtTel2.Value = tblClient.datMobileNumber2.ToString(); }
                txtTel2.Value = tblCompanyDetails[0].datTelephoneNumber2.ToString();
                txtFax.Value = tblCompanyDetails[0].datFaxNumber.ToString();
                if (tblCompanyDetails[0].IsdatIndustryTypeNull() == false) { ddlIndustryType.SelectedValue = tblCompanyDetails[0].datIndustryType.ToString(); }
                //if (tblCompanyDetails[0].IsdatSectorNull()==false) { if(ddlIndustryType.SelectedValue = tblCompanyDetails[0].datSector.ToString(); }
                if (tblCompanyDetails[0].IsdatPremissesStatusNull() == false) { ddlPremisesStatus.SelectedValue = tblCompanyDetails[0].datPremissesStatus.ToString(); }
                if (tblCompanyDetails[0].IsdatIsRegisteredNull() == false) { ddlRegistered.SelectedValue = tblCompanyDetails[0].datIsRegistered.ToString(); }
                this.type.Value = "update";
                this.editskip.Value = "2";
            }


        }
        catch (Exception ex)
        { }

    }
Ejemplo n.º 7
0
    public void UpdateCompanyClientName(string ClientName)
    {
        //Copy the Initiator Details From the Clients  Table
        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];

        string Fullname = tblClient.datFirstName.ToString() + tblClient.datMiddleName.ToString() + tblClient.datSurname.ToString();

        LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
        initiator.InsertInitiator(MySessionManager.AppID,
                                  MySessionManager.ClientID,
                                  Fullname,
                                  null,
                                  tblClient.datMobileNumber1.ToString(),
                                  tblClient.datHomeTelephoneNumber.ToString(),
                                  tblClient.datEmailAddress.ToString(),
                                  tblClient.datFaxNumber.ToString(),
                                  tblClient.datCurrentResidentialAddress.ToString());


        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        loanApp.UpdateClientName(ClientName, MySessionManager.ClientID);
    }
    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) { }

            
            
        }

    }
Ejemplo n.º 9
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
        {
        }
    }
    public void UpdateIndividualClient()
    {
        //Get Clients profile information
        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];

        string Fullname = tblClient.datFirstName.ToString()+" "+tblClient.datMiddleName.ToString()+" "+ tblClient.datSurname.ToString();

        //Delete all initiators tied up the application
        LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
        initiator.DeleteInitiator(MySessionManager.AppID, MySessionManager.ClientID);
        
         LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        loanApp.UpdateClientName(Fullname, MySessionManager.ClientID); 
        
    
    }
    public void UpdateCompanyClientName(string ClientName)
    {

        //Copy the Initiator Details From the Clients  Table 
        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        mainDS.ClientRow tblClient = client.GetClientProfile(MySessionManager.ClientID)[0];

        string Fullname = tblClient.datFirstName.ToString()+ tblClient.datMiddleName.ToString()+ tblClient.datSurname.ToString();

        LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
        initiator.InsertInitiator (MySessionManager.AppID,
                                   MySessionManager.ClientID,
                                   Fullname,
                                   null,
                                   tblClient.datMobileNumber1.ToString(),
                                   tblClient.datHomeTelephoneNumber.ToString(),
                                   tblClient.datEmailAddress.ToString(),
                                   tblClient.datFaxNumber.ToString(),
                                   tblClient.datCurrentResidentialAddress.ToString());


        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        loanApp.UpdateClientName(ClientName, MySessionManager.ClientID); 
    }
    public void createAccount(decimal AmtOut1)
    {

       //LoanAccountDS. 

        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(AmtOut1) * (interestrate / 100));
        interestamt = IntAmt;
        decimal AmtOut = Convert.ToDecimal(AmtOut1);
        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))
        {

            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,
                                      Convert.ToInt32(tblLoanApp[0].datRefreshedID.ToString()),
                                      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;
        }

    }