protected void btnAddmore_Click(object sender, EventArgs e)
 {
     Criminal_Education_InformationObject ceiObject = new Criminal_Education_InformationObject();
     CriminalInformationService cisObj = new CriminalInformationService();
     try
     {
         ceiObject.RefNo = txtRefNo.Text;
         ceiObject.EducationalStatus = txtEducationalStatus.Text;
         ceiObject.NameofInstitution = txtNameofInstitution.Text;
         ceiObject.PoliticalInvolvementinInstitution = txtPoliticalInvolvementinInstitution.Text;
         ceiObject.CreateBy = Membership.GetUser().UserName;
         ceiObject.CreateDate = DateTime.Now;
         ceiObject.LastUpdateBy = Membership.GetUser().UserName; ;
         ceiObject.LastUpdateDate = DateTime.Now;
         if (cisObj.InsertEducationInformation(ceiObject))
         {
             txtEducationalStatus.Text = "";
             txtNameofInstitution.Text = "";
             txtPoliticalInvolvementinInstitution.Text = "";
             SuccessMessage.Text = "One record Added.";
         }
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Criminal_Education_InformationObject ceiObject = new Criminal_Education_InformationObject();
     CriminalInformationService cisObj = new CriminalInformationService();
     try
     {
         ceiObject.RefNo = txtRefNo.Text;
         ceiObject.EducationalStatus = txtEducationalStatus.Text;
         ceiObject.NameofInstitution = txtNameofInstitution.Text;
         ceiObject.PoliticalInvolvementinInstitution = txtPoliticalInvolvementinInstitution.Text;
         ceiObject.CreateBy = Membership.GetUser().UserName;
         ceiObject.CreateDate = DateTime.Now;
         ceiObject.LastUpdateBy = Membership.GetUser().UserName; ;
         ceiObject.LastUpdateDate = DateTime.Now;
         if (cisObj.InsertEducationInformation(ceiObject))
         {
             Response.Redirect("criminal-death-information.aspx?refno=" + txtRefNo.Text);
         }
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
        /// <summary>
        /// Insert Criminal Education Information using this fuction
        /// </summary>
        /// <returns></returns>
        public bool InsertEducationInformation(Criminal_Education_InformationObject ceiObject)
        {
            clsBase baseObj = new clsBase();
            string sqlstring = "INSERT INTO [Criminal_Education_Information] ([RefNo],[EducationalStatus]" +
                               ",[NameofInstitution],[PoliticalInvolvementinInstitution],[CreateBy],[CreateDate]" +
                               ",[LastUpdateDate],[LastUpdateBy]) VALUES (@RefNo,@EducationalStatus,@NameofInstitution," +
                               "@PoliticalInvolvementinInstitution,@CreateBy,@CreateDate,@LastUpdateDate, @LastUpdateBy)";

            List<SqlParameter> parametersList = new List<SqlParameter>();
            parametersList.Add(new SqlParameter("@RefNo", ceiObject.RefNo));
            parametersList.Add(new SqlParameter("@EducationalStatus", ceiObject.EducationalStatus));
            parametersList.Add(new SqlParameter("@NameofInstitution", ceiObject.NameofInstitution));
            parametersList.Add(new SqlParameter("@PoliticalInvolvementinInstitution", ceiObject.PoliticalInvolvementinInstitution));
            parametersList.Add(new SqlParameter("@CreateBy", ceiObject.CreateBy));
            parametersList.Add(new SqlParameter("@CreateDate", ceiObject.CreateDate));
            parametersList.Add(new SqlParameter("@LastUpdateDate", ceiObject.LastUpdateDate));
            parametersList.Add(new SqlParameter("@LastUpdateBy", ceiObject.LastUpdateBy));

            return baseObj.InsertData(sqlstring, parametersList);
        }