/// <summary>
        ///     Populates All Lookup Fields In The Set Of IRecords With The Name Of The Referenced Record
        ///     Used If The IRecordService Has Not Loaded The Name Of Referenced Records
        /// </summary>
        /// <param name="records">Records To Load The Names Into Lookup Fields</param>
        /// <param name="service">Service To Retrieve The Record Names</param>
        /// <param name="ignoreType">Types To Not Load The Name</param>
        public static void PopulateEmptyLookups(this IEnumerable <IRecord> records, IRecordService service,
                                                IEnumerable <string> ignoreType)
        {
            var emptyLookupNames = new Dictionary <string, List <Lookup> >();

            foreach (var record in records)
            {
                foreach (var field in record.GetFieldsInEntity())
                {
                    if (!field.IsNullOrWhiteSpace())
                    {
                        var value = record.GetField(field);
                        if (value is Lookup && ((Lookup)value).Name == null)
                        {
                            if (!emptyLookupNames.ContainsKey(field))
                            {
                                emptyLookupNames.Add(field, new List <Lookup>());
                            }
                            emptyLookupNames[field].Add((Lookup)value);
                        }
                    }
                }
            }
            PopulateLookups(service, emptyLookupNames, ignoreType);
        }
Ejemplo n.º 2
0
        private static void FindReadersByTicket(IReaderService rs, IRecordService recsc)
        {
            Console.Clear();
            Console.WriteLine("You have chosen finding readers by ticket");
            Console.Write("Input ticket number: ");
            var ticketIn = Console.ReadLine();

            if (int.TryParse(ticketIn, out int num))
            {
                var readers = rs.FindReaderByTicket(num);

                if (readers == null || readers.Count() == 0)
                {
                    Console.WriteLine("nothing was found");
                }
                else if (readers.Count() > 1)
                {
                    Console.WriteLine("It seems that there is more than one reader with such ticket number");
                }
                else
                {
                    var res = readers.FirstOrDefault();

                    Console.WriteLine("\nResult\n");
                    Console.WriteLine($"{"Full name",-25} | {"Ticket number",-12} | {"Phone number",-20}");
                    Console.WriteLine($"{res.Fullname,-25} | {res.TicketNumber,-12} | {res.Phone,-20}");

                    Console.WriteLine("To see activity choose:\n" +
                                      "r - to see returned books\n" +
                                      "b - to see currently borrowed books\n" +
                                      "any key to return to menu");

                    var inp = Console.ReadLine();

                    switch (inp.Trim())
                    {
                    case "r":
                    case "R":
                        GetReturnedBooks(rs, recsc, res);
                        break;

                    case "b":
                    case "B":
                        GetBorrowedBooks(rs, recsc, res);
                        break;

                    default:
                        return;
                    }
                }
            }
            else
            {
                Console.WriteLine("Bad input");
            }

            Console.Write("Press any key to return to menu");
            Console.ReadLine();
        }
 public PickTheDate(IRecordService recordService,
                    IGroupService groupService,
                    UserManager <ApplicationUser> userManager)
 {
     _recordService = recordService;
     _groupService  = groupService;
     _userManager   = userManager;
 }
Ejemplo n.º 4
0
 public CrudDialog(IDialogController dialogController, IRecordService recordService)
     : base(dialogController)
 {
     RecordService = recordService;
     //this is so that the completion screen isnt loaded when the dialog completes
     //this dialog just loads the query into the ui and does not have a 'completion'
     OverideCompletionScreenMethod = () => { };
 }
Ejemplo n.º 5
0
 private void CreateSubject()
 {
     _unitOfWork.Records.Returns(Substitute.For <IRecordRepository>());
     _unitOfWork.Records.Get(_recordId).Returns(new RecordDo {
         RecordId = _recordId
     });
     _subject = new RecordService(_unitOfWork);
 }
Ejemplo n.º 6
0
 // Dependency injection
 public RecordController(IRecordService recordService, IUserService userService, IProjectService projectService,
                         IStringLocalizer <SharedResource> sharedLocalizer)
 {
     this.service     = recordService;
     this.users       = userService;
     this.projects    = projectService;
     _sharedLocalizer = sharedLocalizer;
 }
Ejemplo n.º 7
0
 public Importer(IMapping mapping, IFileSystem fileSystem, IRecordService recordService, IVocabularyService vocabularyService, UserInfo userInfo)
 {
     this.mapping           = mapping;
     this.fileSystem        = fileSystem;
     this.recordService     = recordService;
     this.vocabularyService = vocabularyService;
     this.userInfo          = userInfo;
 }
Ejemplo n.º 8
0
 public RecordController(IRecordService recordService,
                         IRecordPagingService <RecordOverallDTO, Record> recordPagingService,
                         IRecordDetailsService <RecordDetailsDTO> recordDetailsService)
 {
     _recordService        = recordService;
     _recordPagingService  = recordPagingService;
     _recordDetailsService = recordDetailsService;
 }
