public void Loaded()
        {
            _uow = new SainaDbContext();
            var x = _uow.RelatedPeople.ToList();

            RelatedPersons = new QueryableCollectionView(x);
        }
Ejemplo n.º 2
0
        private async void DoSearchTans(object obj)
        {
            try
            {
                WorkInProgress = true;
                BatchTansView  = null;
                TotalTans      = 0;
                BatchTans      = new ObservableCollection <BatchTanVM>();
                BatchTans.CollectionChanged += BatchTans_CollectionChanged;
                if (FromBatch != null && ToBatch != null && FromCategory != null)
                {
                    var result = await RestHub.TansBetweenBatches(FromBatch.Name, ToBatch.Name, (int)FromCategory.Value);

                    if (result.HttpCode == System.Net.HttpStatusCode.OK)
                    {
                        var tans = (List <BatchTanDto>)result.UserObject;
                        foreach (var tan in tans)
                        {
                            BatchTans.Add(new BatchTanVM
                            {
                                Id          = tan.Id,
                                BatchNum    = tan.BatchNumber,
                                TanNumber   = tan.TanNumber,
                                TanCategory = new TanCategoryVM {
                                    Value = (int)tan.TanCategory, Description = tan.TanCategory.DescriptionAttribute()
                                },
                                TanType       = tan.TanType,
                                Nums          = tan.Nums,
                                Rxns          = tan.Rxns,
                                Stages        = tan.Stages,
                                Curator       = tan.Curator,
                                Reviewer      = tan.Reviewer,
                                QC            = tan.QC,
                                IsDoubtRaised = tan.IsDoubtRaised.ToString(),
                                TanState      = tan.TanState
                            });
                        }
                        BatchTansView = new QueryableCollectionView(BatchTans);
                    }
                    else
                    {
                        AppErrorBox.ShowErrorMessage(result.StatusMessage, result.HttpResponse);
                    }
                }
                else
                {
                    MessageBox.Show("From Batch, To Batch, Category Are Required . .");
                }
                UpdateSummary(BatchTans);
            }
            catch (Exception ex)
            {
                Log.This(ex);
                AppErrorBox.ShowErrorMessage("Error while searching TANs", ex.ToString());
            }
            finally
            {
                WorkInProgress = false;
            }
        }
Ejemplo n.º 3
0
        public void LoadTLs()
        {
            _uow = new SainaDbContext();

            _allGLs = _uow.GLs.Where(x => x.Status == true).ToList();
            GLs     = new ObservableCollection <GL>(_allGLs);
            var SystemAccountingSettingModel = AutoMapper.Mapper.Map <SystemAccountingSettingModel, EditableSystemAccountingSettingModel>(_systemAccountingSettingsService.GetSystemAccountingSettingModel());

            int.TryParse(SystemAccountingSettingModel.TLLength, out int SystemAccountingSettingModelTLLength);
            if (SystemAccountingSettingModelTLLength == 0)
            {
                Error?.Invoke(".تنظیمات حسابداری انجام نشده است");
                EnableTab = false;
            }

            else
            {
                EnableTab = true;
                var temp = _uow.TLs.Include(y => y.GL).ToList();
                foreach (var item in temp)
                {
                    item.PropertyChanged += TLListViewModel_PropertyChanged;
                }
                TLs = new QueryableCollectionView(temp);
                TLs.CollectionChanged += TLs_CollectionChanged;
            }
        }
        public void Loaded()
        {
            _uow = new SainaDbContext();
            var x = _uow.Attachments.ToList();

            Attachments = new QueryableCollectionView(x);
        }
