예제 #1
0
        /// <summary>
        /// saving the data of the datarow,
        /// saves new entrys if the timestamp is not existingClassification, otherwise existingClassification data will be changed
        /// </summary>
        /// <param name="ChangedData">row with data to save</param>
        public void SaveEvent(DateTime EventDate, String System, String Station, String Cargo, String CargoAction, int CargoVolume, Int32 CreditsTransAction, Int32 Credits_Total, String EventType, String Notes, double? Distance=null)
        {
            try
            {
                dsEliteDB.vilogDataTable TempTable;
                dsEliteDB.vilogRow TempRow;

                TempTable = new dsEliteDB.vilogDataTable();
                TempRow = (dsEliteDB.vilogRow)TempTable.NewRow();

                TempRow.time                = EventDate;
                TempRow.systemname          = System;
                TempRow.stationname         = Station;
                TempRow.loccommodity        = Cargo;
                TempRow.action              = CargoAction;
                TempRow.cargovolume         = CargoVolume;
                TempRow.credits_transaction = CreditsTransAction;
                TempRow.credits_total       = Credits_Total;
                TempRow.eevent              = EventType;
                TempRow.notes               = Notes;

                if(Distance.HasValue)
                    TempRow.distance        = Distance.Value;

                SaveEvent(TempRow);
            }
            catch (Exception ex)
            {
                throw new Exception("Error while preparing save data (single params)", ex);
            }
        }
예제 #2
0
        /// <summary>
        /// saving the data of the datarow,
        /// saves new entrys if the timestamp is not existingClassification, otherwise existingClassification data will be changed
        /// </summary>
        /// <param name="ChangedData">row with data to save</param>
        public void SaveEvent(CommandersLogEvent Event)
        {
            try
            {
                dsEliteDB.vilogDataTable TempTable;
                dsEliteDB.vilogRow TempRow;

                TempTable = new dsEliteDB.vilogDataTable();
                TempRow = (dsEliteDB.vilogRow)TempTable.NewRow();

                TempRow.time                = Event.EventDate;
                TempRow.systemname          = Event.System;
                TempRow.stationname         = Event.Station;
                TempRow.loccommodity        = Event.Cargo;
                TempRow.action              = Event.CargoAction;
                TempRow.cargovolume         = (Int32)Event.CargoVolume;
                TempRow.credits_transaction = (Int32)Event.TransactionAmount;
                TempRow.credits_total       = (Int32)Event.Credits;
                TempRow.eevent              = Event.EventType;
                TempRow.notes               = Event.Notes;

                SaveEvent(TempRow);
            }
            catch (Exception ex)
            {
                throw new Exception("Error while preparing save data (Event class)", ex);
            }
        }