Ejemplo n.º 9
0
 public ObjectEntryDialog(object objectsToEnter, DialogViewModel parentDialog,
                          IApplicationController applicationController, IRecordService lookupService,
                          IDictionary <string, IEnumerable <string> > optionsetLimitedValues, Action onSave, Action onCancel, string saveButtonLabel = null, string cancelButtonLabel = null, string initialMessage = null)
     : base(parentDialog, applicationController, lookupService, optionsetLimitedValues, onSave, onCancel: onCancel, saveButtonLabel: saveButtonLabel, cancelButtonLabel: cancelButtonLabel)
 {
     InitialMessage = initialMessage;
     _objectToEnter = objectsToEnter;
 }
Ejemplo n.º 10
0
 public HomeController(IOlympicEventService eventService, IRecordService recordService, ICompetitorService competitorService, IQuoteService quoteService, IEventBoardService eventBoardService)
 {
     _eventService      = eventService;
     _recordService     = recordService;
     _competitorService = competitorService;
     _quoteService      = quoteService;
     _eventBoardService = eventBoardService;
 }
Ejemplo n.º 11
0
 public RecordModelService(IRecordMapper mapper, IRecordService service)
 {
     if (service == null || mapper == null)
     {
         throw new ArgumentNullException("Cannot pass null as argument for AuthorModelService constructor");
     }
     _mapper  = mapper;
     _service = service;
 }
Ejemplo n.º 12
0
 public PatientController(IUserService userService, IRoleService roleService, IPatientService patientService, ISpecialityService specialityService, IDoctorService doctorService, IRecordService recordService)
 {
     this.userService       = userService;
     this.roleService       = roleService;
     this.patientService    = patientService;
     this.specialityService = specialityService;
     this.doctorService     = doctorService;
     this.recordService     = recordService;
 }
Ejemplo n.º 13
0
 public SummaryItem(string typeSchemaName, string typeLabel, string matchedFieldSchemaName, string matchedField, IEnumerable <string> ids, IRecordService recordService)
 {
     RecordTypeSchemaName   = typeSchemaName;
     RecordType             = typeLabel;
     MatchedFieldSchemaName = matchedFieldSchemaName;
     MatchedField           = matchedField;
     Ids           = ids;
     RecordService = recordService;
 }
Ejemplo n.º 14
0
 public CreateRecordCommandHandler(
     IMapper mapper,
     IRecordService recordService,
     IAesCryptoProviderService aesCryptoProviderService)
 {
     _mapper                   = mapper;
     _recordService            = recordService;
     _aesCryptoProviderService = aesCryptoProviderService;
 }
Ejemplo n.º 15
0
 public CachedPicklist(IEnumerable <IRecord> picklist, IEnumerable <Condition> conditions,
                       IRecordService lookupService)
 {
     {
         Picklist      = picklist;
         Conditions    = conditions;
         LookupService = lookupService;
     }
 }
Ejemplo n.º 16
0
        protected AppSettingsDialog(DialogViewModel parentDialog, IRecordService lookupService, TSettingsObject objectToEnter)
            : base(parentDialog)
        {
            SettingsObject = objectToEnter;
            var configEntryDialog = new ObjectEntryDialog(SettingsObject, this, ApplicationController, lookupService,
                                                          null, OnSave, null, saveButtonLabel: "Next");

            SubDialogs = new DialogViewModel[] { configEntryDialog };
        }
 public JoinsViewModel(string recordType, IRecordService recordService, IApplicationController controller, Action onConditionSelectedChanged)
     : base(controller)
 {
     OnConditionSelectedChanged = onConditionSelectedChanged;
     RecordType    = recordType;
     RecordService = recordService;
     Joins         = new ObservableCollection <JoinViewModel>();
     AddNewJoin();
 }
Ejemplo n.º 18
0
        public HighScoreForm()
        {
            InitializeComponent();

            recordService = new RecordService();

            recordsListBox.DataSource    = recordService.GetRecords().OrderByDescending(r => r.Score).ToList();
            recordsListBox.DisplayMember = "Info";
        }
Ejemplo n.º 19
0
 public AdminController(IConfigService configService, IEmpService empService,
                        IWebHostEnvironment webHostEnvironment, IPrizeService prizeService, IRecordService recordService)
 {
     _recordService      = recordService;
     _webHostEnvironment = webHostEnvironment;
     _prizeService       = prizeService;
     _empService         = empService;
     _configService      = configService;
 }
 public TextSearchService(IRecordService service, ITextSearchSettings settings,
                          DocumentWriter.DocumentWriter documentWriter,
                          RecordExtractService recordExtractService)
 {
     Service              = service;
     Settings             = settings;
     DocumentWriter       = documentWriter;
     RecordExtractService = recordExtractService;
 }
