コード例 #1
0
        public void onDeleteSalesOrderLine(SalesOrderLine line)
        {
            if (line != null)
            {
                MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure you wish to delete this item?", "Confirm Delete", System.Windows.MessageBoxButton.YesNo);

                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    int salesOrderLineid = line.salesOrderLinesID;
                    SalesOrderLine lineToRemove = (SalesOrderLine)SalesOrderLines.Single(p => p.salesOrderLinesID == salesOrderLineid);

                    db.SalesOrderLines.Remove(lineToRemove);
                    db.SaveChanges();
                    SalesOrders = UpdateSalesOrdersCollection(SalesOrders);
                }
            }
        }
コード例 #2
0
        public void onAddSalesOrderLine(SalesOrderLine line)
        {
            var newSalesOrderLine = line;

            if (newSalesOrderLine != null)
                NewSalesOrder.SalesOrderLines.Add(newSalesOrderLine);
        }