C# Function How to Get Project GUID from Query String or Workspace Property

private string GetProjectId()
        {
            string sResult = string.Empty;
// get from query string          

sResult = Request.QueryString["ProjUid"];
            if (Request.QueryString["ProjUid"] == null)
            {

// now if GUId is not in query string, get from site property

                SPWeb currentWeb = SPContext.Current.Web;
                if ((currentWeb.WebTemplateId >= WSS.WssPWSTemplateNumericIdMinLimit) &&
                  (currentWeb.WebTemplateId <= WSS.WssPWSTemplateNumericIdMaxLimit))
                {
                    string webPropProjUid = currentWeb.AllProperties["MSPWAPROJUID"] as string;
                    if (!string.IsNullOrEmpty(webPropProjUid))
                    {
                        return (webPropProjUid);
                    }
                }
                return null;

            }

            return sResult;
        }