/// <summary> /// mapper utility to convert a business checklist to a checklist view model /// </summary> /// <param name="checkList"></param> /// <returns></returns> public static M3Pact.ViewModel.Admin.CheckListViewModel CheckListMap(this M3Pact.BusinessModel.BusinessModels.CheckList checkList) { M3Pact.ViewModel.Admin.CheckListViewModel checkListViewModel; if (checkList == default(M3Pact.BusinessModel.BusinessModels.CheckList)) { return(new M3Pact.ViewModel.Admin.CheckListViewModel()); } try { checkListViewModel = new M3Pact.ViewModel.Admin.CheckListViewModel { ChecklistId = checkList.CheckListId, ChecklistItems = checkList.Questions, ChecklistType = checkList.CheckListType, Name = checkList.CheckListName, Sites = checkList.Sites, Systems = checkList.Systems }; return(checkListViewModel); } catch (Exception ex) { throw ex; } }
public static CheckList CheckListMap(this M3Pact.ViewModel.Admin.CheckListViewModel checkListViewModel) { CheckList checkList; if (checkListViewModel == default(M3Pact.ViewModel.Admin.CheckListViewModel)) { return(new CheckList()); } try { checkList = new CheckList { CheckListId = checkListViewModel.ChecklistId, CheckListName = checkListViewModel.Name, CheckListType = checkListViewModel.ChecklistType, Questions = checkListViewModel.ChecklistItems, Sites = checkListViewModel.Sites, Systems = checkListViewModel.Systems }; return(checkList); } catch (Exception ex) { throw ex; } }