public PeriodicTimeInstant UpdateTimeInterval(PeriodicTimeInstant periodicTimeInstant) { Contract.Requires(periodicTimeInstant != null); using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <PeriodicTimeInstant> repo = uow.GetRepository <PeriodicTimeInstant>(); repo.Merge(periodicTimeInstant); var merged = repo.Get(periodicTimeInstant.Id); repo.Put(merged); uow.Commit(); } return(periodicTimeInstant); }
public bool DeletePeriodicTimeInstant(PeriodicTimeInstant periodicTimeInstant) { Contract.Requires(periodicTimeInstant != null); Contract.Requires(periodicTimeInstant.Id >= 0); using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <PeriodicTimeInstant> repo = uow.GetRepository <PeriodicTimeInstant>(); periodicTimeInstant = repo.Reload(periodicTimeInstant); repo.Delete(periodicTimeInstant); uow.Commit(); } return(true); }
public PeriodicTimeInterval CreatePeriodicTimeInterval(PeriodicTimeInstant periodicTimeInstant, TimeDuration duration) { PeriodicTimeInterval periodicTimeInterval = new PeriodicTimeInterval() { PeriodicTimeInstant = periodicTimeInstant, Duration = duration }; using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <PeriodicTimeInterval> repo = uow.GetRepository <PeriodicTimeInterval>(); repo.Put(periodicTimeInterval); uow.Commit(); } return(periodicTimeInterval); }
public PeriodicTimeIntervalModel() { PeriodicTimeInstant = new PeriodicTimeInstant(); Duration = new TimeDuration(); StartDate = null; EndDate = null; Days = new List <CheckModel>(); Days = TimeHelper.GetDays(); SelectedDays = new List <int>(); ResetFrequencies = new List <ResetFrequency>(); ResetFrequencies.Add(ResetFrequency.Daily); ResetFrequencies.Add(ResetFrequency.Weekly); ResetFrequencies.Add(ResetFrequency.Monthly); }
public PeriodicTimeInstant CreatePeriodicTimeInstantt(ResetFrequency resetFrequency, int resetInterval, int offset, SystemDefinedUnit offsetUnit) { PeriodicTimeInstant periodicTimeInstant = new PeriodicTimeInstant() { ResetFrequency = resetFrequency, ResetInterval = resetInterval, Off_Set = offset, Off_Set_Unit = offsetUnit }; using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository <PeriodicTimeInstant> repo = uow.GetRepository <PeriodicTimeInstant>(); repo.Put(periodicTimeInstant); uow.Commit(); } return(periodicTimeInstant); }