private bool Check_CMCode()
    {
        CM_ClientBLL _bll = new CM_ClientBLL();
        string       code = ((TextBox)pl_detail.FindControl("CM_Client_Code")).Text;

        if (ViewState["ClientID"] != null && code != "")
        {
            if (_bll._GetModelList(" Code = '" + code + "' and ID<>" + ViewState["ClientID"].ToString()).Count > 0)
            {
                return(false);
            }
        }
        else
        {
            if (_bll._GetModelList(" Code = '" + code + "'").Count > 0)
            {
                return(false);
            }
        }
        return(true);
    }
    private bool Check_CMCode()
    {
        CM_ClientBLL _bll = new CM_ClientBLL();
        string code = ((TextBox)pl_detail.FindControl("CM_Client_Code")).Text;
        if (ViewState["ClientID"] != null && code != "")
        {
            if (_bll._GetModelList(" Code = '" + code + "' and ID<>" + ViewState["ClientID"].ToString()).Count > 0)
                return false;

        }
        else
        {
            if (_bll._GetModelList(" Code = '" + code + "'").Count > 0)
                return false;
        }
        return true;
    }