private String deriveDefinitionText() { CTable t = GetDbObject(); ArrayList fields = t.GetTableFields(); String definition = ""; int i = 0; foreach (CField field in fields) { String fname = field.getName(); if (!isAccumField(fname)) { continue; } String value = t.GetFieldValue(fname); String tmp = String.Format("{0}:{1}", fname, value); if (i == 0) { definition = tmp; } else { definition = String.Format("{0}|{1}", definition, tmp); } i++; } return(definition); }
public static void UpdateExtendedParam(MMasterRef mr, CTable prm) { CTable o = (CTable)extends[mr.Code]; if (o == null) { return; } foreach (CField f in o.GetTableFields()) { String nm = f.getName(); String v = f.getValue(); prm.SetFieldValue(nm, v); } }
public void SumItem(MVPayrollDocumentItem accum, MVPayrollDocumentItem tx) { CTable a = accum.GetDbObject(); CTable t = tx.GetDbObject(); ArrayList fields = t.GetTableFields(); foreach (CField field in fields) { String fname = field.getName(); if (!isAccumField(fname)) { continue; } double txValue = CUtil.StringToDouble(t.GetFieldValue(fname)); double acValue = CUtil.StringToDouble(a.GetFieldValue(fname)); double sum = txValue + acValue; SetFieldValue(fname, sum.ToString()); } }
private XmlElement createElementFromTable(XmlDocument doc, CTable tb) { ArrayList flds = tb.GetTableFields(); XmlElement xmlObj = doc.CreateElement("OBJECT"); xmlObj.SetAttribute("name", tb.GetTableName()); foreach (CField f in flds) { XmlElement fld = doc.CreateElement("FIELD"); fld.SetAttribute("name", f.GetName()); String value = f.GetValue(); fld.InnerText = value; xmlObj.AppendChild(fld); } Hashtable hashOfArray = tb.GetChildHash(); foreach (String arrName in hashOfArray.Keys) { ArrayList arr = (ArrayList)hashOfArray[arrName]; XmlElement itm = doc.CreateElement("ITEMS"); itm.SetAttribute("name", arrName); xmlObj.AppendChild(itm); foreach (CTable t in arr) { //Recursive XmlElement o = createElementFromTable(doc, t); itm.AppendChild(o); } } return(xmlObj); }