Ejemplo n.º 5
0
        private void ClearTans()
        {
            try
            {
                BatchTans     = null;
                BatchTansView = null;
                TotalTans     = 0;
                ExtraStages   = 0;
                NotAssigned   = 0;
                ZeroRXNs      = 0;

                CurationAssigned = 0;
                CurationProgress = 0;
                ReviewAssigned   = 0;
                ReviewProgress   = 0;
                QCAssigned       = 0;
                QCProgress       = 0;
                QCCompleted      = 0;

                RXNCurationAssigned = 0;
                RXNCurationProgress = 0;
                RXNReviewAssigned   = 0;
                RXNReviewProgress   = 0;
                RXNQCAssigned       = 0;
                RXNQCProgress       = 0;
                RXNQCCompleted      = 0;
            }
            catch (Exception ex)
            {
                Log.This(ex);
            }
        }
Ejemplo n.º 6
0
        public void Loaded()
        {
            SystemAccountingSettingModel = AutoMapper.Mapper.Map <SystemAccountingSettingModel, EditableSystemAccountingSettingModel>(_systemAccountingSettingsService.GetSystemAccountingSettingModel());

            int.TryParse(SystemAccountingSettingModel.DLLength, out int SystemAccountingSettingModelDLLength);
            SystemAccountingSettingModelDLLength1 = SystemAccountingSettingModelDLLength;
            if (SystemAccountingSettingModelDLLength == 0)
            {
                DialogParameters parameters = new DialogParameters();
                parameters.OkButtonContent = "بستن";
                parameters.Header          = "!اخطار";
                parameters.Content         = "تنظیمات حسابداری انجام نشده است";
                RadWindow.Alert(parameters);
                EnableTab = false;
            }
            else if (SystemAccountingSettingModelDLLength > 0)
            {
                EnableTab = true;
            }
            else
            {
                EnableTab = true;
            }
            _uow = new SainaDbContext();
            DLss = new QueryableCollectionView(_uow.DLs.ToList());
        }
 /// <summary>
 /// 查询记录
 /// </summary>
 private void BtnSearch_Click(object sender)
 {
     ObservableCollection<AcquisitionSetting> source = new AcquisitionSettingBIZ().SelectAll();
     var pagedSource = new QueryableCollectionView(source);
     View.DGSelect.ItemsSource = pagedSource;
     View.searchDataPager.Source = pagedSource;
     View.DGSelect.SelectedItems.Remove(View.DGSelect.SelectedItem);//取消首行选中
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 查询记录
        /// </summary>
        private void BtnSearch_Click(object sender)
        {
            ObservableCollection <ZNC.DataEntiry.Equipment> source = new EquipmentBIZ().SelectAll();
            var pagedSource = new QueryableCollectionView(source);

            View.DGSelect.ItemsSource   = pagedSource;
            View.searchDataPager.Source = pagedSource;
            View.DGSelect.SelectedItems.Remove(View.DGSelect.SelectedItem);//取消首行选中
        }
Ejemplo n.º 9
0
        private void Orders_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            // RaisePropertyChanged("_airCompanies");
            QueryableCollectionView collectionViewSource = new QueryableCollectionView(AirOrdersModelSingleton.Instance.AirCompanyOrders.OrderBy(a => a.Name));

            _airCompanies = collectionViewSource;

            RaisePropertyChanged("AirCompanies");
        }
Ejemplo n.º 10
0
 public EnhancedComboContext(IEnumerable <Item> data)
 {
     _Items = new QueryableCollectionView(data);
     _Items.FilterDescriptors.Add(
         new FilterDescriptor(
             "Name",
             FilterOperator.Contains,
             _Text != null
             ? _Text
             : ""));
 }
Ejemplo n.º 11
0

        
Ejemplo n.º 12
0
        public IssuesBrowserViewModel(IList<JiraIssue> issues, IMessenger messenger)
        {
            Issues = new QueryableCollectionView(issues);
            _messenger = messenger;

            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(BindableRadGridView), new BindableGridViewPropertyProvider());

            SaveFiltersCommand = new RelayCommand(SaveGridState);
            LoadFiltersCommand = new RelayCommand(LoadGridState);
            ExportToConfluenceCommand = new RelayCommand(ExportAsConfluenceMarkupResults);
            PlainTextExportCommand = new RelayCommand(ExportAsTextResults);
            OpenScrumCardsCommand = new RelayCommand(OpenScrumCards);
        }
