internal async void GetPenjualan() { if (this.PortType != PortType.None) { this.PenjualanTemporaty.Clear(); OriginView.Refresh(); DestinationView.Refresh(); this.PenjualanTemporaryView.Refresh(); this.SourceFromDatabase = new List <Models.PenjualanView>(); if (this.AgentId > 0 && this.PortType != ModelsShared.Models.PortType.None) { var result = await Common.ResourcesBase.GetMainWindowViewModel().PenjualanCollection.GetByParameter(new manifestoutgoing { AgentId = this.AgentId, PortType = this.PortType }); var customers = Common.ResourcesBase.GetMainWindowViewModel().CustomerCollection.Source; if (result != null && customers != null) { var a = from r in result select new Models.PenjualanView { Id = r.Id, STT = r.STT, Details = r.Details, Shiper = r.Shiper, Reciver = r.Reciver }; this.SourceFromDatabase.Clear(); foreach (var item in a) { this.SourceFromDatabase.Add(item); } } } } }
/// <summary> /// /// </summary> /// <param name="action"></param> private void SelectView(string action) { PropertyView newView = null; switch(action) { case "Source Properties": newView = new SourceView(this._component); break; case "Code Expression Repository": newView = new ExpressionRepositoryView(this._component); break; case "Equation Repository": newView = new EquationRepositoryView(this._component); break; case "Destination Properties": newView = new DestinationView(this._component); break; } this.rightpanel.Controls.Add(newView); newView.Dock = DockStyle.Fill; if (_currentView != null) { _currentView.SaveData(); _currentView.Dispose(); _currentView = null; } _currentView = newView; _currentView.OnViewStatusChange +=new ViewStatusChangeHandler(_currentView_OnViewStatusChange); }
private void SetDestinationSource() { DestinationSource.Clear(); foreach (var item in PortCollection.Source) { if (Agent != null && Agent.CitiesCanAccess != null) { var CityCanAccess = Agent.CitiesCanAccess.Where(O => O.CityId == item.CityID).FirstOrDefault(); if (CityCanAccess != null) { DestinationSource.Add(item); } } } DestinationView.Refresh(); }