/// <summary> /// Discard all the changes and read again from database file. /// </summary> public void Refresh() { //sort collection by name1 alphabetically Warehouses target = new Warehouses(); target = target.LoadFromFile() as Warehouses;// DatabaseObject.LoadFromFile() as Warehouses; if (target != null) { var hold = from f in target.Warehouse select f; List <Warehouse> temp = hold.OrderBy(f => f.Name1).ToList(); if (temp.Count > 0) { this.warehouseField.Clear(); //tips: don't use new it will break all the binding = new ObservableCollection<Warehouse>(); } foreach (Warehouse s in temp) { this.warehouseField.Add(s); } } }
public NewWarehouse(Warehouses sender) { this.manager = sender; }
public RefreshWarehouse(Warehouses sender) { this.manager = sender; }
public SaveWarehouse(Warehouses sender) { this.manager = sender; }