/// <summary>
        ///     Edits the action.
        /// </summary>
        /// <param name="model">The model.</param>
        public void EditAction(T model)
        {
            if (model == null)
            {
                MessageBox.Show("请选择要编辑的记录", "失败", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            var w = AppEx.Container.GetInstance <IViewModel>(EditViewModeKey);

            w.Model = model;
            BeforeEdit(w, model);
            if (w.View.ShowDialog() == true)
            {
                IBaseDataService <T> service   = GetDataService();
                ResultMsg            resultMsg = service.Edit((T)w.Model);
                if (resultMsg.IsSuccess)
                {
                    _Collection.Clear();
                    if (SearchCommand.CanExecute(null))
                    {
                        SearchCommand.Execute(null);
                    }
                }
                else
                {
                    MessageBox.Show("修改失败", "失败", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Example #2
0
 public HomeViewModel(IMvxNavigationService navigationService, IUserDialogs userDialogs, IBaseDataService dataService)
 {
     _navigationService = navigationService;
     _userDialogs       = userDialogs;
     _dataService       = dataService;
     _recordDatas       = _dataService.Query();
 }
Example #3
0
 public BaseDataController(
     IBaseDataService baseDataService,
     IHostingEnvironment hostingEnvironment
     ) : base(hostingEnvironment)
 {
     this.baseDataService = baseDataService;
 }
        /// <summary>
        ///     Adds the action.
        /// </summary>
        public virtual void AddAction()
        {
            var w = AppEx.Container.GetInstance <IViewModel>(AddViewModeKey);

            if (!BeforeAdd((T)w.Model))
            {
                return;
            }
            if (w.View.ShowDialog() == true)
            {
                IBaseDataService <T> service   = GetDataService();
                ResultMsg            resultMsg = service.Add((T)w.Model);
                if (resultMsg.IsSuccess)
                {
                    _Collection.Clear();
                    if (SearchCommand.CanExecute(null))
                    {
                        SearchCommand.Execute(null);
                    }
                }
                else
                {
                    MessageBox.Show("添加失败", "失败", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Example #5
0
 public BaseController(
     ILogger <ILogActionFilter> logger,
     IBaseDataService <TEntity> ds
     )
 {
     _logger = logger;
     _ds     = ds;
 }
Example #6
0
 public HomeController(IApprovalService approvalService, IProjectService projectService, IBaseDataService baseDataService, IUnitOfWorkAsync unitOfWork, IAppSettingService appSettingService)
 {
     _projectService    = projectService;
     _appSettingService = appSettingService;
     _approvalService   = approvalService;
     _baseDataService   = baseDataService;
     _unitOfWork        = unitOfWork;
 }
 public FilesBLService(
     IBaseDataService <DataModels.File, DataModels.File, DataModels.File, DataModels.File, ApplicationDbContext> filesDataService,
     IGenericRepository <ApplicationDbContext, FileProvider> providerRepository,
     IServiceProvider serviceProvider,
     IMapper mapper)
 {
     this.filesDataService   = filesDataService;
     this.providerRepository = providerRepository;
     this.serviceProvider    = serviceProvider;
     this.mapper             = mapper;
 }
        /// <summary>
        ///     Searches the action.
        /// </summary>
        public virtual void SearchAction()
        {
            IBaseDataService <T> service = GetDataService();
            PageResult <T>       c       = service.Search(GetFilter());

            _Collection.Clear();
            foreach (T item in c.Result)
            {
                _Collection.Add(item);
            }
            Total = c.TotalCount;
        }
Example #9
0
 public ApprovalController(ICustomFieldService customFieldService, ICustomListDataService customListDataService, ICustomGroupService customGroupService, IBaseDataService baseDataService, ICustomDataService customDataService, ICustomListService customListService, ICustomFieldTypeService customFieldTypeService, IProjectService projectService, IApprovalService approvalService, IUnitOfWorkAsync unitOfWork)
 {
     _approvalService        = approvalService;
     _customDataService      = customDataService;
     _customFieldTypeService = customFieldTypeService;
     _baseDataService        = baseDataService;
     _customGroupService     = customGroupService;
     _customListDataService  = customListDataService;
     _customListService      = customListService;
     _customFieldService     = customFieldService;
     _unitOfWork             = unitOfWork;
 }
 public ProjectCustomDataController(IProjectCustomGroupService projectCustomGroupService, ICustomFieldService customFieldService, IBaseDataService baseDataService, ICustomGroupService customGroupService, ICustomFieldTypeService customFieldTypeService, ICustomListService customListService, ICustomListDataService customListDataService, IProjectCustomListDataService projectCustomListDataService, IUnitOfWorkAsync unitOfWork)
 {
     _projectCustomListDataService = projectCustomListDataService;
     _customListDataService        = customListDataService;
     _projectCustomGroupService    = projectCustomGroupService;
     _baseDataService        = baseDataService;
     _customFieldService     = customFieldService;
     _customListService      = customListService;
     _customGroupService     = customGroupService;
     _customFieldTypeService = customFieldTypeService;
     _unitOfWork             = unitOfWork;
 }
Example #11
0
 public HomeController(ISignatureService signatureService, IPhotographService photographService, IFingerprintImageService fingerprintImageService, ISyncJobHistoryService syncJobHistory, IApprovalService approvalService, IProjectService projectService, IBaseDataService baseDataService, IUnitOfWorkAsync unitOfWork, IAppSettingService appSettingService)
 {
     _projectService          = projectService;
     _appSettingService       = appSettingService;
     _syncJobHistory          = syncJobHistory;
     _approvalService         = approvalService;
     _baseDataService         = baseDataService;
     _signatureService        = signatureService;
     _photographService       = photographService;
     _fingerprintImageService = fingerprintImageService;
     _unitOfWork = unitOfWork;
 }
Example #12
0
 public WebsiteBLService(IUserBLService userBLService,
                         IBaseDataService <UrlCreateEditDSModel, UrlCreateEditDSModel, UrlOM, Url, ApplicationDbContext> urlDataService,
                         IBaseDataService <WebsiteEditCreateDSModel, WebsiteEditCreateDSModel, WebsiteEntity, WebsiteEntity, ApplicationDbContext> websiteDataService,
                         IBaseDataService <WebsiteEditCreateDSModel, WebsiteEditCreateDSModel, WebsiteListOM, WebsiteEntity, ApplicationDbContext> websiteListDataService,
                         IMapper mapper,
                         IFileBlService fileBlService)
 {
     this.userBLService          = userBLService;
     this.mapper                 = mapper;
     this.urlDataService         = urlDataService;
     this.websiteDataService     = websiteDataService;
     this.fileBlService          = fileBlService;
     this.websiteListDataService = websiteListDataService;
 }
Example #13
0
 public EnrollmentController(IFingerprintReasonService fingerprintReasonService, IPhotographService photographService, IProjectService projectService, IBaseDataService baseDataService, IUnitOfWorkAsync unitOfWork, IAppSettingService appSettingService, ISignatureService signatureService, IFingerprintImageService fingerprintImageService, IFingerprintTemplateService fingerprintTemplateService)
 {
     _projectService             = projectService;
     _photographService          = photographService;
     _projectService             = projectService;
     _fingerprintImageService    = fingerprintImageService;
     _fingerprintReasonService   = fingerprintReasonService;
     _fingerprintTemplateService = fingerprintTemplateService;
     _signatureService           = signatureService;
     _baseDataService            = baseDataService;
     _baseDataService            = baseDataService;
     _appSettingService          = appSettingService;
     _unitOfWork = unitOfWork;
 }
Example #14
0
        public void Setup()
        {
            var context = MoqDbContext.GetMockedContext();
            var repo    = new GenericRepository <ApplicationDbContext, FileBlob>(context.Object);
            var repoUrl = new GenericRepository <ApplicationDbContext, Url> (context.Object);
            var mapper  = new Mapper(new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new ServerMapperProfile());
            }));


            this.dataSerivce = new BaseDataService <FileBlob, FileBlob, FileBlob, FileBlob, ApplicationDbContext>(repo, mapper, context.Object);

            this.dataSerivceUrl = new BaseDataService <Url, Url, Url, Url, ApplicationDbContext>(repoUrl, mapper, context.Object);
        }
Example #15
0
        public void DeleteOrg()
        {
            MessageBoxResult msg = MessageBox.Show("确定要删除吗?", "删除", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msg == MessageBoxResult.Yes)
            {
                IBaseDataService <OPC_OrgInfo> service = GetDataService();
                ResultMsg r = service.Delete(OPC_OrgInfo);
                if (r.IsSuccess)
                {
                    Remove();
                }
                else
                {
                    MessageBox.Show("删除失败", "删除", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
        /// <summary>
        ///     Deletes the action.
        /// </summary>
        /// <param name="model">The model.</param>
        public void DeleteAction(T model)
        {
            MessageBoxResult msg = MessageBox.Show("确定要删除吗?", "删除", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msg == MessageBoxResult.Yes)
            {
                IBaseDataService <T> service = GetDataService();
                ResultMsg            r       = service.Delete(model);
                if (r.IsSuccess)
                {
                    _Collection.Remove(model);
                }
                else
                {
                    MessageBox.Show("删除失败", "删除", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Example #17
0
        public void UpdateOrg()
        {
            var w = AppEx.Container.GetInstance <IViewModel>("OrgViewModel") as OrgAddWindowViewMode;

            w.GetOrgRefreshStoreOrSection(OPC_OrgInfo.OrgType);
            w.Model = OPC_OrgInfo;
            if (w.View.ShowDialog() == true)
            {
                IBaseDataService <OPC_OrgInfo> service = GetDataService();
                ResultMsg resultMsg = service.Edit((OPC_OrgInfo)w.Model);
                if (resultMsg.IsSuccess)
                {
                    Update(w.Model as OPC_OrgInfo);
                }
                else
                {
                    MessageBox.Show("修改失败", "失败", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
        private void Search()
        {
            int indexFiled = FieldList.IndexOf(SelectedFiled);
            var dicFilter  = new Dictionary <string, object>
            {
                { "SearchField", indexFiled == -1 ? 1 : indexFiled },
                { "SearchValue", SelectedFiledValue },
                { "pageIndex", PageIndex },
                { "pageSize", PageSize },
                { "orgid", "" }
            };
            IBaseDataService <OPC_AuthUser> userDataService = GetDataService();
            PageResult <OPC_AuthUser>       prResultTemp    = userDataService.Search(dicFilter);

            if (prResultTemp == null || prResultTemp.Result == null)
            {
                return;
            }
            PrResult        = new PageDataResult <OPC_AuthUser>();
            PrResult.Models = prResultTemp.Result.ToList();
            PrResult.Total  = prResultTemp.TotalCount;
        }
Example #19
0
 public RootGraph(
     IBaseDataService <T> baseDataService
     )
 {
     this.baseDataService = baseDataService;
 }
Example #20
0
 public SqlBlobFileProvider(IBaseDataService <FileBlob, FileBlob, FileBlob, FileBlob, ApplicationDbContext> blobDataService,
                            IGenericRepository <ApplicationDbContext, FileBlob> blobRepo)
 {
     this.blobDataService = blobDataService;
     this.blobRepo        = blobRepo;
 }
Example #21
0
 public BaseDataController(ILog log, IBaseDataService baseDataService)
 {
     _log             = log;
     _baseDataService = baseDataService;
 }
Example #22
0
 public AppBaseData(IBaseDataService baseDataService, IAuthService authService, IAdfsEndpointRepository adfsEndpointRepository)
 {
     _baseDataService        = baseDataService;
     _authService            = authService;
     _adfsEndpointRepository = adfsEndpointRepository;
 }
 public BaseBusinessService(IBaseDataService <TE> repository)
 {
     Repository = repository;
 }
Example #24
0
 public BaseDataController()
 {
     service = new BaseDataService();
 }
Example #25
0
 public AppBaseData(IBaseDataService baseDataService)
 {
     _baseDataService = baseDataService;
 }