Ejemplo n.º 1
0
 public NewPart(Parts part, bool modifiable)
 {
     InitializeComponent();
     AppMessages.PartAdded.Register(this, p => this.Close());
     AppMessages.PartModified.Register(this, p => this.Close());
     var viewModel = new NewPart_ViewModel(part, modifiable);
     this.DataContext = viewModel;
 }
Ejemplo n.º 2
0
        void removePartExecute()
        {
            Parts p = new Parts();

            //p = SQLConnection.Execute.PartsTable.Single( pa => pa.partID == selectedPart.partID);
            //SQLConnection.Execute.PartsTable.DeleteObject(p);
            SQLConnection.Execute.SaveDb();
            RefreshParts();
        }
Ejemplo n.º 3
0
        private void PartModifiedActions(Parts p)
        {
            Parts modifiablePart = new Parts();

            //modifiablePart = SQLConnection.Execute.PartsTable.Single(part => part.partID == p.partID);
            modifiablePart.partName = p.partName;
            modifiablePart.partManufacturer = p.partManufacturer;
            modifiablePart.partIDNumber = p.partIDNumber;
            modifiablePart.partPrice = p.partPrice;
            modifiablePart.partQuantity = p.partQuantity;
            modifiablePart.mustOrder = p.mustOrder;
            SQLConnection.Execute.SaveDb();
            SetStatus();
            RefreshParts();
        }
Ejemplo n.º 4
0
 private void PartAddedActions(Parts p)
 {
     if (p.partID == null || p.partID == 0)
     {
         p.serviceID = _serviceID;
         p.partID = 0;
         //SQLConnection.Execute.PartsTable.AddObject(p);
         SQLConnection.Execute.SaveDb();
         SetStatus();
         RefreshParts();
     }
 }
Ejemplo n.º 5
0
 public static void Send(Parts p)
 {
     Messenger.Default.Send(p, MessageTypes.partModified);
 }
Ejemplo n.º 6
0
        public static PartRepresentation convertPart(Parts part)
        {
            PartRepresentation convertedPart = new PartRepresentation()
            {
                id = part.partID,
                mustOrder = part.mustOrder,
                partIDNumber = part.partIDNumber,
                partManufacturer = part.partManufacturer,
                partName = part.partName,
                partPrice = part.partPrice,
                partQuantity = part.partQuantity
            };

            return convertedPart;
        }