示例#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);
                }
            }
        }
示例#2
0
 public NewWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }
示例#3
0
 public RefreshWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }
示例#4
0
 public SaveWarehouse(Warehouses sender)
 {
     this.manager = sender;
 }