/// <summary>
 /// To save and Update the record of the contact person
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     InvestmentDSTableAdapters.GetInvContactPersonTableAdapter contactperson = new InvestmentDSTableAdapters.GetInvContactPersonTableAdapter();
     if (type != "update")
     {
         contactperson.InsertContactPerson(MySessionManager.ClientID,
                                           txtfullname.Text,
                                           txtMobileNumber.Text,
                                           txtTelephoneNumber.Text,
                                           txtEmailAddress.Text,
                                           txtHomeAddress.Value,
                                           txtfax.Text,
                                           MySessionManager.InvAppID);
     }
     else if (type == "update")
     {
         contactperson.UpdateContactPerson(txtfullname.Text,
                                           txtMobileNumber.Text,
                                           txtTelephoneNumber.Text,
                                           txtEmailAddress.Text,
                                           txtfax.Text,
                                           txtHomeAddress.Value,
                                           MySessionManager.CurrentUser.UserID,
                                           id);
     }
     Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "cpedit"));
 }
    /// <summary>
    /// To save and Update the record of the contact person
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {

        InvestmentDSTableAdapters.GetInvContactPersonTableAdapter contactperson = new InvestmentDSTableAdapters.GetInvContactPersonTableAdapter();
        if (type != "update")
        {      
            contactperson.InsertContactPerson(MySessionManager.ClientID,
                                              txtfullname.Text,
                                              txtMobileNumber.Text,
                                              txtTelephoneNumber.Text,
                                              txtEmailAddress.Text,
                                              txtHomeAddress.Value,
                                              txtfax.Text,
                                              MySessionManager.InvAppID);
        }
        else if(type=="update") 
        {
           contactperson.UpdateContactPerson(txtfullname.Text,
                                             txtMobileNumber.Text,
                                             txtTelephoneNumber.Text,
                                             txtEmailAddress.Text,
                                             txtfax.Text,
                                             txtHomeAddress.Value,
                                             MySessionManager.CurrentUser.UserID,
                                             id);
        }
        Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "cpedit"));
    }
 /// <summary>
 /// To load the record of the contact person to be edited
 /// </summary>
 /// <param name="?">The ID of the contact person</param>
 public void loadContactPerson(int id)
 {
     try
     {
         InvestmentDSTableAdapters.GetInvContactPersonTableAdapter cp = new InvestmentDSTableAdapters.GetInvContactPersonTableAdapter();
         InvestmentDS.GetInvContactPersonDataTable tblcp = cp.GetContactPersonDetails(id);
         if (tblcp.Rows.Count > 0)
         {
             txtfullname.Text        = tblcp[0].datFullname.ToString();
             txtMobileNumber.Text    = tblcp[0].datMobileNumber.ToString();
             txtfax.Text             = tblcp[0].datFaxNumber.ToString();
             txtEmailAddress.Text    = tblcp[0].datMobileNumber.ToString();
             txtHomeAddress.Value    = tblcp[0].datEmailAddress.ToString();
             txtTelephoneNumber.Text = tblcp[0].datTelephoneNumber.ToString();
             this.editskip.Value     = "2";
         }
     }
     catch (Exception ex) {}
 }
    /// <summary>
    /// To load the record of the contact person to be edited
    /// </summary>
    /// <param name="?">The ID of the contact person</param>
    public void loadContactPerson(int id)
    {
        try
        {
            InvestmentDSTableAdapters.GetInvContactPersonTableAdapter cp = new InvestmentDSTableAdapters.GetInvContactPersonTableAdapter();
            InvestmentDS.GetInvContactPersonDataTable tblcp = cp.GetContactPersonDetails(id);
            if (tblcp.Rows.Count > 0)
            {
                txtfullname.Text = tblcp[0].datFullname.ToString();
                txtMobileNumber.Text = tblcp[0].datMobileNumber.ToString();
                txtfax.Text = tblcp[0].datFaxNumber.ToString();
                txtEmailAddress.Text = tblcp[0].datMobileNumber.ToString();
                txtHomeAddress.Value = tblcp[0].datEmailAddress.ToString();
                txtTelephoneNumber.Text = tblcp[0].datTelephoneNumber.ToString();
                this.editskip.Value = "2";
            }

        
        
        }
        catch(Exception ex){}
    }