public async void SetManifest(manifestoutgoing manifest)
        {
            Source.Clear();
            this._manifest = manifest;
            var stt = _manifest.PackingList.GroupBy(O => O.PenjualanId).ToList();

            foreach (var item in stt)
            {
                var result = await MainVM.PenjualanCollection.GetItemById(item.Key);

                if (result != null)
                {
                    var detail = from b in item.ToList()
                                 join c in result.Details on b.CollyNumber equals c.CollyNumber
                                 select c;

                    var newItem = new Models.ManifestView();
                    newItem.STT         = string.Format("{0:D5}", result.STT);
                    newItem.Code        = _manifest.Code;
                    newItem.PortType    = manifest.PortType.ToString();
                    newItem.PayType     = result.PayType;
                    newItem.Pcs         = item.Count();
                    newItem.WeightView  = detail.Sum(O => O.Weight);
                    newItem.ShiperName  = MainVM.CustomerCollection.Source.Where(O => O.Id == result.ShiperID).FirstOrDefault().Name;
                    newItem.ReciverName = MainVM.CustomerCollection.Source.Where(O => O.Id == result.ReciverID).FirstOrDefault().Name;
                    newItem.AgentName   = _manifest.Agent.Name;
                    newItem.CreatedDate = _manifest.CreatedDate;
                    Source.Add(newItem);
                }
            }
            SourceView.Refresh();
        }
