public void AddPageResponseDetail(PageResponseDetail pageResponseDetail) { var existingItem = PageResponseDetailList.SingleOrDefault(p => p.PageId == pageResponseDetail.PageId); if (existingItem != null) { PageResponseDetailList.Remove(existingItem); } FormId = FormId ?? pageResponseDetail.FormId; FormName = FormName ?? pageResponseDetail.FormName; pageResponseDetail.FormId = FormId; pageResponseDetail.FormName = FormName; pageResponseDetail.ResponseId = ResponseId; PageResponseDetailList.Add(pageResponseDetail); PageIds = PageResponseDetailList.Select(p => p.PageId).OrderBy(pid => pid).ToList(); }
public PageResponseDetail GetPageResponseDetailByPageNumber(int pageNumber) { var pageResponseDetail = PageResponseDetailList.SingleOrDefault(p => p.PageNumber == pageNumber); return(pageResponseDetail); }
public PageResponseDetail GetPageResponseDetailByPageId(int pageId) { var pageResponseDetail = PageResponseDetailList.SingleOrDefault(p => p.PageId == pageId); return(pageResponseDetail); }