protected void BtnEdit_Click(object sender, EventArgs e)
        {
            int lintCnt = 0;

            try
            {
                EntityTest entDept = new EntityTest();
                entDept.Precautions = txtDeptCode.Text;
                entDept.TestName    = txtDeptDesc.Text;
                entDept.TestId      = Convert.ToInt32(testid.Value);
                entDept.TestCharge  = Convert.ToDecimal(txtCharge.Text);
                entDept.IsRadiology = rdoRadiology.Checked ? true : false;
                entDept.IsPathology = rdoPathology.Checked ? true : false;
                entDept.TestCatId   = Convert.ToInt32(ddlTestCatagory.SelectedValue);
                EntityTest obj = (from tbl in mobjDeptBLL.GetAllTests()
                                  where tbl.TestId == Convert.ToInt32(testid.Value) &&
                                  tbl.TestName.ToUpper().Equals(txtDeptDesc.Text.ToUpper())
                                  select tbl).FirstOrDefault();

                if (obj != null)
                {
                    lintCnt = mobjDeptBLL.Update(entDept);
                    GetTests();
                    lblMessage.Text = "Record Updated Successfully";
                }
                else
                {
                    if (!mobjDeptBLL.IsRecordExists(entDept))
                    {
                        lintCnt = mobjDeptBLL.Update(entDept);

                        if (lintCnt > 0)
                        {
                            GetTests();
                            lblMessage.Text = "Record Updated Successfully";
                        }
                        else
                        {
                            lblMessage.Text = "Record Not Updated.";
                        }
                    }
                    else
                    {
                        lblMessage.Text = "Record Already Exist.";
                    }
                }
                MultiView1.SetActiveView(View1);
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message;
            }
        }