private LockOutDate GetFields(LockOutDate d) { d.StartDate = dtpStart.Value; d.EndDate = dtpEnd.Value; d.Name = tbTitle.Text; d.Reason = tbDescription.Text; return d; }
private void AddEditLockedDate_Load(object sender, EventArgs e) { if(LockedDateID.HasValue) { var unitofwork = new UnitOfWork(); workinglockedDate = unitofwork.LockedOutDateRepository.Get(x => x.Id == LockedDateID.Value, includeProperties:"LockOutTimes").FirstOrDefault(); tbTitle.Text = workinglockedDate.Name; tbDescription.Text = workinglockedDate.Reason; dtpStart.Value = workinglockedDate.StartDate; dtpEnd.Value = workinglockedDate.EndDate; } }