Ejemplo n.º 13
0
        public IssuesBrowserViewModel(IList <JiraIssue> issues, IMessenger messenger)
        {
            Issues     = new QueryableCollectionView(issues);
            _messenger = messenger;

            ServiceProvider.RegisterPersistenceProvider <ICustomPropertyProvider>(typeof(BindableRadGridView), new BindableGridViewPropertyProvider());

            SaveFiltersCommand        = new RelayCommand(SaveGridState);
            LoadFiltersCommand        = new RelayCommand(LoadGridState);
            ExportToConfluenceCommand = new RelayCommand(ExportAsConfluenceMarkupResults);
            PlainTextExportCommand    = new RelayCommand(ExportAsTextResults);
            OpenScrumCardsCommand     = new RelayCommand(OpenScrumCards);
        }
        public void Loaded()
        {
            _uow = new SainaDbContext();
            var ids = new List <int> {
                1, 3, 4, 5, 6
            };

            TypeDocuments          = _uow.TypeDocuments.Where(x => !ids.Contains(x.TypeDocumentId)).ToList();
            SLs                    = _uow.SLs.Where(x => x.Status == true).ToList();
            DLs                    = _uow.DLs.ToList();
            SLStandardDescriptions = _uow.SLStandardDescriptions.ToList();
            Currencies             = _uow.Currencies.ToList();

            AccDocumentHeaders = new QueryableCollectionView(_uow.AccDocumentHeaders.Include(x => x.AccDocumentItems.Select(s => s.SL)).Where(x => _uow.ShamsiToMiladi(x.DocumentDate, "Saal") == _appContextService.CurrentFinancialYear.ToString() &&
                                                                                                                                              (HeaderId == 0 || x.AccDocumentHeaderId == HeaderId) &&
                                                                                                                                              (TypeEnum == 0 || x.TypeDocumentId == TypeEnum)).OrderBy(x => x.DocumentNumber).ToList());


            _appContextService.PropertyChanged += (sender, eventArgs) =>
            {
                try
                {
                    if (eventArgs.PropertyName == "CurrentFinancialYear")
                    {
                        var dateDocument = _appContextService.CurrentFinancialYear;
                        ids = new List <int> {
                            1, 3, 4, 5, 6
                        };
                        TypeDocuments          = _uow.TypeDocuments.Where(x => !ids.Contains(x.TypeDocumentId)).ToList();
                        SLs                    = _uow.SLs.Where(x => x.Status == true).ToList();
                        DLs                    = _uow.DLs.ToList();
                        SLStandardDescriptions = _uow.SLStandardDescriptions.ToList();
                        Currencies             = _uow.Currencies.ToList();
                        // AccDocumentHeaders = new QueryableCollectionView(_uow.AccDocumentHeaders.Include(x => x.AccDocumentItems).Where(x => _uow.ShamsiToMiladi(x.DocumentDate, "Saal") == _appContextService.CurrentFinancialYear.ToString()).ToList());
                        AccDocumentHeaders = new QueryableCollectionView(_uow.AccDocumentHeaders.Include(x => x.AccDocumentItems.Select(s => s.SL)).Where(x => _uow.ShamsiToMiladi(x.DocumentDate, "Saal") == _appContextService.CurrentFinancialYear.ToString() &&
                                                                                                                                                          (HeaderId == 0 || x.AccDocumentHeaderId == HeaderId) &&
                                                                                                                                                          (TypeEnum == 0 || x.TypeDocumentId == TypeEnum)).OrderBy(x => x.DocumentNumber).ToList());
                    }
                }
                catch (Exception)
                { }
            };
            AccDocumentHeaders.CollectionChanged += AccDocumentHeaders_CollectionChanged;


            _uow.SaveChanges();
        }
        public void LoadRefresh()
        {
            _uow = new SainaDbContext();
            var ids = new List <int> {
                1, 3, 4, 5, 6
            };

            TypeDocuments          = _uow.TypeDocuments.Where(x => !ids.Contains(x.TypeDocumentId)).ToList();
            SLs                    = _uow.SLs.Where(x => x.Status == true).ToList();
            DLs                    = _uow.DLs.ToList();
            SLStandardDescriptions = _uow.SLStandardDescriptions.ToList();
            Currencies             = _uow.Currencies.ToList();
            AccDocumentHeaders     = new QueryableCollectionView(_uow.AccDocumentHeaders.Include(x => x.AccDocumentItems.Select(s => s.SL)).Where(x => _uow.ShamsiToMiladi(x.DocumentDate, "Saal") == _appContextService.CurrentFinancialYear.ToString()
                                                                                                                                                  ).ToList());
            AccDocumentHeaders.CollectionChanged += AccDocumentHeaders_CollectionChanged;
            _uow.SaveChanges();
        }
Ejemplo n.º 16
0
        public void LoadGLs()
        {
            _uow    = new SainaDbContext();
            _allGLs = _uow.Set <GL>().ToList();
            // _allGLs = _uow.Set<GL>().AsNoTracking().ToListAsync().ConfigureAwait(false);
            GLs = new QueryableCollectionView(_uow.GLs.ToList());
            SystemAccountingSettingModel = AutoMapper.Mapper.Map <SystemAccountingSettingModel, EditableSystemAccountingSettingModel>(_systemAccountingSettingsService.GetSystemAccountingSettingModel());

            int.TryParse(SystemAccountingSettingModel.GLLength, out int SystemAccountingSettingModelGLLength);
            if (_uow.GLs.Any())
            {
                LastGLCode = _uow.GLs.Select(x => x.GLCode).Max() + 1;
            }
            else
            {
                LastGLCode = 1;
            }

            LastGLLenght = (LastGLCode.ToString()).Length;
            Sum          = "0," + SystemAccountingSettingModelGLLength.ToString();
            //var lastSLCode = stringLastGLCode.ToString().PadLeft(SystemAccountingSettingModelSLLength - SystemAccountingSettingModelTLLength, '0');

            Regex = $"^[0-9]{{{Sum}}}$";
            if (SystemAccountingSettingModelGLLength == 0)
            {
                EnableTab = false;
                Error?.Invoke("تنظیمات حسابداری انجام نشده است");
            }
            else if (SystemAccountingSettingModelGLLength > 0 && LastGLLenght != SystemAccountingSettingModelGLLength)
            {
                EnableSave = false;
                EnableTab  = true;
            }
            else
            {
                EnableSave = true;
                EnableTab  = true;
            }
        }
 public void UpdateContacts()
 {
     this.selectedCompanyContacts = null;
     this.RaisePropertyChanged("SelectedCompanyContacts");
 }
        private void UpdateChartData(QueryableCollectionView qcv, SelectionRange<DateTime> selection)
        {
            qcv.FilterDescriptors.Clear();

            qcv.FilterDescriptors.Add(new FilterDescriptor("TimeStamp", FilterOperator.IsGreaterThanOrEqualTo, selection.Start));
            qcv.FilterDescriptors.Add(new FilterDescriptor("TimeStamp", FilterOperator.IsLessThanOrEqualTo, selection.End));
        }
Ejemplo n.º 19
0
 public void Handle(SearchForIssuesResponse message)
 {
     Issues = new QueryableCollectionView(message.SearchResults);
 }
Ejemplo n.º 20
0
 public void Loaded()
 {
     _uow          = new SainaDbContext();
     OtherProducts = new QueryableCollectionView(_uow.OtherProducts.ToList());
 }
        protected void GetDataCompleted(IEnumerable data)
        {
            this.TemperatureReports = data as List<TemperatureData>;

            QueryableCollectionView qcv = new QueryableCollectionView(data);
            this.UpdateChartData(qcv, this.Selection);
            this.FilteredTemperatureReports = qcv;
        }
