public void InitInfoDataSet() { this._oDsInfoDataSet = new DataSetAdvanced("Info"); this._oDsInfoDataSet.AddColumn("Bezeichnung"); this._oDsInfoDataSet.AddColumn("Ident"); this._oDsInfoDataSet.AddColumn("Tag", typeof(object)); }
public static void SQLExport(DataSetAdvanced oDs, string sFile, bool bCurrentRecord) //R090316 { if (oDs != null) { string sColumns = ""; foreach (DataColumn oCol in oDs.Tables[0].Columns) { sColumns += oCol.Caption + ","; } char[] charsToTrim = { ',' }; sColumns = sColumns.TrimEnd(charsToTrim); string sSql = ""; Business oB = new Business(); oB.tabelle = oDs.Tables[0].TableName.Replace("dba", ""); oB.spalten = sColumns; oB.tabelle = oB.tabelle.Replace(".", ""); if (oB.tabelle.EndsWith("V")) { oB.tabelle = oB.tabelle.Substring(0, oB.tabelle.Length - 1); } if (System.IO.File.Exists(sFile)) { System.IO.File.Delete(sFile); } Services.WriteLog(sFile, "-- " + oB.tabelle); if (bCurrentRecord) { oB.Where = Services.WhereNummer(oDs.GetInt("NUMMER")); } oB.Read(); if (bCurrentRecord) { oB.PutRecord(oB.DataSet); sSql = oB.BuildSaveStmt(SqlAction.Insert); Services.WriteLog(sFile, sSql + ";"); } else { oB.DataSet.GoTop(); while (!oB.DataSet.EoF) { oB.Clear(); oB.PutRecord(oB.DataSet); sSql = oB.BuildSaveStmt(SqlAction.Insert); Services.WriteLog(sFile, sSql + ";"); oB.DataSet.Skip(); } } } }
public virtual DataSetAdvanced Addition() { if (this._oDsAddition == null) { this._oDsAddition = new DataSetAdvanced("Addition"); this._oDsAddition.AddColumn("Bezeichnung"); this._oDsAddition.AddColumn("Wert", Type.GetType("System.Decimal")); } int iAnzahl = 0; int iRecno = this.DataSet.RecordNumber; this.DataSet.GoTop(); while (!this.DataSet.EoF) { iAnzahl += 1; this.DataSet.Skip(); } this.DataSet.GoTo(iRecno); this._oDsAddition.Append(); this._oDsAddition.Put("Bezeichnung", "Anzahl"); this._oDsAddition.Put("Wert", Services.ToDecimal(iAnzahl)); return(this._oDsAddition); }