sdsd

by 3334 on July 22nd, 2010
No notes
Syntax: No syntax
Show lines - Hide lines - Show in textbox - Download
void XmlParserCLS::xmlEditBasicCalculationData(QString DocName, const  QString& MatCalcClass,const  QString& RouteString, QString Mode){
 
	bool skipEmpty=false;
	if(Mode=="ApplyAll") skipEmpty=true;
 
	//Get root element
	QDomNodeList QDNL=doc.elementsByTagName("TransDoc");
	QDomNode QDN=QDNL.item(0);
	QDomElement root=QDN.toElement();
 
	if(!QDNL.isEmpty()){ //If at least one root was found
 
		//Get all the CostLines
		QDNL=doc.elementsByTagName("Item");
		int NumOfItems=QDNL.count();
		QDomNode QDNCI;
		QString ThisDocName;
		for(int i=0; i<NumOfItems; i++){
 
			QDNCI=QDNL.item(i);
			ThisDocName=QDNCI.firstChildElement("OriginalName-ITM").toElement().text();
 
			if(ThisDocName==DocName){
 
				//CalcType
				if((skipEmpty&&(MatCalcClass!=""))||(!skipEmpty)){
					QDomNode QDNCMD=QDNCI.firstChildElement("CalcMetaData-ITM");
					QDomNode QDNMC=QDNCMD.firstChildElement("MatCalcType-ITM-CLC");
					setNode(QDNMC,MatCalcClass);
				}
 
				//Route
				if((skipEmpty&&(RouteString!=""))||(!skipEmpty)){
					QDomNode QDNCMD=QDNCI.firstChildElement("CalcMetaData-ITM");
					QDomNode QDNMC=QDNCMD.firstChildElement("Route-ITM-CLC");
					setNode(QDNMC,RouteString);
				}
 
				break;
			}
 
 
		}//for i
 
 
	}//if root node found
	else{
		QMessageBox::critical(parent,"OST Client","From xmlEditBasicCalculationData() No valid document found to get Item from!","");
	}
 
	//OF COURSE!! do not forget this.
	//EnqXml=doc.toString();
 
}//xmlEditBasicCalculationData(DocName, MatrialDlgValueList, EnqXml);
 

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS