protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             UserName = User.Identity.Name;
             if (Left(UserName, 4) == "HNBA")
             {
                 UserName        = Right(UserName, (UserName.Length) - 5);
                 Session["USER"] = UserName;
                 GetUser(UserName.ToString());
             }
             else if (Left(UserName, 5) == "HNBGI")
             {
                 UserName        = Right(UserName, (UserName.Length) - 6);
                 Session["USER"] = UserName;
                 GetUser(UserName.ToString());
             }
             CmbValue.Items.Clear();
             CmbValue.DataSource     = com.SelectType("VALUE_TYPE");
             CmbValue.DataValueField = "DESCRIPTION";
             CmbValue.DataTextField  = "DESCRIPTION";
             CmbValue.DataBind();
             CmbValue.Items.Insert(0, new RadComboBoxItem("--Select Type--", ""));
         }
     }
     catch (Exception ex)
     {
         lblError.Text    = ex.Message;
         lblError.Visible = true;
         return;
     }
 }
        protected void grdParaSearch_ItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Select")
                {
                    GridDataItem dataitem = e.Item as GridDataItem;

                    DataTable dt2 = com.SelectParamData("CASE2", dataitem["PARAMID"].Text, txtDesSearch.Text, "", "");
                    grdParaSearch.DataSource = dt2;
                    grdParaSearch.DataBind();

                    BtnInsert.Enabled = false;

                    txtParamID.Text = dt2.Rows[0]["PARAMID"].ToString();
                    txtDes.Text     = dt2.Rows[0]["PARAMDESCRIPTION"].ToString();

                    if (dt2.Rows[0]["VALUETYPE"].ToString() != "")
                    {
                        CmbValue.Items.Clear();
                        CmbValue.DataSource     = com.SelectType("VALUE_TYPE");
                        CmbValue.DataValueField = "DESCRIPTION";
                        CmbValue.DataTextField  = "DESCRIPTION";
                        CmbValue.DataBind();
                        CmbValue.Items.Insert(0, new RadComboBoxItem(dt2.Rows[0]["VALUETYPE"].ToString(), dt2.Rows[0]["VALUETYPE"].ToString()));
                    }

                    txtLength.Text = dt2.Rows[0]["PARAMLENGTH"].ToString();
                }
            }
            catch (Exception ex)
            {
                lblError.Text    = ex.Message;
                lblError.Visible = true;
                return;
            }
        }