示例#1
0
        public void SaveRecord()
        {
            var context = new IPSASDbContext();

            context.Attach(Record);
            context.Entry(Record).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
        }
示例#2
0
        public void SaveChanges()
        {
            foreach (var recordVM in _payrollRecords.Distinct())
            {
                context.Attach(recordVM.Record);
                context.Entry(recordVM.Record).State = EntityState.Modified;

                App.ServiceProvider.GetService <PayslipViewModel>().UpdatePayrollRecord(recordVM.Record);
            }

            context.SaveChanges();


            MessageBox.Show("Fiche de pointage enregistré");
        }