Ejemplo n.º 21
0
 public SearchService(
     IRecordService recordService,
     UserManager <User> userManager,
     IHttpContextAccessor accessor)
 {
     _recordService = recordService;
     _userManager   = userManager;
     _accessor      = accessor;
 }
Ejemplo n.º 22
0
        public RecordController(IAccountService accountService,
                                IRecordService recordService,
                                IMapper mapper)
        {
            _mapper = mapper;

            _accountService = accountService;
            _recordService  = recordService;
        }
 private static IEnumerable<string> GetValidFields(string recordType, IRecordService lookupService)
 {
     var invalidFieldTypes = new[] { RecordFieldType.ActivityParty, RecordFieldType.Unknown, RecordFieldType.Virtual, RecordFieldType.Image };
     return lookupService
         .GetFieldMetadata(recordType)
         //.Where(f => f.Searchable)
         .Where(f => !invalidFieldTypes.Contains(f.FieldType))
         .Select(f => f.SchemaName)
         .ToArray();
 }
Ejemplo n.º 24
0
        public static string GetPicklistLabel(this IRecordService recordService, string fieldName, string recordType, string value)
        {
            var options = recordService.GetPicklistKeyValues(fieldName, recordType, null, null);

            if (options.Any(o => o.Key == value))
            {
                return(options.First(o => o.Key == value).Value);
            }
            return(value);
        }
Ejemplo n.º 25
0
        public static IEnumerable <GridFieldMetadata> GetGridFields(this IRecordService recordService, string recordType,
                                                                    ViewType preferredViewType)
        {
            var view = GetView(recordService, recordType, preferredViewType);

            return(view
                   .Fields
                   .Select(f => new GridFieldMetadata(f))
                   .ToArray());
        }
Ejemplo n.º 26
0
        protected AppSettingsDialog(IDialogController dialogController,
                                    IRecordService lookupService, TSettingsObject objectToEnter)
            : base(dialogController)
        {
            SettingsObject = objectToEnter;
            var configEntryDialog = new ObjectEntryDialog(SettingsObject, this, ApplicationController, lookupService,
                                                          null, OnSave, null);

            SubDialogs = new DialogViewModel[] { configEntryDialog };
        }
Ejemplo n.º 27
0
        public static IMany2ManyRelationshipMetadata GetManyRelationshipMetadata(this IRecordService recordService, string name, string recordType)
        {
            var match = recordService.GetManyToManyRelationships(recordType).Where(r => r.SchemaName == name);

            if (!match.Any())
            {
                throw new NullReferenceException(string.Format("No {0} relationship for type {1} has name {2}", typeof(IMany2ManyRelationshipMetadata).Name, recordType, name));
            }
            return(match.First());
        }
Ejemplo n.º 28
0
 public MesService(IMesLineRepository meslineRepository, IMesOrgRepository mesOrgRepository, IMesDeptRepository mesDeptRepository, ISettingArticleDateTimeRangeRepository iSettingTimeRepository, IMesMoRepository mesMoRepository, IRecordService iRecordService, IRecordDetailService iRecordDetailService)
 {
     _mesLineRepository      = meslineRepository;
     _mesDeptRepository      = mesDeptRepository;
     _mesOrgRepository       = mesOrgRepository;
     _iSettingTimeRepository = iSettingTimeRepository;
     _mesMoRepository        = mesMoRepository;
     _iRecordService         = iRecordService;
     _iRecordDetailService   = iRecordDetailService;
 }
Ejemplo n.º 29
0
 public RecordController(IRecordService recordService,
                         IClientService clientService,
                         IProcedureService procedureService,
                         IProductService productService)
 {
     _recordService    = recordService;
     _clientService    = clientService;
     _procedureService = procedureService;
     _productService   = productService;
 }
Ejemplo n.º 30
0
 public Seeder(IDocumentSession db, IRecordService recordService)
 {
     this.db            = db;
     this.recordService = recordService;
     userInfo           = new UserInfo
     {
         DisplayName = "Guest",
         Email       = "*****@*****.**"
     };
 }
Ejemplo n.º 31
0
 public RecordsController(IRecordService service, IDocumentSession db, IUserContext user)
 {
     this.service = service;
     this.db = db;
     this.user = user;
 }
Ejemplo n.º 32
0
 public Program(IRecordService recordService)
 {
     _recordService = recordService;
 }
Ejemplo n.º 33
0
 public RecordController(IRecordService recordService)
 {
     this.RecordService = recordService;
     this.AddDisposableObject(recordService);
 }
Ejemplo n.º 34
0
 public Seeder(IDocumentSession db, IRecordService recordService)
 {
     this.db = db;
     this.recordService = recordService;
 }