Exemple #1
0
        public void Reset()
        {
            BasisWeight     = false;
            BurstStrength   = false;
            Caliper         = false;
            FeetPerMin      = false;
            MoistureContent = false;
            OutTurnForm     = false;
            TensileStrength = false;
            WaterImmersion  = false;
            ZDT             = false;

            AllDates  = false;
            StartDate = null;
            EndDate   = null;
            AllDatesChk();

            SelectedEmployees.Clear();
            EmployeeSelectAll = true;

            SelectedDepartments.Clear();
            DepartmentSelectAll = true;

            SelectedFunctions.Clear();
            FunctionSelectAll = true;

            NotifyOfPropertyChange(() => CanPrint);
            NotifyOfPropertyChange(() => CanReset);
        }
Exemple #2
0
 public void RemoveSampleNo()
 {
     AvailableDepartments.Add(SelectedDepartmentToRemove);
     SelectedDepartments.Remove(SelectedDepartmentToRemove);
     NotifyOfPropertyChange(() => SelectedDepartments);
     NotifyOfPropertyChange(() => CanPrint);
     NotifyOfPropertyChange(() => CanReset);
 }
Exemple #3
0
 public void AddDepartment()
 {
     SelectedDepartments.Add(SelectedDepartmentToAdd);
     AvailableDepartments.Remove(SelectedDepartmentToAdd);
     NotifyOfPropertyChange(() => SelectedDepartments);
     NotifyOfPropertyChange(() => CanPrint);
     NotifyOfPropertyChange(() => CanReset);
 }
Exemple #4
0
        private void OnNotSelectedDepartmentDoubleClickCommand()
        {
            var department = SelectedNotSelectedDepartment;

            if (department == null)
            {
                return;
            }
            NotSelectedDepartments.Remove(department);
            SelectedDepartments.Add(department);
            RaisePropertyChanged(() => SelectedDepartments);
            RaisePropertyChanged(() => NotSelectedDepartments);
        }
Exemple #5
0
 /// <summary>
 /// sets the returnparameter before closing
 /// </summary>
 /// <param name="window"></param>
 private void OnApplyCommand(Window window)
 {
     ReturnParameter             = Parameter;
     ReturnParameter.Buildings   = SelectedBuildings.ToList();
     ReturnParameter.Departments = SelectedDepartments.ToList();
     ReturnParameter.ItemStates  = SelectedItemStates.ToList();
     ReturnParameter.ItemNatures = SelectedItemNatures.ToList();
     ReturnParameter.ItemTypes   = SelectedItemTypes.ToList();
     ReturnParameter.Locations   = SelectedLocations.ToList();
     ReturnParameter.Sections    = SelectedSections.ToList();
     ReturnParameter.Floors      = SelectedFloors.ToList();
     window.DialogResult         = true;
     window.Close();
 }
Exemple #6
0
        public void Print()
        {
            DateTime?startDate;
            DateTime?endDate;
            string   empoloyees;
            string   departments;
            string   functions;

            startDate   = StartDate;
            endDate     = EndDate;
            empoloyees  = String.Join(", ", SelectedEmployees.Select(o => o.Id));
            departments = String.Join(", ", SelectedDepartments.Select(o => o.Id));
            functions   = String.Join(", ", SelectedFunctions.Select(o => o.Id));

            ReportResults = new BindableCollection <ReportResultsModel>(GlobalConfig.Connection.GetReportResults(startDate, endDate, empoloyees, departments, functions));


            //EventAggregationProvider.OutTurnEventAggregator.PublishOnUIThread(ReportResults);

            GetReportToPrint();

            manager.ShowDialog(new ReportShowViewModel(ReportResults, reportName), null, null);
        }
