Example #1
0
        public StockKeepUnitVm GetStockKeepUnit(Expression <Func <StockKeepUnit, bool> > filterPredicate = null)
        {
            StockKeepUnit   stockKeepUnit   = _uow.Repository <StockKeepUnit>().Get(filterPredicate, false, null);
            StockKeepUnitVm stockKeepUnitVm = Mapper.Map <StockKeepUnitVm>(stockKeepUnit);

            return(stockKeepUnitVm);
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            stockKeepUnit = (StockKeepUnit)e.Parameter;

            CodeTb.Text            = stockKeepUnit.Code;
            DescriptionTb.Text     = stockKeepUnit.Description;
            QuantityPerUnitTb.Text = stockKeepUnit.QuantityPerUnit.ToString();

            dbCtx.StockKeepUnits.Attach(stockKeepUnit);
        }
Example #3
0
        private async void SaveUnitButton_Click(object sender, RoutedEventArgs e)
        {
            using (DBContext dBCtx = new DBContext())
            {
                var quantity = Convert.ToDouble(QuantityPerUnitTb.Text);
                if (quantity == 0 || String.IsNullOrEmpty(CodeTb.Text))
                {
                    MessageDialog message = new MessageDialog("Nie uzupełniono wszystkich pól.", "Operacja przerwana");
                    await message.ShowAsync();

                    return;
                }

                StockKeepUnit stockKeepUnit = new StockKeepUnit(CodeTb.Text, DescriptionTb.Text, quantity);
                dBCtx.StockKeepUnits.Add(stockKeepUnit);
                dBCtx.SaveChanges();
                this.Frame.Navigate(typeof(MainPage), "BackToUnitsList");
            }
        }
Example #4
0
        private void UnitsList_Tapped(object sender, TappedRoutedEventArgs e)
        {
            StockKeepUnit stockKeepUnit = UnitsList.SelectedItem as StockKeepUnit;

            Frame.Navigate(typeof(DetailsEditUnitsPage), stockKeepUnit);
        }