예제 #1
0
        public static TimeBinding CreateTimeBinding(int id, int stepId, Step step, DateTime time, int day, int month, int year)
        {
            var set = DAL.SqlRepository.DBContext.GetDbSet<TimeBinding>();
            var tb = new TimeBinding();

            tb.Id = id;
            tb.StepId = stepId;
            tb.Step = step;
            tb.Time = time;
            tb.Day = day;
            tb.Month = month;
            tb.Year = year;

            set.Add(tb);
            DAL.SqlRepository.Save();
            return tb;
        }
예제 #2
0
 public static void DeleteTimeBinding(TimeBinding timeBinding)
 {
     var set = DAL.SqlRepository.TimeBindings;
     var tb = set.Find(timeBinding.Id);
     if (tb != null)
     {
         set.Remove(timeBinding);
         DAL.SqlRepository.DBContext.SaveChanges();
     }
 }
예제 #3
0
 protected bool Equals(TimeBinding other)
 {
     return Id == other.Id && StepId == other.StepId && Equals(Step, other.Step) && Time.Equals(other.Time) &&
            Day == other.Day && Month == other.Month && Year == other.Year;
 }
예제 #4
0
 public int CompareTo(TimeBinding toCompare)
 {
     DateTime first = new DateTime(Year,Month,Day,Time.Hour,Time.Minute,0);
     DateTime second = new DateTime(toCompare.Year, toCompare.Month, toCompare.Day, toCompare.Time.Hour, toCompare.Time.Minute, 0);
     return first.CompareTo(second);
 }