Exemple #7
0
        /// <summary>
        /// Initialization
        /// </summary>
        /// <returns></returns>
        protected override async Task InitializeAsync()
        {
            try
            {
                IsLoading = true;

                if (Parameter != null)
                {
                    SelectedBuildings   = new ObservableCollection <BuildingDto>(Parameter.Buildings);
                    SelectedDepartments = new ObservableCollection <DepartmentDto>(Parameter.Departments);
                    SelectedFloors      = new ObservableCollection <FloorDto>(Parameter.Floors);
                    SelectedItemNatures = new ObservableCollection <ItemNatureDto>(Parameter.ItemNatures);
                    SelectedItemStates  = new ObservableCollection <ItemStateDto>(Parameter.ItemStates);
                    SelectedItemTypes   = new ObservableCollection <ItemTypeDto>(Parameter.ItemTypes);
                    SelectedLocations   = new ObservableCollection <LocationDto>(Parameter.Locations);
                    SelectedSections    = new ObservableCollection <SectionDto>(Parameter.Sections);
                }
                else
                {
                    SelectedBuildings   = new ObservableCollection <BuildingDto>();
                    SelectedDepartments = new ObservableCollection <DepartmentDto>();
                    SelectedFloors      = new ObservableCollection <FloorDto>();
                    SelectedItemNatures = new ObservableCollection <ItemNatureDto>();
                    SelectedItemStates  = new ObservableCollection <ItemStateDto>();
                    SelectedItemTypes   = new ObservableCollection <ItemTypeDto>();
                    SelectedLocations   = new ObservableCollection <LocationDto>();
                    SelectedSections    = new ObservableCollection <SectionDto>();
                }

                var buildingList = await _buildingApiService.GetAll();

                var departmentList = await _departmentApiService.GetAll();

                var floorList = await _floorApiService.GetAll();

                var itemNatureList = await _itemNatureApiService.GetAll();

                var itemStateList = await _itemStateApiService.GetAll();

                var itemTypeList = await _itemTypeApiService.GetAll();

                var locationList = await _locationApiService.GetAll();

                var sectionList = await _sectionApiService.GetAll();

                if (buildingList != null)
                {
                    var buildings = buildingList.Where(building => SelectedBuildings.FirstOrDefault(building2 => building.Id == building2.Id) == null).ToList();
                    NotSelectedBuildings = new ObservableCollection <BuildingDto>(buildings);
                }
                if (departmentList != null)
                {
                    var departments = departmentList.Where(department => SelectedDepartments.FirstOrDefault(department2 => department.Id == department2.Id) == null).ToList();
                    NotSelectedDepartments = new ObservableCollection <DepartmentDto>(departments);
                }
                if (floorList != null)
                {
                    var floors = floorList.Where(floor => !SelectedFloors.Contains(floor)).ToList();
                    NotSelectedFloors = new ObservableCollection <FloorDto>(floors);
                }
                if (itemNatureList != null)
                {
                    var itemNatures = itemNatureList.Where(itemNature => SelectedItemNatures.FirstOrDefault(itemNature2 => itemNature.Id == itemNature2.Id) == null).ToList();
                    NotSelectedItemNatures = new ObservableCollection <ItemNatureDto>(itemNatures);
                }
                if (itemStateList != null)
                {
                    var itemStates = itemStateList.Where(itemState => SelectedItemStates.FirstOrDefault(itemState2 => itemState.Id == itemState2.Id) == null).ToList();
                    NotSelectedItemStates = new ObservableCollection <ItemStateDto>(itemStates);
                }
                if (itemTypeList != null)
                {
                    var itemTypes = itemTypeList.Where(itemType => SelectedItemTypes.FirstOrDefault(itemType2 => itemType.Id == itemType2.Id) == null).ToList();
                    NotSelectedItemTypes = new ObservableCollection <ItemTypeDto>(itemTypes);
                }
                if (locationList != null)
                {
                    var locations = locationList.Where(location => SelectedLocations.FirstOrDefault(location2 => location.Id == location2.Id) == null).ToList();
                    NotSelectedLocations = new ObservableCollection <LocationDto>(locations);
                }
                if (sectionList != null)
                {
                    var sections = sectionList.Where(section => SelectedSections.FirstOrDefault(section2 => section.Id == section2.Id) == null).ToList();
                    NotSelectedSections = new ObservableCollection <SectionDto>(sections);
                }
            }
            catch (Exception e)
            {
                _loggingService.LogFatal("Error during Initalization!", e);
                _dialogService.ShowError(e.Message);
            }
            finally
            {
                IsLoading = false;
            }
        }