protected void btnAddmore_Click(object sender, EventArgs e)
 {
     Criminal_Bank_Account_DetailsObject cbadObject = new Criminal_Bank_Account_DetailsObject();
     CriminalInformationService cisObj = new CriminalInformationService();
     try
     {
         cbadObject.RefNo = txtRefNo.Text;
         cbadObject.BankName = txtBankName.Text;
         cbadObject.AccountNo = txtAccountNo.Text;
         cbadObject.AccountType = txtAccountType.Text;
         cbadObject.CreditCardNo = txtCreditCardNo.Text;
         cbadObject.DebitCardNo = txtDebitCardNo.Text;
         cbadObject.CreateBy = Membership.GetUser().UserName;
         cbadObject.CreateDate = DateTime.Now;
         cbadObject.LastUpdateBy = Membership.GetUser().UserName;
         cbadObject.LastUpdateDate = DateTime.Now;
         if (cisObj.InsertTravelInformation(cbadObject))
         {
             txtRefNo.Text = txtRefNo.Text;
             txtBankName.Text = "";
             txtAccountNo.Text = "";
             txtAccountType.Text = "";
             txtCreditCardNo.Text = "";
             txtDebitCardNo.Text = "";
             SuccessMessage.Text = "One record Added.";
         }
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Criminal_Bank_Account_DetailsObject cbadObject = new Criminal_Bank_Account_DetailsObject();
     CriminalInformationService cisObj = new CriminalInformationService();
     try
     {
         cbadObject.RefNo = txtRefNo.Text;
         cbadObject.BankName = txtBankName.Text;
         cbadObject.AccountNo = txtAccountNo.Text;
         cbadObject.AccountType = txtAccountType.Text;
         cbadObject.CreditCardNo = txtCreditCardNo.Text;
         cbadObject.DebitCardNo = txtDebitCardNo.Text;
         cbadObject.CreateBy = Membership.GetUser().UserName;
         cbadObject.CreateDate = DateTime.Now;
         cbadObject.LastUpdateBy = Membership.GetUser().UserName;
         cbadObject.LastUpdateDate = DateTime.Now;
         if (cisObj.InsertTravelInformation(cbadObject))
         {
             Response.Redirect("crime-basic-information.aspx?refno=" + txtRefNo.Text);
         }
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
        /// <summary>
        /// Insert Criminal Travel Information using this fuction
        /// </summary>
        /// <returns></returns>
        public bool InsertTravelInformation(Criminal_Bank_Account_DetailsObject cbadObject)
        {
            clsBase baseObj = new clsBase();

            string sqlstring = "INSERT INTO [Criminal_Bank_Account_Information] ([RefNo],[BankName]" +
                               ",[AccountNo],[AccountType],[CreditCardNo],[DebitCardNo],[CreateBy],[CreateDate]" +
                               ",[LastUpdateBy],[LastUpdateDate]) VALUES (@RefNo,@BankName,@AccountNo,@AccountType," +
                               "@CreditCardNo,@DebitCardNo,@CreateBy,@CreateDate,@LastUpdateBy,@LastUpdateDate)";

            List<SqlParameter> parametersList = new List<SqlParameter>();
            parametersList.Add(new SqlParameter("@RefNo", cbadObject.RefNo));
            parametersList.Add(new SqlParameter("@BankName", cbadObject.BankName));
            parametersList.Add(new SqlParameter("@AccountNo", cbadObject.AccountNo));
            parametersList.Add(new SqlParameter("@AccountType", cbadObject.AccountType));
            parametersList.Add(new SqlParameter("@CreditCardNo", cbadObject.CreditCardNo));
            parametersList.Add(new SqlParameter("@DebitCardNo", cbadObject.DebitCardNo));
            parametersList.Add(new SqlParameter("@CreateBy", cbadObject.CreateBy));
            parametersList.Add(new SqlParameter("@CreateDate", cbadObject.CreateDate));
            parametersList.Add(new SqlParameter("@LastUpdateBy", cbadObject.LastUpdateBy));
            parametersList.Add(new SqlParameter("@LastUpdateDate", cbadObject.LastUpdateDate));

            return baseObj.InsertData(sqlstring, parametersList);
        }