protected void btnSave_Click(object sender, EventArgs e)
    {
        fullname = txtSurname.Value + ' ' + txtMiddlename.Value + ' ' + txtfirstname.Value;

        mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
        int?objID = null;

        client.InsertClient(GenerateClientNumber(),
                            3,
                            Convert.ToInt32(this.ddlTitle.SelectedValue),
                            txtfirstname.Value.Trim(),
                            txtMiddlename.Value.Trim(),
                            txtSurname.Value.Trim(),
                            fullname,
                            txttelephone.Value.Trim(),
                            txtMobileNo.Value.Trim(),
                            txtEmail.Value.Trim(),
                            txthomeAddress.Value.Trim(), ref objID);


        if (objID.Value > 0)
        {
            MySessionManager.ClientID = Convert.ToInt32(objID);
        }
        ShowMessageBox("New Enterprise has been created");
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
   
                fullname = txtSurname.Value + " " + txtMiddlename.Value + " " + txtfirstname.Value;
                
                mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
                int? objID = null;
                client.InsertClient(GenerateClientNumber(),
                                    1,
                                    Convert.ToInt32(this.ddlTitle.SelectedValue),
                                    txtfirstname.Value.Trim(),
                                    txtMiddlename.Value.Trim(),
                                    txtSurname.Value.Trim(),
                                    fullname,
                                    txttelephone.Value.Trim(),
                                    txtMobileNo.Value.Trim(),
                                    txtEmail.Value.Trim(),
                                    txthomeAddress.Value.Trim(), ref objID);
                                        

                if (objID.Value > 0)
                {
                    MySessionManager.ClientID = Convert.ToInt32(objID); 
                }
                ShowMessageBox("New Individual client has been created");    

          }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            fullname = txtcompanyname.Value;
            mainDSTableAdapters.ClientTableAdapter clients = new mainDSTableAdapters.ClientTableAdapter();
            int? objID = null;
            clients.InsertClient(GenerateClientNumber(),
                                  2,
                                  0,
                                  this.txtInFullname.Value.Trim(),
                                  "",
                                  "",
                                  this.fullname,
                                  txttelno.Value.Trim(),
                                  "",
                                  "",
                                  txtphysicalAddress.Value.Trim(),
                                  ref objID);



            if (objID.Value > 0)
            {
                // this.lblinfo.Text = "Client Profile Created Successfully...";
                MySessionManager.ClientID = Convert.ToInt32(objID);
                LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
                initiator.InsertInitiator(null,
                                          MySessionManager.ClientID,
                                          txtInFullname.Value,
                                          "",
                                          txtMobileno.Value.Trim(),
                                          null,
                                          txtEmail.Value.Trim(),
                                          null,
                                          null);


            }
            else
            {

            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            fullname = txtcompanyname.Value;
            mainDSTableAdapters.ClientTableAdapter clients = new mainDSTableAdapters.ClientTableAdapter();
            int?objID = null;
            clients.InsertClient(GenerateClientNumber(),
                                 2,
                                 0,
                                 this.txtInFullname.Value.Trim(),
                                 "",
                                 "",
                                 this.fullname,
                                 txttelno.Value.Trim(),
                                 "",
                                 "",
                                 txtphysicalAddress.Value.Trim(),
                                 ref objID);



            if (objID.Value > 0)
            {
                // this.lblinfo.Text = "Client Profile Created Successfully...";
                MySessionManager.ClientID = Convert.ToInt32(objID);
                LoanDSTableAdapters.IntiatorTableAdapter initiator = new LoanDSTableAdapters.IntiatorTableAdapter();
                initiator.InsertInitiator(null,
                                          MySessionManager.ClientID,
                                          txtInFullname.Value,
                                          "",
                                          txtMobileno.Value.Trim(),
                                          null,
                                          txtEmail.Value.Trim(),
                                          null,
                                          null);
            }
            else
            {
            }
        }
    }