private void NewInwardEntry() { if (InwardDetails.Count > 0 && InwardSummary.InwardNo == 0) { MessageBoxResult result = System.Windows.MessageBox.Show("Are you sure you want to create New Inward?", "Warning Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.No); if (result == MessageBoxResult.No || result == MessageBoxResult.Cancel) { return; } } InwardDetails.Clear(); InwardSummary.Clear(); Add(); }
public InwardViewModel() { InwardSummary = new InwardSummary(); InwardDetails = new ObservableCollection <InwardDetail>(); //InwardDetails.Add(new InwardEntity{ BarCodeId ="1",ProductId=1,Dated=DateTime.Now,ProductName="xyz",Quantity=10}); //InwardDetails.Add(new InwardEntity { BarCodeId = "2", ProductId = 3, Dated = DateTime.Now.AddDays(1), ProductName = "lmn", Quantity = 101 }); OrderRepository orderRepository = new OrderRepository(); InwardDetail = new InwardDetail(); Product = new Product(); //Products = new ObservableCollection<Product>(); Products = new ObservableCollection <Product>(orderRepository.getProductList()); Products.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Products_CollectionChanged); Add(); }