public CollectSchedule GetCollectSchedule(Reserve reserve) { var r1 = (from a in Relations where a.ReserveCode == reserve.ReserveCode select a).FirstOrDefault(); if (r1 == null) { return(null); } var r2 = (from b in CollectSchedules where b.RelationCode == r1.RelationCode select b).FirstOrDefault(); return(r2); }
public static CollectState GetTypeForReserve(Reserve res) { var cs = DBAccessor.Instance.GetCollectSchedule(res); if (cs == null) { return(CollectStates.Undecided); } if (cs.CollectTime == null) { return(CollectStates.Appointment); } else { return(CollectStates.Done); } }
public CollectState(Reserve res) { this.type = GetTypeForReserve(res); }
public void SetResult(Reserve res) { Reserve = res; txtReserveCode.Text = Reserve.ReserveCode.ToString(); btnReserveClear.Enabled = Reserve != null; }