Ejemplo n.º 1
0
        public ReportLog(LogEntry logIn, LogEntry logOut = null)
        {
            LogIn = logIn ?? LogEntry.NewLogIn();
            LogOut = logOut ?? LogEntry.NewLogOut();

            DateLog = logIn.Time.Date;
        }
Ejemplo n.º 2
0
        public ReportLog(LogEntry logIn, LogEntry logOut)
        {
            LogIn = logIn;
            LogOut = logOut;

            DateLog = LogIn.Time.Date;
        }
Ejemplo n.º 3
0
        public static void Log(LogEntry[] logEntry)
        {
            using (BadgeDataContext db = new BadgeDataContext(BadgeDataContext.ConnectionString)) {
                foreach (var entry in logEntry) {
                    db.Entries.InsertOnSubmit(entry);
                }
                db.SubmitChanges();

            }
        }
Ejemplo n.º 4
0
        public static LogEntry LogNew()
        {
            var count = CountEntries();
            LogEntry entry = new LogEntry {
                // Id = count + 1,
                EntryTypeEnum = LogEntryDataService.GetLastType() == EntryType.In ? EntryType.Out : EntryType.In,
                Time = DateTime.Now,
            };

            Log(new LogEntry[] { entry });

            return entry;
        }
Ejemplo n.º 5
0
        private void LogEntryButton_Tap(object sender, GestureEventArgs e)
        {
            using (BadgeDataContext db = new BadgeDataContext(BadgeDataContext.ConnectionString))
            {
                LogEntry entries = new LogEntry
                {
                    Id = db.Entries.Count() + 1,
                    EntryTypeEnum = LogEntry.GetLastType() == EntryType.In ? EntryType.Out : EntryType.In,
                    Time = DateTime.Now,
                };

                db.Entries.InsertOnSubmit(entries);
                db.SubmitChanges();

                MessageBox.Show(string.Format("Azione {0} alle {1}", entries.EntryTypeEnum, entries.Time.ToString()), "Info", MessageBoxButton.OK);
            }
        }
Ejemplo n.º 6
0
 public void CheckOut(LogEntry logOut)
 {
     LogOut = logOut;
 }
Ejemplo n.º 7
0
 public void CheckIn(LogEntry logIn)
 {
     LogIn = logIn;
 }