Ejemplo n.º 1
0
        public EditInventory(Inventory inventory)
        {
            InitializeComponent();

            EditInventoryModel context = new EditInventoryModel();

            this.DataContext = context;
            PutInventoryToContext(inventory);
            OldInventory = inventory;
        }
Ejemplo n.º 2
0
        private Inventory GetInventoryFromContext()
        {
            EditInventoryModel context = this.DataContext as EditInventoryModel;

            return(new Inventory
            {
                Number = context.Number,
                Object = context.ObjectName,
                InDate = context.InDate,
                Price = context.Price,
                Repack = context.Repack
            });
        }
Ejemplo n.º 3
0
        private void PutInventoryToContext(Inventory inventory)
        {
            EditInventoryModel context = this.DataContext as EditInventoryModel;

            context.Number     = inventory.Number;
            context.ObjectName = inventory.Object;
            context.InDate     = inventory.InDate;
            context.Price      = inventory.Price;
            context.Repack     = inventory.Repack;
            if (InventoryId == null)
            {
                InventoryId = inventory.Id;
            }
        }