public void loadNOK(int id)
    {
        InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter nok = new InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter();
        InvestmentDS.GetInvNextOfKinDataTable  tblnok = nok.GetInvNextOfKinDetails(id);

        if (tblnok.Rows.Count > 0)
        {
            try
            {
                this.editskip.Value = "2";
                txtfullname.Value = tblnok[0].datFullName.ToString();
                txtHomeTel.Value = tblnok[0].datHomeTelephoneNumber.ToString();
                txtOfficeTel.Value = tblnok[0].datOfficeTelephoneNumber.ToString();
                txtMobile.Value = tblnok[0].datMobileNumber.ToString();
                txtpercentageshare.Value = tblnok[0].datPercentageShare.ToString();
                txtEmail.Value = tblnok[0].datEmailAddress.ToString();
                txtAddress.Value = tblnok[0].datAddress.ToString();
              // txtRelationship.Value = tblnok[0].datRelationship.ToString();

            }
            catch (Exception ex)
            {


            }
        }

    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter nok = new InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter();
            if (!(type == "update"))
            {
                
                nok.InsertInvNextOfKin(txtfullname.Value,
                                       MySessionManager.ClientID,
                                       MySessionManager.InvAppID,
                                       txtMobile.Value,
                                       txtHomeTel.Value,
                                       txtOfficeTel.Value,
                                       txtEmail.Value,
                                       txtAddress.Value,
                                       Convert.ToDecimal(txtpercentageshare.Value),
                                       MySessionManager.CurrentUser.UserID);
             }
            else if (type == "update")
            {
               //nok.
            }

            Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "nedit"));
        
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter nok = new InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter();
        if (!(type == "update"))
        {
            nok.InsertInvNextOfKin(txtfullname.Value,
                                   MySessionManager.ClientID,
                                   MySessionManager.InvAppID,
                                   txtMobile.Value,
                                   txtHomeTel.Value,
                                   txtOfficeTel.Value,
                                   txtEmail.Value,
                                   txtAddress.Value,
                                   Convert.ToDecimal(txtpercentageshare.Value),
                                   MySessionManager.CurrentUser.UserID);
        }
        else if (type == "update")
        {
            //nok.
        }

        Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "nedit"));
    }
    public void loadNOK(int id)
    {
        InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter nok = new InvestmentDSTableAdapters.GetInvNextOfKinTableAdapter();
        InvestmentDS.GetInvNextOfKinDataTable tblnok = nok.GetInvNextOfKinDetails(id);

        if (tblnok.Rows.Count > 0)
        {
            try
            {
                this.editskip.Value      = "2";
                txtfullname.Value        = tblnok[0].datFullName.ToString();
                txtHomeTel.Value         = tblnok[0].datHomeTelephoneNumber.ToString();
                txtOfficeTel.Value       = tblnok[0].datOfficeTelephoneNumber.ToString();
                txtMobile.Value          = tblnok[0].datMobileNumber.ToString();
                txtpercentageshare.Value = tblnok[0].datPercentageShare.ToString();
                txtEmail.Value           = tblnok[0].datEmailAddress.ToString();
                txtAddress.Value         = tblnok[0].datAddress.ToString();
                // txtRelationship.Value = tblnok[0].datRelationship.ToString();
            }
            catch (Exception ex)
            {
            }
        }
    }