Ejemplo n.º 22
0
 public void Loaded()
 {
     _uow             = new SainaDbContext();
     MeasurementUnits = new QueryableCollectionView(_uow.MeasurementUnits.ToList());
 }
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     this.activityToSelect = this.SelectedActivity;
     this.Activities = null;
 }
 public void Loaded()
 {
     _uow         = new SainaDbContext();
     ProductTypes = new QueryableCollectionView(_uow.ProductTypes.ToList());
 }
Ejemplo n.º 25
0
        //private InventoryControl _InventoryControl;
        //public InventoryControl InventoryControl
        //{
        //    get { return _InventoryControl; }
        //    set { SetProperty(ref _InventoryControl, value); }
        //}


        #endregion
        #region Methods
        public async void Loaded()
        {
            _uow                 = new SainaDbContext();
            Products             = new QueryableCollectionView(_uow.Products.ToList());
            _allMeasurementUnits = await _uow.MeasurementUnits.AsNoTracking().ToListAsync().ConfigureAwait(false);

            MeasurementUnits = new ObservableCollection <MeasurementUnit>(_allMeasurementUnits);
            _allStocks       = _uow.Stocks.AsNoTracking().ToList();
            Stocks           = new ObservableCollection <Stock>(_allStocks);
            var ShoppingSystemSettingModel = AutoMapper.Mapper.Map <ShoppingSystemSettingModel, EditableShoppingSystemSettingViewModel>(_shoppingSystemSettingsService.GetShoppingSystemSettingModel());

            int.TryParse(ShoppingSystemSettingModel.ProductCodeLenght, out int productCodeLenght);

            ProductCommunication  = ShoppingSystemSettingModel.ProductCommunication;
            ProductCodeLenght     = productCodeLenght;
            ProductTypeLenght     = int.Parse(ShoppingSystemSettingModel.ProductTypeLenght ?? "0");
            ProductBrandLenght    = int.Parse(ShoppingSystemSettingModel.ProductBrandLenght ?? "0");
            ProductModelLenght    = int.Parse(ShoppingSystemSettingModel.ProductModelLenght ?? "0");
            OtherProductLenght    = int.Parse(ShoppingSystemSettingModel.OtherProductLenght ?? "0");
            IranCodeProductLenght = int.Parse(ShoppingSystemSettingModel.IranCodeProduct ?? "0");
            NumberLevel           = int.Parse(ShoppingSystemSettingModel.NumberLevel ?? "0");
            BarcodeLenght         = int.Parse(ShoppingSystemSettingModel.Barcode ?? "0");
            string s = "0," + (ProductCodeLenght).ToString();

            Regex = $"^[0-9]{{{s}}}$";
            if (ProductCodeLenght == 0 ||
                ProductTypeLenght == 0 ||
                ProductBrandLenght == 0 ||
                ProductModelLenght == 0 ||
                OtherProductLenght == 0 ||
                IranCodeProductLenght == 0 ||
                NumberLevel == 0 ||
                BarcodeLenght == 0
                )
            {
                DialogParameters parameters = new DialogParameters();
                parameters.OkButtonContent = "بستن";
                parameters.Header          = "!اخطار";
                parameters.Content         = " تنظیمات بازرگانی خرید انجام نشده است";
                RadWindow.Alert(parameters);
                Error(" تنظیمات بازرگانی خرید انجام نشده است");
                EnableTab = false;
            }
            else
            {
                EnableTab = true;
            }

            if (ProductCommunication == "Yes")
            {
                EnableCodeText   = true;
                EnableCodeButton = true;
            }
            else
            {
                EnableCodeText   = false;
                EnableCodeButton = false;
            }

            //ProductBrands = _uow.ProductBrands.ToList();
        }