コード例 #1
0
        public Signal Save()
        {
            var db = new DataProcess();

            if (History == null)
            {
                throw new SignalException("Signal should be associated to history.");
            }
            else
            {
                if (this.Id == null)
                {
                    Id = db.saveSignal(this);
                }
                else
                {
                    db.updateSignal(this);
                }
                return(this);
            }
        }
コード例 #2
0
ファイル: Signal.cs プロジェクト: venj/Welding-Recorder
 public Signal Save()
 {
     var db = new DataProcess();
     if (History == null)
     {
         throw new SignalException("Signal should be associated to history.");
     }
     else
     {
         if (this.Id == null)
         {
             Id = db.saveSignal(this);
         }
         else
         {
             db.updateSignal(this);
         }
         return this;
     }
 }