protected void btn_Click(object sender, EventArgs e)
 {
     try
     {
         Level level = new Level();
         level.LevelDescription = txtLevelDes.Text;
         bll.Add(level);
         Response.Write("<script type='text/javascript'>alert('Details Inserted Successfully');</script>");
         Response.Redirect("LevelSearch.aspx");
     }
     catch (LevelException ex)
     {
         Response.Write("<script type='text/javascript'>alert('" + ex.Message + "');</script>");
     }
     catch (SystemException ex)
     {
         Response.Write("<script type='text/javascript'>alert('" + ex.Message + "');</script>");
     }
 }
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            try {
                Level l = new Level();
                l.LevelDescription = txtLevelDescription.Text;
                bll.Add(l);
                lsSearch.ItemsSource       = bll.GetAll();
                lsSearch.DisplayMemberPath = "LevelId";
                txtLevelId.Text            = bll.GetLevelId().ToString();
                ClearWindow();
                MessageBox.Show("Level Added Sucessfully");


                dgRecords.ItemsSource = bll.GetAll();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }