示例#1
0
 public MappingController(IDepartmentSettingsService departmentSettingsService,
                          IGeoLocationProvider geoLocationProvider, ICallsService callsService,
                          IDepartmentsService departmentsService, IDepartmentGroupsService departmentGroupsService,
                          IActionLogsService actionLogsService, IUnitsService unitsService, IMappingService mappingService,
                          IKmlProvider kmlProvider, IPermissionsService permissionsService, IPersonnelRolesService personnelRolesService)
 {
     _departmentSettingsService = departmentSettingsService;
     _geoLocationProvider       = geoLocationProvider;
     _callsService            = callsService;
     _departmentsService      = departmentsService;
     _departmentGroupsService = departmentGroupsService;
     _actionLogsService       = actionLogsService;
     _unitsService            = unitsService;
     _mappingService          = mappingService;
     _kmlProvider             = kmlProvider;
     _permissionsService      = permissionsService;
     _personnelRolesService   = personnelRolesService;
 }
示例#2
0
 public UnitStateController(
     IUsersService usersService,
     IActionLogsService actionLogsService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IWebEventPublisher webEventPublisher,
     IUserStateService userStateService,
     IUnitsService unitsService
     )
 {
     _usersService       = usersService;
     _actionLogsService  = actionLogsService;
     _departmentsService = departmentsService;
     _userProfileService = userProfileService;
     _webEventPublisher  = webEventPublisher;
     _userStateService   = userStateService;
     _unitsService       = unitsService;
 }
示例#3
0
 public UnitsController(
     IUsersService usersService,
     IActionLogsService actionLogsService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IUserStateService userStateService,
     IUnitsService unitsService,
     IDepartmentGroupsService departmentGroupsService
     )
 {
     _usersService            = usersService;
     _actionLogsService       = actionLogsService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
     _userStateService        = userStateService;
     _unitsService            = unitsService;
     _departmentGroupsService = departmentGroupsService;
 }
示例#4
0
 public UnitStateController(
     IUsersService usersService,
     IActionLogsService actionLogsService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IUserStateService userStateService,
     IUnitsService unitsService,
     IEventAggregator eventAggregator
     )
 {
     _usersService       = usersService;
     _actionLogsService  = actionLogsService;
     _departmentsService = departmentsService;
     _userProfileService = userProfileService;
     _userStateService   = userStateService;
     _unitsService       = unitsService;
     _eventAggregator    = eventAggregator;
 }
示例#5
0
 public AuthorizationService(IDepartmentsService departmentsService, IInvitesService invitesService,
                             ICallsService callsService, IMessageService messageService, IWorkLogsService workLogsService, ISubscriptionsService subscriptionsService,
                             IDepartmentGroupsService departmentGroupsService, IPersonnelRolesService personnelRolesService, IUnitsService unitsService,
                             IPermissionsService permissionsService, ICalendarService calendarService, IProtocolsService protocolsService)
 {
     _departmentsService      = departmentsService;
     _invitesService          = invitesService;
     _callsService            = callsService;
     _messageService          = messageService;
     _workLogsService         = workLogsService;
     _subscriptionsService    = subscriptionsService;
     _departmentGroupsService = departmentGroupsService;
     _personnelRolesService   = personnelRolesService;
     _unitsService            = unitsService;
     _permissionsService      = permissionsService;
     _calendarService         = calendarService;
     _protocolsService        = protocolsService;
 }
示例#6
0
 public NotificationService(IDepartmentNotificationRepository departmentNotificationRepository, IDepartmentsService departmentsService,
                            IUnitsService unitsService, IUserStateService userStateService, IDepartmentGroupsService departmentGroupsService, IActionLogsService actionLogsService,
                            IPersonnelRolesService personnelRolesService, IUserProfileService userProfileService, ICalendarService calendarService, IDocumentsService documentsService,
                            INotesService notesService, IWorkLogsService workLogsService, IShiftsService shiftsService, ICustomStateService customStateService)
 {
     _departmentNotificationRepository = departmentNotificationRepository;
     _departmentsService      = departmentsService;
     _unitsService            = unitsService;
     _userStateService        = userStateService;
     _departmentGroupsService = departmentGroupsService;
     _actionLogsService       = actionLogsService;
     _personnelRolesService   = personnelRolesService;
     _userProfileService      = userProfileService;
     _calendarService         = calendarService;
     _documentsService        = documentsService;
     _notesService            = notesService;
     _workLogsService         = workLogsService;
     _shiftsService           = shiftsService;
     _customStateService      = customStateService;
 }
示例#7
0
 public TwilioProviderController(IDepartmentSettingsService departmentSettingsService, INumbersService numbersService,
                                 ILimitsService limitsService, ICallsService callsService, IQueueService queueService, IDepartmentsService departmentsService,
                                 IUserProfileService userProfileService, ITextCommandService textCommandService, IActionLogsService actionLogsService,
                                 IUserStateService userStateService, ICommunicationService communicationService, IGeoLocationProvider geoLocationProvider,
                                 IDepartmentGroupsService departmentGroupsService, ICustomStateService customStateService, IUnitsService unitsService)
 {
     _departmentSettingsService = departmentSettingsService;
     _numbersService            = numbersService;
     _limitsService             = limitsService;
     _callsService            = callsService;
     _queueService            = queueService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
     _textCommandService      = textCommandService;
     _actionLogsService       = actionLogsService;
     _userStateService        = userStateService;
     _communicationService    = communicationService;
     _geoLocationProvider     = geoLocationProvider;
     _departmentGroupsService = departmentGroupsService;
     _customStateService      = customStateService;
     _unitsService            = unitsService;
 }
示例#8
0
 public StationsController(
     ICallsService callsService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IGeoLocationProvider geoLocationProvider,
     IAuthorizationService authorizationService,
     IDepartmentGroupsService departmentGroupsService,
     IPersonnelRolesService personnelRolesService,
     IUnitsService unitsService,
     IActionLogsService actionLogsService,
     IUserStateService userStateService)
 {
     _callsService            = callsService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
     _geoLocationProvider     = geoLocationProvider;
     _authorizationService    = authorizationService;
     _departmentGroupsService = departmentGroupsService;
     _personnelRolesService   = personnelRolesService;
     _unitsService            = unitsService;
     _actionLogsService       = actionLogsService;
     _userStateService        = userStateService;
 }
示例#9
0
 public DeleteService(IAuthorizationService authorizationService, IDepartmentsService departmentsService,
                      ICallsService callsService, IActionLogsService actionLogsService, IUsersService usersService,
                      IUserProfileService userProfileService, IMessageService messageService, IDepartmentGroupsService departmentGroupsService,
                      IWorkLogsService workLogsService, IUserStateService userStateService, IPersonnelRolesService personnelRolesService, IDistributionListsService distributionListsService,
                      IShiftsService shiftsService, IUnitsService unitsService, ICertificationService certificationService, ILogService logService)
 {
     _authorizationService     = authorizationService;
     _departmentsService       = departmentsService;
     _callsService             = callsService;
     _actionLogsService        = actionLogsService;
     _usersService             = usersService;
     _userProfileService       = userProfileService;
     _messageService           = messageService;
     _departmentGroupsService  = departmentGroupsService;
     _workLogsService          = workLogsService;
     _userStateService         = userStateService;
     _personnelRolesService    = personnelRolesService;
     _distributionListsService = distributionListsService;
     _shiftsService            = shiftsService;
     _unitsService             = unitsService;
     _certificationService     = certificationService;
     _logService = logService;
 }
示例#10
0
        /// <summary>
        /// Конструктор фасаду сервісного рівня
        /// </summary>
        /// <param name="categoriesService">Екземпляр сервісу категорій</param>
        /// <param name="groupsService">Екземпляр сервісу груп</param>
        /// <param name="imagesService">Екземпляр сервісу зображень</param>
        /// <param name="parametersService">Екземпляр сервісу характеристик</param>
        /// <param name="productsService">Екземпляр сервісу товарів</param>
        /// <param name="suppliersService">Екземпляр сервісу постачальників</param>
        /// <param name="unitsService">Екземпляр сервісу одиниць виміру</param>
        /// <param name="imagesAgent">Екземпляр завантажувача зображень</param>
        /// <param name="parametersAgent">Екземпляр завантажувача характеристик</param>
        /// <param name="saverToCsvAgent">Екземпляр класу збереження в Csv</param>
        /// <param name="saverToXmlAgent">Екземпляр класу збереження в Xml</param>
        public StoreFacade(ICategoriesService categoriesService,
                           IGroupsService groupsService,
                           IImagesService imagesService,
                           IParametersService parametersService,
                           IProductsService productsService,
                           ISuppliersService suppliersService,
                           IUnitsService unitsService,

                           IImagesAgent imagesAgent, IParametersAgent parametersAgent,
                           ISaverToCsvAgent saverToCsvAgent, ISaverToXmlAgent saverToXmlAgent)
        {
            this.categoriesService = categoriesService;
            this.groupsService     = groupsService;
            this.imagesService     = imagesService;
            this.parametersService = parametersService;
            this.productsService   = productsService;
            this.suppliersService  = suppliersService;
            this.unitsService      = unitsService;

            this.imagesAgent     = imagesAgent;
            this.parametersAgent = parametersAgent;
            this.saverToCsvAgent = saverToCsvAgent;
            this.saverToXmlAgent = saverToXmlAgent;
        }
示例#11
0
 public CommandAppController(
     IUsersService usersService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IUnitsService unitsService,
     ICallsService callsService,
     IDepartmentGroupsService departmentGroupsService,
     IPersonnelRolesService personnelRolesService,
     ICustomStateService customStateService,
     IGeoLocationProvider geoLocationProvider,
     IIncidentService incidentService
     )
 {
     _usersService            = usersService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
     _unitsService            = unitsService;
     _callsService            = callsService;
     _departmentGroupsService = departmentGroupsService;
     _personnelRolesService   = personnelRolesService;
     _customStateService      = customStateService;
     _geoLocationProvider     = geoLocationProvider;
     _incidentService         = incidentService;
 }
示例#12
0
 public CoreDataController(
     IUsersService usersService,
     IDepartmentsService departmentsService,
     IUserProfileService userProfileService,
     IUnitsService unitsService,
     IDepartmentGroupsService departmentGroupsService,
     IPersonnelRolesService personnelRolesService,
     ICustomStateService customStateService,
     IPermissionsService permissionsService,
     ICallsService callsService,
     IFirebaseService firebaseService
     )
 {
     _usersService            = usersService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
     _unitsService            = unitsService;
     _departmentGroupsService = departmentGroupsService;
     _personnelRolesService   = personnelRolesService;
     _customStateService      = customStateService;
     _permissionsService      = permissionsService;
     _callsService            = callsService;
     _firebaseService         = firebaseService;
 }
示例#13
0
        private void deleteSpravochItemBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (gridName)
            {
            case Utils.GridName.Units:

                if (unitsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.unitsService.UnitDelete((UnitsDTO)unitsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.unitsBS.RemoveCurrent();
                            unitsService                 = Program.kernel.Get <IUnitsService>();
                            unitsBS.DataSource           = unitsService.GetUnits();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.unitsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Ед.измерения нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.Users:

                if (usersBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.usersService.UserDeleteById(((UsersDTO)usersBS.Current).UserId))
                        {
                            int rowHandle = spravochGridView.FocusedRowHandle - 1;
                            spravochGridView.BeginDataUpdate();

                            usersService            = Program.kernel.Get <IUsersService>();
                            usersBS.DataSource      = usersService.GetUsers();
                            spravochGrid.DataSource = usersBS;

                            spravochGridView.EndDataUpdate();
                            spravochGridView.FocusedRowHandle = (spravochGridView.IsValidRowHandle(rowHandle)) ? rowHandle : -1;
                        }
                    }
                }
                break;

            case Utils.GridName.Contractors:

                if (contractorsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.contractorsService.ContractorDelete((ContractorsDTO)contractorsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.contractorsBS.RemoveCurrent();

                            contractorsService           = Program.kernel.Get <IContractorsService>();
                            contractorsBS.DataSource     = contractorsService.GetContractors();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.contractorsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Поставщика нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.StorageGroups:

                if (storageGroupsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.storageGroupsService.StorageGroupsDelete((StorageGroupsDTO)storageGroupsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.storageGroupsBS.RemoveCurrent();

                            storageGroupsService         = Program.kernel.Get <IStorageGroupsService>();
                            storageGroupsBS.DataSource   = storageGroupsService.GetStorageGroups();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.storageGroupsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Складскую группу нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.Measures:

                if (measuresBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.measuresService.MeasureDelete((MeasuresDTO)measuresBS.Current))
                        {
                            this.measuresBS.RemoveCurrent();
                        }

                        measuresService              = Program.kernel.Get <IMeasuresService>();
                        measuresBS.DataSource        = measuresService.GetMeasures();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.measuresBS;
                    }
                }
                break;

            case Utils.GridName.Currency:

                if (currencyBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.currencyService.CurrencyDelete((CurrencyDTO)currencyBS.Current))
                        {
                            this.currencyBS.RemoveCurrent();
                        }

                        currencyService              = Program.kernel.Get <ICurrencyService>();
                        currencyBS.DataSource        = currencyService.GetCurrency();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.currencyBS;
                    }
                }
                break;

            case Utils.GridName.ZoneNames:

                if (zoneNamesBS.Count != 0)
                {
                    cellList = wareHousesService.GetWareHouses().ToList();
                    bool anyCellLoading = cellList.Any(s => s.ZoneNameId == (((ZoneNamesDTO)zoneNamesBS.Current).ZoneNameId) && s.LoadingStatusId > 1);    // проверка загруженности зоны

                    if (anyCellLoading)
                    {
                        if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (this.zoneNamesService.ZoneAllDelete(((ZoneNamesDTO)zoneNamesBS.Current).ZoneNameId))      //удаление данных по всем связанным таблицам
                            {
                                if (this.zoneNamesService.ZoneNameDelete((ZoneNamesDTO)zoneNamesBS.Current))
                                {
                                    this.zoneNamesBS.RemoveCurrent();
                                }

                                zoneNamesService             = Program.kernel.Get <IZoneNamesService>();
                                zoneNamesBS.DataSource       = zoneNamesService.GetZones();
                                this.spravochGrid.DataSource = null;
                                this.spravochGrid.DataSource = this.zoneNamesBS;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Нельзя удалить зону. В выбранной зоне находиться ТОВАР.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;

            case Utils.GridName.Persons:

                if (personsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.personsService.PersonDelete((PersonsDTO)personsBS.Current))
                        {
                            this.personsBS.RemoveCurrent();
                        }

                        personsService               = Program.kernel.Get <IPersonsService>();
                        personsBS.DataSource         = personsService.GetPersons();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.personsBS;
                    }
                }
                break;

            case Utils.GridName.Profession:

                if (professionBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.professionService.ProfessionDelete((ProfessionsDTO)professionBS.Current))
                        {
                            this.professionBS.RemoveCurrent();
                        }

                        professionService            = Program.kernel.Get <IProfessionService>();
                        professionBS.DataSource      = professionService.GetProfession();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.professionBS;
                    }
                }
                break;

            case Utils.GridName.Alarms:

                if (alarmsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.settingsService.AlarmDelete((AlarmsDTO)alarmsBS.Current))
                        {
                            this.alarmsBS.RemoveCurrent();
                        }

                        settingsService              = Program.kernel.Get <ISettingsService>();
                        alarmsBS.DataSource          = settingsService.GetAlarms();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.alarmsBS;
                    }
                }
                break;

            default:

                break;
            }
        }
示例#14
0
 public CustomStatusesController(ICustomStateService customStateService, IUnitsService unitsService)
 {
     _customStateService = customStateService;
     _unitsService       = unitsService;
 }
 public UnitsController(IUnitsService service)
 {
     this.service = service;
 }
示例#16
0
 public GroupsController(IDepartmentsService departmentsService, IUsersService usersService, IDepartmentGroupsService departmentGroupsService,
                         Model.Services.IAuthorizationService authorizationService, ILimitsService limitsService, IGeoLocationProvider geoLocationProvider, IDeleteService deleteService,
                         IEventAggregator eventAggregator, IUserProfileService userProfileService, IUnitsService unitsService, IShiftsService shiftsService)
 {
     _departmentsService      = departmentsService;
     _usersService            = usersService;
     _departmentGroupsService = departmentGroupsService;
     _authorizationService    = authorizationService;
     _limitsService           = limitsService;
     _geoLocationProvider     = geoLocationProvider;
     _deleteService           = deleteService;
     _eventAggregator         = eventAggregator;
     _userProfileService      = userProfileService;
     _unitsService            = unitsService;
     _shiftsService           = shiftsService;
 }
示例#17
0
        public async Task <Tuple <bool, string> > Process(CallEmailQueueItem item)
        {
            bool   success = true;
            string result  = "";

            _callEmailProvider = Bootstrapper.GetKernel().Resolve <ICallEmailProvider>();

            if (!String.IsNullOrWhiteSpace(item?.EmailSettings?.Hostname))
            {
                CallEmailsResult emailResult = _callEmailProvider.GetAllCallEmailsFromServer(item.EmailSettings);

                if (emailResult?.Emails != null && emailResult.Emails.Count > 0)
                {
                    var calls = new List <Call>();

                    _callsService              = Bootstrapper.GetKernel().Resolve <ICallsService>();
                    _queueService              = Bootstrapper.GetKernel().Resolve <IQueueService>();
                    _departmentsService        = Bootstrapper.GetKernel().Resolve <IDepartmentsService>();
                    _userProfileService        = Bootstrapper.GetKernel().Resolve <IUserProfileService>();
                    _departmentSettingsService = Bootstrapper.GetKernel().Resolve <IDepartmentSettingsService>();
                    _unitsService              = Bootstrapper.GetKernel().Resolve <IUnitsService>();

                    // Ran into an issue where the department users didn't come back. We can't put the email back in the POP
                    // email box so just added some simple retry logic here.
                    List <IdentityUser> departmentUsers = await _departmentsService.GetAllUsersForDepartmentAsync(item.EmailSettings.DepartmentId, true);

                    var profiles = await _userProfileService.GetAllProfilesForDepartmentAsync(item.EmailSettings.DepartmentId);

                    int retry = 0;
                    while (retry < 3 && departmentUsers == null)
                    {
                        Thread.Sleep(150);
                        departmentUsers = await _departmentsService.GetAllUsersForDepartmentAsync(item.EmailSettings.DepartmentId, true);

                        retry++;
                    }

                    foreach (var email in emailResult.Emails)
                    {
                        var activeCalls = await _callsService.GetActiveCallsByDepartmentAsync(item.EmailSettings.Department.DepartmentId);

                        var units = await _unitsService.GetUnitsForDepartmentAsync(item.EmailSettings.Department.DepartmentId);

                        var priorities = await _callsService.GetActiveCallPrioritiesForDepartmentAsync(item.EmailSettings.Department.DepartmentId);

                        int defaultPriority = (int)CallPriority.High;

                        if (priorities != null && priorities.Any())
                        {
                            var defaultPrio = priorities.FirstOrDefault(x => x.IsDefault && x.IsDeleted == false);

                            if (defaultPrio != null)
                            {
                                defaultPriority = defaultPrio.DepartmentCallPriorityId;
                            }
                        }

                        var call = _callsService.GenerateCallFromEmail(item.EmailSettings.FormatType, email,
                                                                       item.EmailSettings.Department.ManagingUserId, departmentUsers, item.EmailSettings.Department, activeCalls, units, defaultPriority, priorities);

                        if (call != null)
                        {
                            call.DepartmentId = item.EmailSettings.DepartmentId;

                            if (!calls.Any(x => x.Name == call.Name && x.NatureOfCall == call.NatureOfCall))
                            {
                                calls.Add(call);
                            }
                        }
                    }

                    if (calls.Any())
                    {
                        var departmentTextNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(item.EmailSettings.DepartmentId);

                        foreach (var call in calls)
                        {
                            try
                            {
                                // Adding this in here to try and fix the error below with ObjectContext issues.
                                var newCall = CreateNewCallFromCall(call);

                                if (newCall.Dispatches != null && newCall.Dispatches.Any())
                                {
                                    // We've been having this error here:
                                    //      The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects.
                                    // So I'm wrapping this in a try catch to prevent all calls form being dropped.
                                    var savedCall = await _callsService.SaveCallAsync(newCall);

                                    var cqi = new CallQueueItem();
                                    cqi.Call = savedCall;

                                    cqi.Profiles             = profiles.Values.ToList();
                                    cqi.DepartmentTextNumber = departmentTextNumber;

                                    await _queueService.EnqueueCallBroadcastAsync(cqi);
                                }
                            }
                            catch (Exception ex)
                            {
                                result = ex.ToString();
                                Logging.LogException(ex);
                            }
                        }
                    }

                    await _departmentsService.SaveDepartmentEmailSettingsAsync(emailResult.EmailSettings);

                    _callsService              = null;
                    _queueService              = null;
                    _departmentsService        = null;
                    _callEmailProvider         = null;
                    _userProfileService        = null;
                    _departmentSettingsService = null;
                }
            }

            return(new Tuple <bool, string>(success, result));
        }
示例#18
0
        public ExerciseDetailsViewModel(
            IMasterDetailNavigation navigationService, IDialogService dialogService, IMessagingService messagingService, IUnitsService units,
            IExercisesRepository exercisesRepository, IRoutineDaysRepository routineDaysRepository)
        {
            _navigationService     = navigationService;
            _dialogService         = dialogService;
            _messagingService      = messagingService;
            _units                 = units;
            _exercisesRepository   = exercisesRepository;
            _routineDaysRepository = routineDaysRepository;

            Title = AppResources.AddExerciseTitle;

            DeleteCommand = new Command(async() => { await OnDelete(); });
            SaveCommand   = new Command(async() => await OnSave());
        }
示例#19
0
 public UnitsController(IUnitsService unitsService, IMapper mapper)
 {
     this.unitsService = unitsService ?? throw new ArgumentNullException(nameof(unitsService));
     this.mapper       = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
示例#20
0
        private void editSpravochItemBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (gridName)
            {
            case Utils.GridName.Units:

                if (unitsBS.Count != 0)
                {
                    using (UnitEditFm unitEditFm = new UnitEditFm(Utils.Operation.Update, (UnitsDTO)unitsBS.Current))
                    {
                        if (unitEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_UnitId = unitEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            unitsService            = Program.kernel.Get <IUnitsService>();
                            unitsBS.DataSource      = unitsService.GetUnits();
                            spravochGrid.DataSource = unitsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("UnitId", return_UnitId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Users:

                if (usersBS.Count != 0)
                {
                    using (UserEditFm userEditFm = new UserEditFm(Utils.Operation.Update, (UsersDTO)usersBS.Current))
                    {
                        if (userEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_UserId = userEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            usersService            = Program.kernel.Get <IUsersService>();
                            usersBS.DataSource      = usersService.GetUsers();
                            spravochGrid.DataSource = usersBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("UserId", return_UserId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Contractors:

                if (contractorsBS.Count != 0)
                {
                    using (ContractorEditFm contractorEditFm = new ContractorEditFm(Utils.Operation.Update, (ContractorsDTO)contractorsBS.Current))
                    {
                        if (contractorEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_ContractorId = contractorEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            contractorsService       = Program.kernel.Get <IContractorsService>();
                            contractorsBS.DataSource = contractorsService.GetContractors();
                            spravochGrid.DataSource  = contractorsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("ContractorId", return_ContractorId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                    break;
                }
                break;

            case Utils.GridName.StorageGroups:

                if (storageGroupsBS.Count != 0)
                {
                    using (StorageGroupEditFm storageGroupEditFm = new StorageGroupEditFm(Utils.Operation.Update, (StorageGroupsDTO)storageGroupsBS.Current))
                    {
                        if (storageGroupEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_StorageGroupId = storageGroupEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            storageGroupsService       = Program.kernel.Get <IStorageGroupsService>();
                            storageGroupsBS.DataSource = storageGroupsService.GetStorageGroups();
                            spravochGrid.DataSource    = storageGroupsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("StorageGroupId", return_StorageGroupId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                    break;
                }
                break;

            case Utils.GridName.Measures:

                if (measuresBS.Count != 0)
                {
                    new MeasureEditFm(Utils.Operation.Update, (MeasuresDTO)measuresBS.Current, (obj) => { }).ShowDialog();
                    measuresService       = Program.kernel.Get <IMeasuresService>();
                    measuresBS.DataSource = measuresService.GetMeasures();

                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.measuresBS;
                }
                break;

            case Utils.GridName.Currency:

                if (currencyBS.Count != 0)
                {
                    //new CurrencyEditFm(Utils.Operation.Update, (CurrencyDTO)currencyBS.Current, (obj) => { }).ShowDialog();
                    currencyService              = Program.kernel.Get <ICurrencyService>();
                    currencyBS.DataSource        = currencyService.GetCurrency();
                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.currencyBS;
                }
                break;

            case Utils.GridName.ZoneNames:

                if (zoneNamesBS.Count != 0)
                {
                    new ZoneNameEditFm(Utils.Operation.Update, (ZoneNamesDTO)zoneNamesBS.Current).ShowDialog();
                    zoneNamesService             = Program.kernel.Get <IZoneNamesService>();
                    zoneNamesBS.DataSource       = zoneNamesService.GetZones();
                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.zoneNamesBS;
                }
                break;

            case Utils.GridName.Persons:

                if (personsBS.Count != 0)
                {
                    using (PersonEditFm personEditFm = new PersonEditFm(Utils.Operation.Update, (PersonsDTO)personsBS.Current))
                    {
                        if (personEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_PersonId = personEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            personsService          = Program.kernel.Get <IPersonsService>();
                            personsBS.DataSource    = personsService.GetPersons();
                            spravochGrid.DataSource = personsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("PersonId", return_PersonId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Profession:

                if (professionBS.Count != 0)
                {
                    using (ProfessionEditFm professionEditFm = new ProfessionEditFm(Utils.Operation.Update, (ProfessionsDTO)professionBS.Current))
                    {
                        if (professionEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_Id = professionEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            professionService       = Program.kernel.Get <IProfessionService>();
                            personsBS.DataSource    = professionService.GetProfession();
                            spravochGrid.DataSource = professionBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("Id", return_Id);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Alarms:

                if (alarmsBS.Count != 0)
                {
                    using (AlarmEditFm alarmEditFm = new AlarmEditFm(Utils.Operation.Update, (AlarmsDTO)alarmsBS.Current))
                    {
                        if (alarmEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_Id = alarmEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            settingsService         = Program.kernel.Get <ISettingsService>();
                            alarmsBS.DataSource     = settingsService.GetAlarms();
                            spravochGrid.DataSource = alarmsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("Id", return_Id);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            default:

                break;
            }
        }
示例#21
0
 public UnitsController(IDepartmentsService departmentsService, IUsersService usersService, IUnitsService unitsService, Model.Services.IAuthorizationService authorizationService,
                        ILimitsService limitsService, IDepartmentGroupsService departmentGroupsService, ICallsService callsService, IEventAggregator eventAggregator, ICustomStateService customStateService,
                        IGeoService geoService)
 {
     _departmentsService      = departmentsService;
     _usersService            = usersService;
     _unitsService            = unitsService;
     _authorizationService    = authorizationService;
     _limitsService           = limitsService;
     _departmentGroupsService = departmentGroupsService;
     _callsService            = callsService;
     _eventAggregator         = eventAggregator;
     _customStateService      = customStateService;
     _geoService = geoService;
 }
示例#22
0
 /// <summary>
 /// Operations to perform against the department links system. Department Links allow departments to
 /// share data to other departments, for example calls or resource orders.
 /// </summary>
 public LinksController(IDepartmentsService departmentsService, IDepartmentLinksService departmentLinksService, ILimitsService limitsService,
                        ICallsService callsService, IUserProfileService userProfileService, IGeoLocationProvider geoLocationProvider, IUnitsService unitsService,
                        IActionLogsService actionLogsService, IUserStateService userStateService)
 {
     _departmentsService     = departmentsService;
     _departmentLinksService = departmentLinksService;
     _limitsService          = limitsService;
     _callsService           = callsService;
     _userProfileService     = userProfileService;
     _geoLocationProvider    = geoLocationProvider;
     _unitsService           = unitsService;
     _actionLogsService      = actionLogsService;
     _userStateService       = userStateService;
 }
 public UnitsController(IUnitsService unitsService)
 {
     _unitsService = unitsService;
 }
示例#24
0
        public static async Task <bool> ProcessCallQueueItem(CallQueueItem cqi)
        {
            try
            {
                if (cqi != null && cqi.Call != null && cqi.Call.HasAnyDispatches())
                {
                    if (_communicationService == null)
                    {
                        _communicationService = Bootstrapper.GetKernel().Resolve <ICommunicationService>();
                    }

                    if (_callsService == null)
                    {
                        _callsService = Bootstrapper.GetKernel().Resolve <ICallsService>();
                    }

                    List <int> groupIds = new List <int>();

                    /* Trying to see if I can eek out a little perf here now that profiles are in Redis. Previously the
                     * the parallel operation would cause EF errors. This shouldn't be the case now because profiles are
                     * cached and GetProfileForUser operations will hit that first.
                     */
                    if (cqi.Profiles == null || !cqi.Profiles.Any())
                    {
                        if (_userProfilesService == null)
                        {
                            _userProfilesService = Bootstrapper.GetKernel().Resolve <IUserProfileService>();
                        }

                        cqi.Profiles = (await _userProfilesService.GetAllProfilesForDepartmentAsync(cqi.Call.DepartmentId)).Select(x => x.Value).ToList();
                    }

                    if (cqi.CallDispatchAttachmentId > 0)
                    {
                        //var callsService = Bootstrapper.GetKernel().Resolve<ICallsService>();
                        cqi.Call.ShortenedAudioUrl = await _callsService.GetShortenedAudioUrlAsync(cqi.Call.CallId, cqi.CallDispatchAttachmentId);
                    }

                    cqi.Call.ShortenedCallUrl = await _callsService.GetShortenedCallLinkUrl(cqi.Call.CallId);

                    try
                    {
                        cqi.Call.CallPriority = await _callsService.GetCallPrioritiesByIdAsync(cqi.Call.DepartmentId, cqi.Call.Priority, false);
                    }
                    catch { /* Doesn't matter */ }

                    var dispatchedUsers = new HashSet <string>();

                    // Dispatch Personnel
                    if (cqi.Call.Dispatches != null && cqi.Call.Dispatches.Any())
                    {
                        Parallel.ForEach(cqi.Call.Dispatches, d =>
                        {
                            dispatchedUsers.Add(d.UserId);

                            try
                            {
                                var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == d.UserId);

                                if (profile != null)
                                {
                                    _communicationService.SendCallAsync(cqi.Call, d, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                }
                            }
                            catch (SocketException sex)
                            {
                            }
                        });
                    }

                    if (_departmentGroupsService == null)
                    {
                        _departmentGroupsService = Bootstrapper.GetKernel().Resolve <IDepartmentGroupsService>();
                    }

                    // Dispatch Groups
                    if (cqi.Call.GroupDispatches != null && cqi.Call.GroupDispatches.Any())
                    {
                        foreach (var d in cqi.Call.GroupDispatches)
                        {
                            if (!groupIds.Contains(d.DepartmentGroupId))
                            {
                                groupIds.Add(d.DepartmentGroupId);
                            }

                            var members = await _departmentGroupsService.GetAllMembersForGroupAsync(d.DepartmentGroupId);

                            foreach (var member in members)
                            {
                                if (!dispatchedUsers.Contains(member.UserId))
                                {
                                    dispatchedUsers.Add(member.UserId);
                                    try
                                    {
                                        var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                        await _communicationService.SendCallAsync(cqi.Call, new CallDispatch()
                                        {
                                            UserId = member.UserId
                                        }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                    }
                                    catch (SocketException sex)
                                    {
                                    }
                                    catch (Exception ex)
                                    {
                                        Logging.LogException(ex);
                                    }
                                }
                            }
                        }
                    }

                    // Dispatch Units
                    if (cqi.Call.UnitDispatches != null && cqi.Call.UnitDispatches.Any())
                    {
                        if (_unitsService == null)
                        {
                            _unitsService = Bootstrapper.GetKernel().Resolve <IUnitsService>();
                        }

                        foreach (var d in cqi.Call.UnitDispatches)
                        {
                            var unit = await _unitsService.GetUnitByIdAsync(d.UnitId);

                            if (unit != null && unit.StationGroupId.HasValue)
                            {
                                if (!groupIds.Contains(unit.StationGroupId.Value))
                                {
                                    groupIds.Add(unit.StationGroupId.Value);
                                }
                            }

                            await _communicationService.SendUnitCallAsync(cqi.Call, d, cqi.DepartmentTextNumber, cqi.Address);

                            var unitAssignedMembers = await _unitsService.GetCurrentRolesForUnitAsync(d.UnitId);

                            if (unitAssignedMembers != null && unitAssignedMembers.Count() > 0)
                            {
                                foreach (var member in unitAssignedMembers)
                                {
                                    if (!dispatchedUsers.Contains(member.UserId))
                                    {
                                        dispatchedUsers.Add(member.UserId);
                                        try
                                        {
                                            var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                            await _communicationService.SendCallAsync(cqi.Call, new CallDispatch()
                                            {
                                                UserId = member.UserId
                                            }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                        }
                                        catch (SocketException sex)
                                        {
                                        }
                                        catch (Exception ex)
                                        {
                                            Logging.LogException(ex);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (unit.StationGroupId.HasValue)
                                {
                                    var members = await _departmentGroupsService.GetAllMembersForGroupAsync(unit.StationGroupId.Value);

                                    foreach (var member in members)
                                    {
                                        if (!dispatchedUsers.Contains(member.UserId))
                                        {
                                            dispatchedUsers.Add(member.UserId);
                                            try
                                            {
                                                var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                                await _communicationService.SendCallAsync(cqi.Call, new CallDispatch()
                                                {
                                                    UserId = member.UserId
                                                }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                            }
                                            catch (SocketException sex)
                                            {
                                            }
                                            catch (Exception ex)
                                            {
                                                Logging.LogException(ex);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    // Dispatch Roles
                    if (cqi.Call.RoleDispatches != null && cqi.Call.RoleDispatches.Any())
                    {
                        if (_rolesService == null)
                        {
                            _rolesService = Bootstrapper.GetKernel().Resolve <IPersonnelRolesService>();
                        }

                        foreach (var d in cqi.Call.RoleDispatches)
                        {
                            var members = await _rolesService.GetAllMembersOfRoleAsync(d.RoleId);

                            foreach (var member in members)
                            {
                                if (!dispatchedUsers.Contains(member.UserId))
                                {
                                    dispatchedUsers.Add(member.UserId);
                                    try
                                    {
                                        var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                        await _communicationService.SendCallAsync(cqi.Call, new CallDispatch()
                                        {
                                            UserId = member.UserId
                                        }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                    }
                                    catch (SocketException sex)
                                    {
                                    }
                                    catch (Exception ex)
                                    {
                                        Logging.LogException(ex);
                                    }
                                }
                            }
                        }
                    }

                    // Send Call Print to Printer
                    if (_printerProvider == null)
                    {
                        _printerProvider = Bootstrapper.GetKernel().Resolve <IPrinterProvider>();
                    }

                    Dictionary <int, DepartmentGroup> fetchedGroups = new Dictionary <int, DepartmentGroup>();
                    if (cqi.Call.Dispatches != null && cqi.Call.Dispatches.Any())
                    {
                        foreach (var d in cqi.Call.Dispatches)
                        {
                            var group = await _departmentGroupsService.GetGroupForUserAsync(d.UserId, cqi.Call.DepartmentId);

                            if (group != null)
                            {
                                if (!groupIds.Contains(group.DepartmentGroupId))
                                {
                                    groupIds.Add(group.DepartmentGroupId);
                                }

                                if (!fetchedGroups.ContainsKey(group.DepartmentGroupId))
                                {
                                    fetchedGroups.Add(group.DepartmentGroupId, group);
                                }
                            }
                        }
                    }

                    foreach (var groupId in groupIds)
                    {
                        try
                        {
                            DepartmentGroup group = null;

                            if (fetchedGroups.ContainsKey(groupId))
                            {
                                group = fetchedGroups[groupId];
                            }
                            else
                            {
                                group = await _departmentGroupsService.GetGroupByIdAsync(groupId);
                            }

                            if (!String.IsNullOrWhiteSpace(group.PrinterData) && group.DispatchToPrinter)
                            {
                                var printerData = JsonConvert.DeserializeObject <DepartmentGroupPrinter>(group.PrinterData);
                                var apiKey      = SymmetricEncryption.Decrypt(printerData.ApiKey, Config.SystemBehaviorConfig.ExternalLinkUrlParamPassphrase);
                                var callUrl     = await _callsService.GetShortenedCallPdfUrl(cqi.Call.CallId, true, groupId);

                                var printJob = _printerProvider.SubmitPrintJob(apiKey, printerData.PrinterId, "CallPrint", callUrl);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogException(ex);
                        }
                    }
                }
            }
            finally
            {
                _communicationService = null;
            }

            return(true);
        }
示例#25
0
        public SpravochFm(Utils.GridName aName)
        {
            InitializeComponent();

            gridName = aName;

            splashScreenManager.ShowWaitForm();

            switch (aName)
            {
            case Utils.GridName.Units:
                unitsService       = Program.kernel.Get <IUnitsService>();
                unitsBS.DataSource = unitsService.GetUnits();
                GridColumnCreate(Utils.dictUnits, gridName);
                spravochGrid.DataSource = unitsBS;
                this.Text = "Справочник единиц измерения";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "unitsItem" && c.AccessRightId == 1);  //чтение
                if (access)
                {
                    AuthorizatedUserAccess();
                }

                break;

            case Utils.GridName.Users:
                usersService       = Program.kernel.Get <IUsersService>();
                usersBS.DataSource = usersService.GetUsers();
                GridColumnCreate(Utils.dictUsers, gridName);
                spravochGrid.DataSource = usersBS;
                this.Text = "Справочник пользователей";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "usersItem" && c.AccessRightId == 1);

                break;

            case Utils.GridName.Contractors:
                contractorsService       = Program.kernel.Get <IContractorsService>();
                contractorsBS.DataSource = contractorsService.GetContractors();
                GridColumnCreate(Utils.dictContractors, gridName);
                spravochGrid.DataSource = contractorsBS;
                this.Text = "Справочник контрагентов";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "contractorsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Measures:
                measuresService       = Program.kernel.Get <IMeasuresService>();
                measuresBS.DataSource = measuresService.GetMeasures();
                GridColumnCreate(Utils.dictMeasures, gridName);
                spravochGrid.DataSource = measuresBS;
                this.Text = "Справочник габаритов/размеров";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "measuresItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Currency:
                currencyService       = Program.kernel.Get <ICurrencyService>();
                currencyBS.DataSource = currencyService.GetCurrency();
                GridColumnCreate(Utils.dictCurrency, gridName);
                spravochGrid.DataSource = currencyBS;
                this.Text = "Справочник валют";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "currencyItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.ZoneNames:
                zoneNamesService       = Program.kernel.Get <IZoneNamesService>();
                wareHousesService      = Program.kernel.Get <IWareHousesService>();
                zoneNamesBS.DataSource = zoneNamesService.GetZones();
                GridColumnCreate(Utils.dictZoneNames, gridName);
                spravochGrid.DataSource = zoneNamesBS;
                this.Text = "Зоны хранения";

                break;

            case Utils.GridName.StorageGroups:
                storageGroupsService       = Program.kernel.Get <IStorageGroupsService>();
                storageGroupsBS.DataSource = storageGroupsService.GetStorageGroups();
                GridColumnCreate(Utils.dictStorageGroups, gridName);
                spravochGrid.DataSource = storageGroupsBS;
                this.Text = "Складские группы";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "storageGroupsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Persons:
                personsService       = Program.kernel.Get <IPersonsService>();
                personsBS.DataSource = personsService.GetPersons();
                GridColumnCreate(Utils.dictPersons, gridName);
                spravochGrid.DataSource = personsBS;
                this.Text = "Ответственные лица";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "personsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Profession:
                professionService       = Program.kernel.Get <IProfessionService>();
                professionBS.DataSource = professionService.GetProfession();
                GridColumnCreate(Utils.dictProfession, gridName);
                spravochGrid.DataSource = professionBS;
                this.Text = "Профессии";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "professionItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Alarms:
                settingsService     = Program.kernel.Get <ISettingsService>();
                alarmsBS.DataSource = settingsService.GetAlarms();
                GridColumnCreate(Utils.dictAlarms, gridName);
                spravochGrid.DataSource = alarmsBS;
                this.Text = "Журнал сообшений об ошибках";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "alarmItem" && c.AccessRightId == 1);
                break;

            default:

                break;
            }

            if (access)
            {
                AuthorizatedUserAccess();
            }
            splashScreenManager.CloseWaitForm();
        }
示例#26
0
 public UnitLocationController(IUnitsService unitsService, ICqrsProvider cqrsProvider)
 {
     _unitsService = unitsService;
     _cqrsProvider = cqrsProvider;
 }
示例#27
0
 public InventoryController(IInventoryService inventoryService, IDepartmentGroupsService departmentGroupsService, IUnitsService unitsService, IDepartmentsService departmentsService, IUserProfileService userProfileService)
 {
     _inventoryService        = inventoryService;
     _departmentGroupsService = departmentGroupsService;
     _unitsService            = unitsService;
     _departmentsService      = departmentsService;
     _userProfileService      = userProfileService;
 }
示例#28
0
 public CalculateLogistis()
 {
     _countryDeliverableSevice = new CountryDeliverablesService();
     _countryPriceService      = new CountryPriceService();
     _unitsService             = new UnitsService();
 }
示例#29
0
 private void LoadMeasuresData()
 {
     measuresService = Program.kernel.Get<IMeasuresService>();
     packingTypesService = Program.kernel.Get<IPackingTypesService>();
     unitsService = Program.kernel.Get<IUnitsService>();
 }
示例#30
0
 public WorkoutRules(IUnitsService units, IWorkoutsRepository workoutsRepository)
 {
     _units = units;
     _workoutsRepository = workoutsRepository;
 }