public ExportAssetDto GetExportAssetForEdit(int id)
        {
            ExportAsset exportAsset = repository.GetAll()
                                      .Where(item => !item.IsDelete)
                                      .SingleOrDefault(item => item.Id == id);

            return(ObjectMapper.Map <ExportAssetDto>(exportAsset));
        }
        public ExportAssetDto CreateExportAsset(ExportAssetDto input)
        {
            ExportAsset exportAsset = ObjectMapper.Map <ExportAsset>(input);

            SetAuditInsert(exportAsset);
            _ = repository.Insert(exportAsset);
            CurrentUnitOfWork.SaveChanges();
            return(input);
        }
Exemple #3
0
        static void MenuDoExportAsset()
        {
            ExportAsset instance = EditorToolbarLoader.GetInstance <ExportAsset>();

            if (instance != null)
            {
                UnityEditor.ProBuilder.EditorUtility.ShowNotification(instance.DoAction().notification);
            }
        }
        public ListResultDto <ExportAssetDto> GetExportAssetByCode(string code)
        {
            code = code.ToLower();
            ExportAsset exportAsset = repository.GetAll()
                                      .Where(item => item.AssetCode.ToLower() == code)
                                      .SingleOrDefault();

            System.Collections.Generic.List <ExportAssetDto> exportAssets = new System.Collections.Generic.List <ExportAssetDto>
            {
                ObjectMapper.Map <ExportAssetDto>(exportAsset)
            };
            return(new ListResultDto <ExportAssetDto>(exportAssets));
        }
        public void DeleteExportAsset(int id)
        {
            ExportAsset exportAsset = repository.GetAll()
                                      .Where(item => !item.IsDelete)
                                      .SingleOrDefault(item => item.Id == id);

            if (exportAsset != null)
            {
                exportAsset.IsDelete = true;
                repository.Update(exportAsset);
                CurrentUnitOfWork.SaveChanges();
            }
        }
        public ExportAssetDto UpdateExportAsset(ExportAssetDto input)
        {
            ExportAsset exportAsset = repository
                                      .GetAll()
                                      .Where(item => !item.IsDelete)
                                      .SingleOrDefault(item => item.Id == input.Id);

            if (exportAsset is null)
            {
                return(null);
            }
            else
            {
                ObjectMapper.Map(input, exportAsset);
                SetAuditEdit(exportAsset);
                exportAsset = repository.Update(exportAsset);
                CurrentUnitOfWork.SaveChanges();
                return(ObjectMapper.Map <ExportAssetDto>(exportAsset));
            }
        }
Exemple #7
0
        static bool MenuVerifyExportAsset()
        {
            ExportAsset instance = EditorToolbarLoader.GetInstance <ExportAsset>();

            return(instance != null && instance.enabled);
        }