Exemplo n.º 1
0
        private void Window_Unloaded(object sender, RoutedEventArgs e)
        {
        //    wpfBroadcast.BroadcastEntities db = new BroadcastEntities();
            tblSysLog log = new tblSysLog() { Message = "系統登出", SITE_ID = 0, Type = "S", StartTimeStamp = DateTime.Now, UserID = (App.loginUser.UserID)  };

            db.tblSysLog.AddObject(log);
            db.SaveChanges();
        }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.accdMenu.SelectAll();

          db  = new BroadcastEntities();
          this.Title = db.tblApplication.FirstOrDefault().ApplicationName;
            tblSysLog log = new tblSysLog() { Message = "系統登入", SITE_ID = 0, Type = "S", StartTimeStamp = DateTime.Now ,UserID=App.loginUser.UserID};

            db.tblSysLog.AddObject(log);
            db.SaveChanges();
            wpfBroadcast.BroadcastEntities broadcastEntities = new wpfBroadcast.BroadcastEntities();
           
            // 將資料載入 tblSIte。您可以依需要修改這個程式碼。
            System.Windows.Data.CollectionViewSource tblSIteViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("tblSIteViewSource")));
            System.Data.Objects.ObjectSet<wpfBroadcast.tblSIte> tblSIteQuery = this.GettblSIteQuery(App.db);
            tblSIteViewSource.Source = tblSIteQuery.Execute(System.Data.Objects.MergeOption.AppendOnly);

        }
Exemplo n.º 3
0
 /// <summary>
 /// 將新物件加入 tblSysLog EntitySet 的方法已被取代。請考慮改為使用關聯的 ObjectSet&lt;T&gt; 屬性的 .Add 方法。
 /// </summary>
 public void AddTotblSysLog(tblSysLog tblSysLog)
 {
     base.AddObject("tblSysLog", tblSysLog);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 建立新 tblSysLog 物件。
 /// </summary>
 /// <param name="id">ID 屬性的初始值。</param>
 /// <param name="sITE_ID">SITE_ID 屬性的初始值。</param>
 /// <param name="startTimeStamp">StartTimeStamp 屬性的初始值。</param>
 /// <param name="type">Type 屬性的初始值。</param>
 /// <param name="message">Message 屬性的初始值。</param>
 public static tblSysLog CreatetblSysLog(global::System.Int32 id, global::System.Int32 sITE_ID, global::System.DateTime startTimeStamp, global::System.String type, global::System.String message)
 {
     tblSysLog tblSysLog = new tblSysLog();
     tblSysLog.ID = id;
     tblSysLog.SITE_ID = sITE_ID;
     tblSysLog.StartTimeStamp = startTimeStamp;
     tblSysLog.Type = type;
     tblSysLog.Message = message;
     return tblSysLog;
 }