| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- <?xml version="1.0" encoding="utf-8" ?>
- <mobile:MobilePage
- xmlns:local="clr-namespace:PRS.Mobile"
- xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="PRS.Mobile.TransferModule"
- xmlns:material="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
- xmlns:views="http://xamarin.com/schemas/2020/toolkit"
- xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
- material:MaterialNavigationPage.AppBarColor="#a2006d"
- Title="Transfer Stock"
- x:DataType="local:TransferModuleViewModel"
- >
-
- <mobile:MobilePage.BindingContext>
- <local:TransferModuleViewModel x:Name="_viewModel" />
- </mobile:MobilePage.BindingContext>
-
- <mobile:MobilePage.Resources>
- <mobile:IntToBooleanConverter x:Key="SaveVisibleConverter" Value="2" Result="True"/>
- <mobile:IntToBooleanConverter x:Key="PhotoVisibleConverter" Value="1" Result="True"/>
- <mobile:IntToBooleanConverter x:Key="SaveEnabledConverter" Value="0" Result="False"/>
- <mobile:GuidToBooleanConverter x:Key="SearchVisibleConverter" EmptyValue="False"/>
- <mobile:StringWithDefaultValueConverter x:Key="FromConverter" Default="(Select)" />
- <mobile:StringWithDefaultValueConverter x:Key="ToConverter" Default="(Select)" />
- <mobile:ByteArrayToImageSourceConverter x:Key="ImageConverter"/>
- <mobile:GuidToBooleanConverter x:Key="GuidVisibleConverter"/>
-
- <local:TransactionDisplayConverter x:Key="TransactionDisplayConverter"/>
- <local:TransactionColorConverter x:Key="TransactionColorConverter"/>
-
- <DataTemplate x:Key="HoldingTemplate" x:DataType="local:StockHoldingShell">
- <ViewCell>
- <mobile:MobileCard
- BackgroundColor="{StaticResource Theme.Background}"
- Padding="0"
- Margin="0,0,0,5"
- IsClickable="True"
- Clicked="Holding_Clicked">
-
- <StackLayout Spacing="0" Orientation="Vertical">
- <Image
- Source = "{Binding Image, Converter={StaticResource ImageConverter}}"
- Aspect="AspectFit"
- HeightRequest="80"
- Margin="5,5,5,0"
- IsVisible="{Binding ImageID,Converter={StaticResource GuidVisibleConverter}}"/>
-
- <Label
- Text="{Binding ProductCode}"
- Margin="5,5,5,0"
- FontAttributes="Bold"
- FontSize="Small"
- HorizontalTextAlignment="Center"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- Text="{Binding ProductName}"
- Margin="5,5,5,0"
- FontSize="Micro"
- HorizontalTextAlignment="Center"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- Text="{Binding StyleDescription}"
- Margin="5,5,5,0"
- FontSize="Micro"
- HorizontalTextAlignment="Center"
- TextColor="{StaticResource Theme.OnBackground}"
- IsVisible="{Binding StyleID, Converter={StaticResource GuidVisibleConverter}}"/>
-
- <StackLayout
- Margin="5,5,5,0"
- Orientation="Horizontal"
- HorizontalOptions="Center"
- IsVisible="{Binding JobID, Converter={StaticResource GuidVisibleConverter}}">
-
- <Label
- Text="Job:"
- FontSize="Micro"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- Text="{Binding JobNumber}"
- FontSize="Micro"
- TextColor="{StaticResource Theme.OnBackground}" />
-
- </StackLayout>
-
- <StackLayout
- Margin="5,5,5,0"
- Orientation="Horizontal"
- HorizontalOptions="Center">
-
- <Label
- FontSize="Micro"
- Text="{Binding Units}"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- FontSize="Micro"
- Text="@"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- FontSize="Micro"
- Text="{Binding DimensionsUnitSize}"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- <Label
- FontSize="Micro"
- Text="{Binding Available, StringFormat='({0} avail.)'}"
- TextColor="{StaticResource Theme.OnBackground}"/>
-
- </StackLayout>
-
- <StackLayout
- Orientation="Vertical"
- Spacing="0"
- Margin="0,5,0,0"
- BindableLayout.ItemsSource="{Binding Transactions}">
- <BindableLayout.ItemTemplate>
- <DataTemplate x:DataType="local:StockTransaction" >
-
- <!-- <StackLayout Spacing="0" Orientation="Vertical" HorizontalOptions="Fill" Background="LightGreen"> -->
- <Grid RowSpacing="0" ColumnSpacing="5">
- <Grid.Background>
- <MultiBinding Converter="{StaticResource TransactionColorConverter}">
- <Binding Path="." />
- <Binding Source="{RelativeSource AncestorType={x:Type local:StockHoldingShell}}" Path="LocationID"/>
- </MultiBinding>
- </Grid.Background>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30" />
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="1"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <BoxView
- Grid.Row="0"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- BackgroundColor="Gray"/>
-
- <Label
- Grid.Row="1"
- Grid.Column="0"
- Text="{Binding Quantity}"
- HorizontalTextAlignment="Center"
- VerticalTextAlignment="Center"
- FontSize="8"
- TextColor="{StaticResource Theme.OnBackground}"
- Margin="0,2"/>
- <Label
- Grid.Row="1"
- Grid.Column="1"
- FontSize="8"
- TextColor="{StaticResource Theme.OnBackground}"
- HorizontalTextAlignment="Center"
- VerticalTextAlignment="Center"
- Margin="0,2">
- <Label.Text>
- <MultiBinding Converter="{StaticResource TransactionDisplayConverter}">
- <Binding Path="." />
- <Binding Source="{RelativeSource AncestorType={x:Type local:StockHoldingShell}}" Path="LocationID"/>
- </MultiBinding>
- </Label.Text>
- </Label>
- </Grid>
-
- </DataTemplate>
- </BindableLayout.ItemTemplate>
- </StackLayout>
-
- </StackLayout>
- </mobile:MobileCard>
- </ViewCell>
- </DataTemplate>
-
- <DataTemplate x:Key="TransactionTemplate" x:DataType="{x:Type local:StockTransaction}">
- <ViewCell>
- <Grid RowSpacing="0" ColumnSpacing="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="1"/>
- </Grid.RowDefinitions>
-
- <Image
- Grid.Row="0"
- Grid.Column="0"
- Source="{Binding Image, Converter={StaticResource ImageConverter}}"
- HeightRequest="40"
- WidthRequest="40"
- VerticalOptions="Center"
- Margin="5">
- <Image.GestureRecognizers>
- <TapGestureRecognizer Tapped="TransactionImage_Clicked" />
- </Image.GestureRecognizers>
- </Image>
-
- <mobile:MobileCard
- Grid.Row="0"
- Grid.Column="1"
- BorderColor="Transparent "
- BackgroundColor="Transparent"
- IsClickable="True"
- Clicked="Transaction_Clicked">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
-
- <Label
- Grid.Row="0"
- Grid.Column="0"
- Margin="5,5,5,2.5"
- VerticalTextAlignment="Center"
- Text="{Binding ProductDisplay}"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Body.Size}"/>
-
- <FlexLayout
- Grid.Row="1"
- Grid.Column="0"
- Margin="5,2.5,5,5"
- AlignItems="Start"
- JustifyContent="Start"
- HorizontalOptions="Fill">
- <Label
- Text="{Binding Quantity}"
- Margin="0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"/>
- <Label
- Text="From"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"/>
- <Label
- Text="{Binding Source.LocationCode}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding LocationChanged}"/>
- <Label
- Text="{Binding Source.StyleCode}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding StyleChanged}"/>
- <Label
- Text="{Binding Source.JobNumber}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding JobChanged}"/>
- <Label
- Text="To"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}" />
- <Label
- Text="{Binding Target.LocationCode}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding LocationChanged}"/>
- <Label
- Text="{Binding Target.StyleCode}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding StyleChanged}"/>
- <Label
- Text="{Binding Target.JobNumber}"
- Margin="2,0,0,0"
- TextColor="{StaticResource Theme.OnBackground}"
- FontSize="{StaticResource Theme.Text.Small.Size}"
- IsVisible="{Binding JobChanged}"/>
- </FlexLayout>
- </Grid>
- </mobile:MobileCard>
-
- <mobile:MobileMenuButton
- Grid.Row="0"
- Grid.Column="2"
- Image="minus"
- HeightRequest="30"
- WidthRequest="30"
- VerticalOptions="Center"
- Margin="5"
- Clicked="DeleteTransaction_Clicked"/>
-
- <BoxView
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="3"
- Color="Gray"/>
-
- </Grid>
- </ViewCell>
- </DataTemplate>
-
- <DataTemplate x:Key="PhotoTemplate" x:DataType="local:StockTransactionImage">
- <ViewCell>
- <mobile:MobileCard
- IsClickable="True"
- Clicked="Image_Clicked"
- Margin="0,0,0,5">
-
- <Image
- Margin="5"
- Source="{Binding Thumbnail, Converter={StaticResource ImageConverter}}"
- HeightRequest="200"
- Aspect="AspectFit"
- />
-
- </mobile:MobileCard>
- </ViewCell>
- </DataTemplate>
-
- </mobile:MobilePage.Resources>
-
- <mobile:MobilePage.PrimaryMenu>
-
- <mobile:MobileMenuButton
- x:Name="Photo"
- Image="camera"
- IsVisible="{Binding Source={x:Reference Name=_tabStrip}, Path=SelectedIndex, Converter={StaticResource PhotoVisibleConverter}}">
- <mobile:MobileMenuButton.Items>
- <mobile:MobileMenuItem Text="Take Photo" Clicked="TakePhoto_Clicked" />
- <mobile:MobileMenuItem Text="Browse Library" Clicked="PickPhoto_Clicked" />
- </mobile:MobileMenuButton.Items>
- </mobile:MobileMenuButton>
-
- <mobile:MobileMenuButton
- x:Name="Save"
- Clicked="SaveBatch_Clicked"
- Image="save"
- IsVisible="{Binding Source={x:Reference Name=_tabStrip}, Path=SelectedIndex, Converter={StaticResource SaveVisibleConverter}}"
- IsEnabled="{Binding Transactions.Count, Converter={StaticResource SaveEnabledConverter}}"/>
- </mobile:MobilePage.PrimaryMenu>
-
- <mobile:MobilePage.PageContent>
-
- <Grid Padding="5" Grid.RowSpacing="5" >
-
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <mobile:MobilePageStack
- Grid.Row="0"
- SelectedIndex="{Binding Source={x:Reference Name=_tabStrip}, Path=SelectedIndex}">
- <mobile:MobilePageStack.Items>
-
- <mobile:MobilePageStackItem>
- <mobile:MobilePageStackItem.Content>
-
-
- <Grid RowSpacing="5" ColumnSpacing="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
-
- <views:DockLayout
- Grid.Column="0">
-
- <mobile:MobileButton
- x:Name="From"
- views:DockLayout.Dock="Top"
- Text="{Binding Source.Code, Converter={StaticResource FromConverter}}"
- Clicked="From_Clicked"
- Prefix="From: "/>
-
- <mobile:MobileCard
- views:DockLayout.Dock="Top"
- Margin="0,5,0,0"
- HeightRequest="{Binding Source={x:Reference From}, Path=Height}"
- BackgroundColor="{Binding Source={x:Reference SourceSearch}, Path=BackgroundColor}"
- IsVisible="{Binding Source.ID, Converter={StaticResource SearchVisibleConverter}}"
- Padding="10,0">
- <mobile:MobileEntry
- x:Name="SourceSearch"
- TextChanged="SourceSearch_OnTextChanged"
- Placeholder="Search..." />
- </mobile:MobileCard>
-
- <mobile:MobileListView
- x:Name="_sourceHoldings"
- views:DockLayout.Dock="Top"
- Margin="0,5,0,0"
- ItemsSource="{Binding SourceHoldings.Items}"
- ItemTemplate="{StaticResource HoldingTemplate}"
- PullToRefresh="False"
- ShowRecordCount="False" />
-
- </views:DockLayout>
-
- <views:DockLayout
- Grid.Row="0"
- Grid.Column="1">
-
- <mobile:MobileButton
- views:DockLayout.Dock="Top"
- Text="{Binding Target.Code, Converter={StaticResource ToConverter}}"
- Clicked="To_Clicked"
- Prefix="To:"/>
-
- <mobile:MobileCard
- views:DockLayout.Dock="Top"
- Margin="0,5,0,0"
- HeightRequest="{Binding Source={x:Reference From}, Path=Height}"
- BackgroundColor="{Binding Source={x:Reference TargetSearch}, Path=BackgroundColor}"
- IsVisible="{Binding Target.ID, Converter={StaticResource SearchVisibleConverter}}"
- Padding="10,0">
- <mobile:MobileEntry
- x:Name="TargetSearch"
- TextChanged="TargetSearch_OnTextChanged"
- Placeholder="Search..." />
- </mobile:MobileCard>
-
- <mobile:MobileListView
- x:Name="_targetHoldings"
- views:DockLayout.Dock="Top"
- Margin="0,5,0,0"
- ItemsSource="{Binding TargetHoldings.Items}"
- ItemTemplate="{StaticResource HoldingTemplate}"
- PullToRefresh="False"
- ShowRecordCount="False"/>
-
- </views:DockLayout>
-
- </Grid>
-
- </mobile:MobilePageStackItem.Content>
- </mobile:MobilePageStackItem>
-
- <mobile:MobilePageStackItem>
- <mobile:MobilePageStackItem.Content>
- <mobile:MobileListView
- x:Name="_imagelist"
- PullToRefresh="False"
- ShowRecordCount="False"
- ItemsSource="{Binding Images}"
- ItemTemplate="{StaticResource PhotoTemplate}" />
- </mobile:MobilePageStackItem.Content>
- </mobile:MobilePageStackItem>
-
- <mobile:MobilePageStackItem>
- <mobile:MobilePageStackItem.Content>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="2*" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Label
- Grid.Row="0"
- Text="Items to Be Transferred:"
- FontSize="{StaticResource Theme.Text.Body.Size}"
- TextColor="{StaticResource Theme.OnBackground}"/>
- <mobile:MobileCard
- Grid.Row="1"
- Background="{StaticResource Theme.Background}">
- <mobile:MobileListView
- ItemsSource="{Binding Transactions}"
- ItemTemplate="{StaticResource TransactionTemplate}"/>
- </mobile:MobileCard>
- <Label
- Grid.Row="2"
- Text="Transfer Notes:"
- FontSize="{StaticResource Theme.Text.Body.Size}"
- TextColor="{StaticResource Theme.OnBackground}"/>
- <mobile:MobileCard
- Grid.Row="3"
- Background="{StaticResource Theme.Surface}"
- Padding="5">
- <mobile:MobileEditor
- Text="{Binding Notes}"
- BackgroundColor="Transparent"/>
- </mobile:MobileCard>
- </Grid>
- </mobile:MobilePageStackItem.Content>
- </mobile:MobilePageStackItem>
-
- </mobile:MobilePageStack.Items>
- </mobile:MobilePageStack>
-
- <mobile:MobileTabStrip
- x:Name="_tabStrip"
- Grid.Row="1">
- <mobile:MobileTabStrip.Items>
- <mobile:MobileTabStripItem Text="Locations" />
- <mobile:MobileTabStripItem Text="Photos" />
- <mobile:MobileTabStripItem Text="Summary" />
- </mobile:MobileTabStrip.Items>
- </mobile:MobileTabStrip>
-
- </Grid>
-
-
- </mobile:MobilePage.PageContent>
- </mobile:MobilePage>
|