Esempio n. 2
0
        private async void LoadData(DateTime startDate, DateTime endDate)
        {
            try
            {
                if (IsBusy)
                {
                    return;
                }

                IsBusy = true;

                context = new DataAccessLayer.Bussines.SMUBussines();
                List <SMU> datas = await context.GetSMU(startDate, endDate);

                Source.Clear();
                foreach (var item in datas)
                {
                    Source.Add(item);
                }
                SourceView.Refresh();
            }
            catch (Exception ex)
            {
                Helpers.ShowErrorMessage(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async void RefreshAction(object obj)
        {
            await Task.Delay(1000);

            try
            {
                if (IsBusy)
                {
                    return;
                }
                IsBusy = true;
                Source.Clear();
                var result = await PengaduanService.GetItemsAsync();

                foreach (var item in result)
                {
                    if (item.Petugas != null && !string.IsNullOrEmpty(item.Petugas.Nama))
                    {
                        item.ShowPetugas = true;
                    }
                    Source.Add(item);
                }
            }
            catch (Exception ex)
            {
                Helpers.ShowMessageError(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
Esempio n. 4
0
        private async void LoadData()
        {
            try
            {
                this.CreatedDate = DateTime.Now;
                //var scedules = await scheduleBussines.GetSchedules(DateTime.Now);
                //foreach (var item in scedules.Where(O => !O.Complete))
                //{
                //  this.SourceSchedules.Add(item);
                //}
                var data = await context.GetSMUForCreateManifest();

                foreach (var item in data)
                {
                    item.PropertyChanged += Item_PropertyChanged;
                    Source.Add(item);
                }
            }
            catch (Exception EX)
            {
                Helpers.ShowErrorMessage(EX.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
 /// <summary>
 /// Creates a new <see cref="UserGuideSubPageViewModel"/>
 /// </summary>
 public UserGuideSubPageViewModel()
 {
     foreach (UserGuideSection section in UserGuideSections.Span)
     {
         Source.Add(new ObservableGroup <UserGuideSection, UserGuideSection>(section, new[] { section }));
     }
 }
Esempio n. 6
0
        private async void LoadData(DateTime startDate, DateTime endDate)
        {
            try
            {
                if (IsBusy)
                {
                    return;
                }

                IsBusy = true;
                var result = await ptiContext.GetPTIFromTo(StartDate, EndDate);

                await Task.Delay(500);

                Source.Clear();
                foreach (var item in result)
                {
                    Source.Add(item);
                }
                SourceView.Refresh();
            }
            catch (Exception ex)
            {
                Helpers.ShowMessage(ex.Message);
            }finally
            {
                IsBusy = false;
            }
        }
Esempio n. 7
0
        private void PrepareSources()
        {
            if (Source.Count == 0)
            {
                Source.Add(".");
            }

            for (int i = 0; i < Source.Count; i++)
            {
                if (IsDirectory(Source[i]))
                {
                    //destination is current directory
                    if (string.IsNullOrWhiteSpace(Source[i]) || Source[i] == ".")
                    {
                        Source[i] = Directory.GetCurrentDirectory();
                    }

                    // not a UNC Path
                    if (!Source[i].StartsWith(@"\\"))
                    {
                        Source[i] = Path.GetFullPath(Source[i]);
                    }
                }
            }
        }
Esempio n. 8
0
        public override void Add(TSinkEdge edge)
        {
            Sink.Add(edge);
            var edgeTwo = (TSourceEdge)Mapper.TryGetCreate(edge);

            Source.Add(edgeTwo);
        }
Esempio n. 9
0
        public void OnSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action != NotifyCollectionChangedAction.Add || e.NewItems == null)
            {
                return;
            }

            if (Source == null)
            {
                Source = new WMSBusinessCollection <Entity2GC>();
            }

            foreach (var item in e.NewItems)
            {
                if (item == null)
                {
                    continue;
                }

                if (Source == null)
                {
                    continue;
                }
                var newItem = new Entity2GC
                {
                    ENTITY2GCKEY = ((WMSBusinessObject)item).GetKey().ToString()
                };

                Source.Add(newItem);
                ChildSource.Add((WMSBusinessObject)item);
            }
        }
Esempio n. 10
0
 public override void Add(TEdge edge)
 {
     if (EdgeFilter(edge))
     {
         Source.Add(edge);
     }
 }
Esempio n. 11
0
 public ChartViewModel()
 {
     foreach (var item in SampleDataService.GetChartSampleData())
     {
         Source.Add(item);
     }
 }
Esempio n. 12
0
        public async void LoadData(DateTime start, DateTime end)
        {
            try
            {
                if (IsBusy)
                {
                    return;
                }

                IsBusy = true;
                var result = await context.GetManifest(start, end);

                Source.Clear();
                foreach (var item in result)
                {
                    Source.Add(item);
                }

                SourceView.Refresh();
            }
            catch (Exception ex)
            {
                Helpers.ShowErrorMessage(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Adds data to SubGraph and data
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public virtual ICollection <TItem> Add(IEnumerable <TItem> elements)
        {
            var worker = new WalkerWorker1 <TItem, TEdge> (this.Sink);

            foreach (var item in elements)
            {
                if (item is TEdge)
                {
                    if (!Source.Contains((TEdge)item))
                    {
                        Source.Add((TEdge)item);
                    }
                }
                else if (!Source.Contains(item))
                {
                    Source.Add(item);
                }

                worker.Add(item);
            }

            CommitAdd(worker);

            return(worker.Affected);
        }
Esempio n. 14
0
 public void AddInput(string table, CompositeKey p)
 {
     Source.Add(table, new HashSet <CompositeKey>()
     {
         p
     });
 }
Esempio n. 15
0
        private void SetDetailsToNewCollie(List <ModelsShared.Models.Colly> details)
        {
            var config = new ApplicationConfig();

            Source.Clear();
            foreach (var item in details)
            {
                var data = new Newcolly()
                {
                    TypeOfWeight = item.TypeOfWeight,
                    CollyNumber  = item.CollyNumber,
                    Id           = item.Id,
                    IsSended     = item.IsSended,
                    PenjualanId  = item.Id,
                    Weight       = item.Weight,
                    Wide         = item.Wide,
                    Hight        = item.Hight,
                    Longer       = item.Longer,
                    WeightVolume = config.DevideWeightVolume,
                    Jumlah       = 1,
                };
                Source.Add(data);
                item.PropertyChanged += (x, y) => { CalculateTotal(); };
            }

            SourceView.Refresh();
        }
Esempio n. 16
0
 public override void Add(TItem item)
 {
     if (ItemFilter(item))
     {
         Source.Add(item);
     }
 }
 public new void Add(TTarget item)
 {
     _suppressSourceCollectionChanged = true;
     Source.Add(_inverseSelector(item));
     _suppressSourceCollectionChanged = false;
     base.Add(item);
     RaiseCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, Count - 1));
 }
Esempio n. 18
0
 /// <summary>Inserts the libraries to collection.</summary>
 /// <param name="libraries">The libraries.</param>
 private void InsertLibrariesToCollection(Library[] libraries)
 {
     foreach (var lib in libraries)
     {
         Source.Add(lib);
     }
     SourceCopy = Source;
 }
Esempio n. 19
0
 public void Record(Image <Bgr, Byte> img)
 {
     Source.Add(img.Convert <Gray, Byte>().PyrDown().PyrUp());
     while (Source.Count > FrameLen + 1)
     {
         Source.RemoveAt(0);
     }
 }
        private void OnSurveyWizardSurveyPointReceived(object sender, EventArgs e)
        {
            ++_totalPointsCount;
            FirstStatusMessage = "Total Points Count: " + _totalPointsCount;
            var source = SurveyWizard.LastSurveyPoint;
            var output = SurveyWizard.Calibrate().Transformer.Transform(source);

            Source.Add(new SurveyPointPair(_totalPointsCount, source, output));
        }
Esempio n. 21
0
        private void GetData()
        {
            Source.Clear();
            var data = new SubjectService().Get();

            foreach (var item in data)
            {
                Source.Add(item);
            }
        }
Esempio n. 22
0
        public async Task <Manifestoutgoing> Add(Manifestoutgoing item)
        {
            var result = await client.PostAsync <Manifestoutgoing>("", item);

            if (result != null)
            {
                Source.Add(result);
            }
            return(result);
        }
        protected override void Act()
        {
            ConfigurationSourceHandler.DoEnsurePropagatingSectionChangeEvents(SubordinateSource1Name, "Section1");
            ConfigurationSourceHandler.DoEnsurePropagatingSectionChangeEvents(SubordinateSource1Name, "Section2");

            Source.Remove(ConfigurationSourceSection.SectionName);
            Source.Add(ConfigurationSourceSection.SectionName, new ConfigurationSourceSection {
            });
            ConfigurationSourceHandler.DoPublicRefresh();
        }
Esempio n. 24
0
        private async void LoadOutOfManifestData(int id)
        {
            var data = await context.GetSMUOutOfManifest(id);

            Source.Clear();
            foreach (var item in data)
            {
                Source.Add(item);
            }
        }
Esempio n. 25
0
        public override void Add(TSinkItem item)
        {
            if (item == null)
            {
                return;
            }
            Sink.Add(item);
            var itemTwo = Mapper.TryGetCreate(item);

            Source.Add(itemTwo);
        }
        private async void Init()
        {
            ItemClickCommand = new RelayCommand <SampleOrder>(OnItemClick);

            var datas = await SampleDataService.GetContentGridDataAsync();

            foreach (var item in datas)
            {
                Source.Add(item);
            }
        }
        private void UnSelect()
        {
            T tmp = SelectedSelected;

            SelectedItems.Remove(tmp);
            Source.Add(tmp);
            if (UnSelected != null)
            {
                UnSelected(this, new UnSelectedEventArgs(tmp));
            }
        }
        public async Task <IActionResult> Post([FromBody] ValueDto dto)
        {
            if (string.IsNullOrEmpty(dto.Message))
            {
                return(BadRequest());
            }
            Source.Add(dto);
            await Context.Clients.All.SendAsync("Add", dto);

            return(Ok(dto));
        }
Esempio n. 29
0
        internal async Task <Port> Add(Port port)
        {
            var result = await client.PostAsync <Port>("", port);

            if (result != default(Port))
            {
                Source.Add(result);
                SourceView.Refresh();
            }
            return(result);
        }
Esempio n. 30
0
        public async Task <Ship> Add(Ship item)
        {
            var result = await client.PostAsync <Ship>("Post", item);

            if (result != default(Ship))
            {
                Source.Add(result);
                SourceView.Refresh();
            }
            return(result);
        }