private IList <BindingListItem> GetBindingList(string subjectType, IUnitOfWork unitOfWork) { IList <BindingListItem> dataSource = null; switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), subjectType)) { case InstanceTypes.Language: LanguageFacade languageFacade = new LanguageFacade(unitOfWork); dataSource = languageFacade.GetBindingList(); break; case InstanceTypes.Location: LocationFacade locationFacade = new LocationFacade(unitOfWork); dataSource = locationFacade.GetBindingList(); break; case InstanceTypes.Folder: FolderFacade folderFacade = new FolderFacade(unitOfWork); dataSource = folderFacade.GetBindingList(); break; case InstanceTypes.Reference: ReferenceFacade referenceFacade = new ReferenceFacade(unitOfWork); dataSource = referenceFacade.GetBindingList(); break; } return(dataSource); }
public bool SetPublish(object refId, bool status) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); return(facade.SetPublish(refId, status)); } }
public bool DeleteGridRow(int rowId) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); } return(true); }
public IFacadeUpdateResult <GridRowData> SaveGridRow(GridRowDto row) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <GridRowData> result = facade.SaveGridRow(GridRowConverter.ConvertToData(row)); return(result); } }
public IFacadeUpdateResult <ReferenceData> SaveReferenceCategorys(ReferenceInfoDto reference) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceCategorys(reference.ReferenceId, ReferenceCategoryInfoConverter.ConvertToData(reference.ReferenceCategorys)); return(result); } }
public IFacadeUpdateResult <ReferenceData> SaveReferenceValues(Dictionary <object, DucValueDto> values, object languageId) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceValueLanguages(SubitemValueInfoConverter.ConvertToData(values), languageId); return(result); } }
public IFacadeUpdateResult <ReferenceData> SaveReferenceBasic(ReferenceInfoDto reference, object languageId) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceLanguageBasic(ReferenceInfoConverter.ConvertToData(reference), languageId); return(result); } }
public void TestAll() { ReferenceFacade facade = new ReferenceFacade(UnitOfWork); List <ReferenceDto> result = facade.RetrieveAllReference <ReferenceDto>(new ReferenceConverter()); if (result != null) { } }
public IFacadeUpdateResult <ReferenceData> SaveReference(ReferenceDto reference) { ReferenceData data = ReferenceConverter.ConvertToData(reference); using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <ReferenceData> result = facade.SaveReference(data); return(result); } }
public void SaveReferenceInWhole() { ReferenceData reference = GetReference(); // Save Reference ReferenceFacade facade = new ReferenceFacade(UnitOfWork); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceInWhole(reference); if (result.IsSuccessful) { } }
public IFacadeUpdateResult <ReferenceData> SaveReferenceCategorysInBatch(IList <ReferenceInfoDto> references) { // Convert to data List <ReferenceData> instances = new List <ReferenceData>(); foreach (ReferenceInfoDto item in references) { ReferenceData instance = new ReferenceData(); instances.Add(instance); instance.Id = item.ReferenceId; instance.ReferenceCategorys = ReferenceCategoryInfoConverter.ConvertToData(item.ReferenceCategorys); } using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { ReferenceFacade facade = new ReferenceFacade(uow); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceCategorysInBatch(instances); return(result); } }
public void SaveReferenceLanguageBasic() { ReferenceInfoFacade facade1 = new ReferenceInfoFacade(UnitOfWork); ReferenceInfoDto item = facade1.GetReferenceInfo <ReferenceInfoDto>(4, new ReferenceInfoConverter()); ReferenceData data = new ReferenceData(); data.Id = 5; data.Title = item.Title; data.Description = "chinese of UofT"; data.Keywords = "university, UofT"; ReferenceFacade facade = new ReferenceFacade(UnitOfWork); IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceLanguageBasic(data, 2); if (result.IsSuccessful) { } }
public void SaveReferenceKeywords() { int referenceId = 4; ReferenceFacade facade = new ReferenceFacade(UnitOfWork); IList <ReferenceKeywordData> referenceKeywords = new List <ReferenceKeywordData>(); ReferenceKeywordData item1 = new ReferenceKeywordData(); referenceKeywords.Add(item1); item1.KeywordId = 1; item1.Sort = 1; ReferenceKeywordData item2 = new ReferenceKeywordData(); referenceKeywords.Add(item2); item2.KeywordId = 2; item2.Sort = 2; IFacadeUpdateResult <ReferenceData> result = facade.SaveReferenceKeywords(referenceId, referenceKeywords); if (result.IsSuccessful) { } }