Exemplo n.º 1
0
        /// <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);
                }
            }
        }
Exemplo n.º 2
0
 public NewWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }
Exemplo n.º 3
0
 public RefreshWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }
Exemplo n.º 4
0
 public SaveWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }