Exemplo n.º 1
0
        public static SWHelper Create(Supply supply)
        {
            SWHelper swHelper = new SWHelper();

            swHelper.Id            = supply.Id;
            swHelper.TName         = supply.TName;
            swHelper.OperationDate = supply.SupplyDate;

            swHelper.TSupply = supply;

            return(swHelper);
        }
 private void SupplyCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add &&
         e.NewItems != null)
     {
         for (int i = 0; i < e.NewItems.Count; i++)
         {
             Supply supply = e.NewItems[i] as Supply;
             add(SWHelper.Create(supply));
         }
     }
 }
 private void WriteoffCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add &&
         e.NewItems != null)
     {
         for (int i = 0; i < e.NewItems.Count; i++)
         {
             Writeoff writeoff = e.NewItems[i] as Writeoff;
             add(SWHelper.Create(writeoff));
         }
     }
 }
        private SWCollection()
        {
            //Добавление в соответствующих контроллерах
            SupplyController.instance().Collection.ToList().ForEach(x => add(SWHelper.Create(x)));
            WriteoffController.instance().Collection.ToList().ForEach(x => add(SWHelper.Create(x)));
            ViewSource        = new CollectionViewSource();
            ViewSource.Source = _collection;


            SupplyController.instance().Collection.CollectionChanged += SupplyCollectionChanged;
            WriteoffController.instance().Collection.CollectionChanged += WriteoffCollectionChanged;
        }
Exemplo n.º 5
0
        public static SWHelper Create(Writeoff writeoff)
        {
            SWHelper swHelper = new SWHelper();

            swHelper.Id            = writeoff.Id;
            swHelper.TName         = writeoff.TName;
            swHelper.OperationDate = writeoff.WriteoffDate;
            swHelper.AppNumber     = writeoff.AppNumber;
            swHelper.IdRecipient   = writeoff.IdRecipient;

            swHelper.TWriteoff = writeoff;

            return(swHelper);
        }
 public void add(Writeoff writeoff)
 {
     _collection.Add(SWHelper.Create(writeoff));
 }
 public void add(Supply supply)
 {
     _collection.Add(SWHelper.Create(supply));
 }
 public void add(SWHelper swHelper)
 {
     _collection.Add(swHelper);
 }