void CurrentPartViewModel_PartUpdated(object sender, PartEventArgs e)
        {
            if (!e.IsNew)
            {
                Part part = _parts.Where(item => item.Id == e.Part.Id).FirstOrDefault();
                if (part != null)
                {
                    part.Id = e.Part.Id;
                    part.ComponentsCost = e.Part.ComponentsCost;
                    part.OwnCost = e.Part.OwnCost;
                    part.Description = e.Part.Description;
                    part.IsOwnMake = e.Part.IsOwnMake;
                    part.Length = e.Part.Length;
                    part.Number = e.Part.Number;
                    part.Type = e.Part.Type;
                    part.Notes = e.Part.Notes;
                }
            }
            else
                _parts.Add(e.Part);

            CurrentPartViewModel = null;
        }
        void CurrentPartViewModel_PartUpdated(object sender, PartEventArgs e)
        {
            if (!e.IsNew)
            {
                //Part stock = _stocks.Single(item => item.Id == e.Part.Id);
                //if (stock != null)
                //{
                //    stock.Type = e.Part.Type;
                //    stock.Number = e.Part.Number;
                //    stock.Description = e.Part.Description;
                //    stock.IsOwnMake = e.Part.IsOwnMake;
                //    stock.Length = e.Part.Length;
                //    stock.OwnCost = e.Part.OwnCost;
                //    stock.ComponentsCost = e.Part.ComponentsCost;
                //    stock.Count = e.Part.Count;
                //    stock.CountDate = e.Part.CountDate;
                //    stock.OnOrder = e.Part.OnOrder;
                //    stock.Notes = e.Part.Notes;
                //}
            }
            else
            {
                //_stocks.Add(new Part(e.Part));
            }

            CurrentPartViewModel = null;
        }
Esempio n. 3
0
 private void OnPartUpdated(object sender, Support.PartEventArgs e)
 {
     Close();
 }