本文整理汇总了C#中PccMsg.QueryNodes方法的典型用法代码示例。如果您正苦于以下问题:C# PccMsg.QueryNodes方法的具体用法?C# PccMsg.QueryNodes怎么用?C# PccMsg.QueryNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PccMsg
的用法示例。
在下文中一共展示了PccMsg.QueryNodes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenMultiLinkXML
private string GenMultiLinkXML(DataRow myDRow, string strXML)
{
PccMsg myMsg = new PccMsg(strXML);
PccMsg myTempMsg = new PccMsg();
foreach (XmlNode myNode in myMsg.QueryNodes("LinkButton"))
{
myTempMsg.CreateNode("LinkButton");
myTempMsg.AddToNode("Image", myMsg.Query("Image", myNode));
myTempMsg.AddToNode("ToolTip", myMsg.Query("ToolTip", myNode));
myTempMsg.AddToNode("href", myMsg.Query("href", myNode));
myTempMsg.AddToNode("QueryCondition", myMsg.Query("QueryCondition", myNode));
myTempMsg.AddToNode("Method", GetMethod(myMsg.Query("Method/MethodName", myNode), myMsg.Query("Method/Key", myNode), myMsg.Query("Method/KeyOther", myNode), myDRow));
myTempMsg.UpdateNode();
}
return myTempMsg.GetXmlStr;
}
示例2: CreateSecurityTable
private DataTable CreateSecurityTable(string LoginXML)
{
DataTable returnDt = CenSecTable();
PccMsg myMsg = new PccMsg(LoginXML);
string ap_id = "";
DataRow drow = null;
if (myMsg.QueryNodes("Authorize") == null) return returnDt;
foreach (XmlNode myNode in myMsg.QueryNodes("Authorize"))
{
ap_id = myMsg.Query("APID", myNode);
if (myMsg.QueryNodes("ApMenu", myNode) == null) continue;
foreach (XmlNode myDNode in myMsg.QueryNodes("ApMenu", myNode))
{
drow = returnDt.NewRow();
drow["ap_id"] = decimal.Parse(ap_id);
drow["aspxfile"] = SplitAspxFile(myMsg.Query("MenuLink", myDNode));
drow["check_mk"] = myMsg.Query("check_mk", myDNode);
drow["show_mk"] = myMsg.Query("show_mk", myDNode);
drow["add_mk"] = myMsg.Query("add_mk", myDNode);
drow["upd_mk"] = myMsg.Query("upd_mk", myDNode);
drow["del_mk"] = myMsg.Query("del_mk", myDNode);
drow["rpt_mk"] = myMsg.Query("rpt_mk", myDNode);
drow["send_mk"] = myMsg.Query("send_mk", myDNode);
returnDt.Rows.Add(drow);
}
}
return returnDt;
}
示例3: IsApAuth
public bool IsApAuth()
{
if (m_ApID == "")
{
m_Error = "ApID is space!";
return false;
}
if (m_LoginInfoXml == "")
{
m_Error = "LoginInfoXml is space!";
return false;
}
if (m_Url == "")
{
m_Error = "URL is space!";
return false;
}
PccMsg myMsg = new PccMsg();
try
{
myMsg.LoadXml(m_LoginInfoXml);
}
catch
{
m_Error = "Load LoginInfo XML Error!";
return false;
}
string AspxFileName = GetAspxFile();
bool bOK = false;
if (myMsg.QueryNodes("Authorize") != null)
{
foreach (XmlNode myNode in myMsg.QueryNodes("Authorize"))
{
if (myMsg.Query("APID", myNode) == m_ApID)
{
bOK = true;
}//end if APID
if (bOK) break; //if find the Action then exit for loop.
}//end foreach myNode
}
return bOK;
}
示例4: SetMenu
private void SetMenu()
{
string strLeftMenu = string.Empty;
int AreaCount = 1;
//LoginInfoUser of AP Detail Menu.
PccCommonForC.PccErrMsg myLabel = new PccCommonForC.PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
string strDetailPageLayer = Session["PageLayer"].ToString();
if (Request.QueryString["ApID"] != null)
{
//APID
string strApID = Request.Params["ApID"];
string ApFolder = "", MenuItem = "", MenuName = "";
PccCommonForC.PccMsg myMsg = new PccCommonForC.PccMsg();
myMsg.LoadXml(Session["XmlLoginInfo"].ToString());
if (strApID.Length > 0 && strDetailPageLayer.Length > 0)
{
//strDetailPageLayer = strDetailPageLayer.Substring(0,strDetailPageLayer.Length - 3);
if (myMsg.QueryNodes("Authorize") != null)
{
foreach (XmlNode myNode in myMsg.QueryNodes("Authorize"))
{
if (strApID != myMsg.Query("APID", myNode)) continue;
//Folder
ApFolder = GetApFolder(myMsg.Query("APLink", myNode));
if (myMsg.QueryNodes("ApMenu", (XmlElement)myNode) != null)
{
foreach (XmlNode myDetailNode in myMsg.QueryNodes("ApMenu", (XmlElement)myNode))
{
if (myMsg.Query("show_mk", myDetailNode).Equals("Y"))
{
if (myMsg.Query("MenuLink", myDetailNode).IndexOf(".asmx", 0) > 0)
continue;
if (Session["CodePage"].ToString() == "CP950")
{
SaveDataToHashMenu(myMsg.Query("MenuManage", (XmlElement)myDetailNode), strDetailPageLayer, ApFolder, myMsg.Query("MenuNM", (XmlElement)myDetailNode), myMsg.Query("MenuLink", (XmlElement)myDetailNode));
}
else
{
MenuItem = "M" + strApID + int.Parse(myMsg.Query("MENUID", myDetailNode)).ToString();
MenuName = myLabel.GetErrMsg(MenuItem, "MenuItem");
SaveDataToHashMenu(myMsg.Query("MenuManage", (XmlElement)myDetailNode), strDetailPageLayer, ApFolder, MenuName, myMsg.Query("MenuLink", (XmlElement)myDetailNode));
}
// SaveDataToHashMenu(myMsg.Query("MenuManage", (XmlElement)myDetailNode), strDetailPageLayer, ApFolder, myMsg.Query("MenuNM", (XmlElement)myDetailNode), myMsg.Query("MenuLink", (XmlElement)myDetailNode));
}
}
}
}
}
}
strLeftMenu = "<div class='glossymenu'>";
string strLang = "";
ArrayList arrMenu = new ArrayList();
if (Session["CodePage"].ToString() != "CP950")
{
strLang = "_VN";
}
myMsg = new PccMsg();
myMsg.Load(Server.MapPath(Session["PageLayer"] + @"XmlDoc\ApMenu" + strLang + ".xml"));
if (myMsg.QueryNodes("Applications/Application") != null)
{
foreach (XmlNode apNode in myMsg.QueryNodes("Applications/Application"))
{
if (myMsg.Query("ApID", apNode) == Request.QueryString["ApID"])
{
if (myMsg.QueryNodes("ApAreas/Area", apNode) != null)
{
foreach (XmlNode areaNode in myMsg.QueryNodes("ApAreas/Area", apNode))
{
string AreaMK = myMsg.Query("AreaMK", areaNode);
string AreaName = myMsg.Query("AreaName", areaNode);
if (m_Menu.ContainsKey(AreaMK))//xet quyen han thay menu
{
strLeftMenu += "<a class='menuitem submenuheader' style='cursor:pointer'><span class='area_item'><img src='" + ResolveUrl("~/") + "Pub/EasyLayout/ImgBody/group_item.png" + "' border='0'>" + AreaName.ToUpper() + "</span></a>";
strLeftMenu += "<div class='submenu'>";
strLeftMenu += "<ul>";
//add child menu
strLeftMenu += m_Menu[AreaMK].ToString();
strLeftMenu += "</ul>";
strLeftMenu += "</div>"; //end class=menu_body
}
}
}
break;
}
}
//.........这里部分代码省略.........
示例5: GetAuthByTable
public string GetAuthByTable(string strAction)
{
if (m_ApID == "")
{
m_Error = "ApID is space!";
return m_Error;
}
string strReturn = "";
string AspxFileName = GetAspxFile();
if (m_bCheckTable)
{
try
{
strReturn = m_DataTable.Select("ap_id = '" + m_ApID + "' and AspxFile = '" + AspxFileName + "'")[0][strAction].ToString();
}
catch
{
}
}
else
{
if (m_LoginInfoXml == "")
{
m_Error = "LoginInfoXml is space!";
return m_Error;
}
if (m_Url == "")
{
m_Error = "URL is space!";
return m_Error;
}
PccMsg myMsg = new PccMsg();
try
{
myMsg.LoadXml(m_LoginInfoXml);
}
catch
{
m_Error = "Load LoginInfo XML Error!";
return m_Error;
}
bool bOK = false;
if (myMsg.QueryNodes("Authorize") != null)
{
foreach (XmlNode myNode in myMsg.QueryNodes("Authorize"))
{
if (myMsg.Query("APID", myNode) == m_ApID)
{
if (myMsg.QueryNodes("ApMenu", myNode) != null)
{
foreach (XmlNode myDetailNode in myMsg.QueryNodes("ApMenu", myNode))
{
if (CheckAspxFile(myMsg.Query("MenuLink", myDetailNode), AspxFileName))
{
strReturn = myMsg.Query(strAction, myDetailNode);
bOK = true;
break;
}
} //end foreach myDeailNode
}// end if Menu Nodes.
}//end if APID
if (bOK) break; //if find the Action then exit for loop.
}//end foreach myNode
}
}
return strReturn;
}