Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegLobakov committed Aug 16, 2018
1 parent 99f0ca3 commit f69c0de
Show file tree
Hide file tree
Showing 11 changed files with 370 additions and 279 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="d6b0a390-f9c0-4482-81e5-ba609063ca62" Publisher="CN=Lobakov Oleg" Version="1.1.20.0" />
<Identity Name="d6b0a390-f9c0-4482-81e5-ba609063ca62" Publisher="CN=Lobakov Oleg" Version="1.1.21.0" />
<mp:PhoneIdentity PhoneProductId="d6b0a390-f9c0-4482-81e5-ba609063ca62" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>WarehouseControl.UWP</DisplayName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WarehouseControlSystem.View.Content.EmptySpaceViewInRack">
<ContentView.Content>
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="DarkGray" SizeChanged="StackLayout_SizeChanged">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}"/>
</StackLayout.GestureRecognizers>
<Image Grid.Row="0" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" Aspect="AspectFit" Margin="5">
<Image.Source>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="UWP">
<FileImageSource File="Assets/Images/ic_action_add_circle.png"/>
</On>
<On Platform="iOS,Android">
<FileImageSource File="ic_action_add_circle.png"/>
</On>
</OnPlatform>
</Image.Source>
</Image>
<ContentView.Content>
<StackLayout Padding="1" BackgroundColor="LightGray">
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="DarkGray" SizeChanged="StackLayout_SizeChanged">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}"/>
</StackLayout.GestureRecognizers>
<Image Grid.Row="0" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" Aspect="AspectFit" Margin="5">
<Image.Source>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="UWP">
<FileImageSource File="Assets/Images/ic_action_add_circle.png"/>
</On>
<On Platform="iOS,Android">
<FileImageSource File="ic_action_add_circle.png"/>
</On>
</OnPlatform>
</Image.Source>
</Image>
</StackLayout>
</StackLayout>
</ContentView.Content>
</ContentView.Content>
</ContentView>
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
HorizontalOptions="End" />
</Grid>
<Image Grid.Row="3" IsVisible="{Binding ImageIsVisible}"
Aspect="AspectFill" Source="{Binding ImageSource}" HeightRequest="200"/>
Aspect="AspectFit" Source="{Binding ImageSource}" HeightRequest="200"/>
</Grid>
</StackLayout>
</ViewCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,41 @@
<TapGestureRecognizer Command="{Binding TapCommand}"/>
</StackLayout.GestureRecognizers>

<StackLayout.Triggers>
<!--<StackLayout.Triggers>
<DataTrigger Binding="{Binding IsSelected}" TargetType="StackLayout" Value="true">
<Setter Property="Padding" Value="3" />
<Setter Property="BackgroundColor" Value="Red" />
</DataTrigger>
</StackLayout.Triggers>
</StackLayout.Triggers>-->

<Grid x:Name="grid" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="#fcf3e7">
<Grid.Triggers>
<DataTrigger Binding="{Binding Blocked}" TargetType="Grid" Value="true">
<Setter Property="BackgroundColor" Value="#ff9a99" />
</DataTrigger>
<DataTrigger Binding="{Binding IsSelected}" TargetType="Grid" Value="true">
<Setter Property="BackgroundColor" Value="Red"/>
</DataTrigger>
</Grid.Triggers>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="codelabel" Text="{Binding Code}"
FontSize="Medium"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
HorizontalTextAlignment="Start" VerticalTextAlignment="Center" Margin="7,2,0,0"/>

<Image Grid.Row="2" x:Name="iconelement" HorizontalOptions="CenterAndExpand"
FontSize="Large"
HorizontalTextAlignment="Start" Margin="7,2,0,0"/>

<Label Grid.Row="1" Text="{Binding BinType}"
FontSize="Small"
HorizontalTextAlignment="Start" Margin="7,0,0,0"/>

<Label Grid.Row="2" Text="{Binding BinRanking}"
FontSize="Micro"
HorizontalTextAlignment="Start" Margin="7,0,7,0"/>

<Image Grid.Row="3" x:Name="iconelement" HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand" Aspect="AspectFit"
IsVisible="{Binding IsExist}">
<Image.Source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Orientation="Horizontal">
<StackLayout Grid.Row="0" Orientation="Horizontal" IsVisible="{Binding EditedBinCodeIsEnabled}">
<Label Text="Код ячейки" Margin="10" VerticalOptions="Center"/>
<Entry Text="{Binding TemplateCode, Mode=TwoWay}" Keyboard="Text"
HorizontalOptions="FillAndExpand" VerticalOptions="Center" x:Name="singlebinentry" Margin="10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
<convertors:RackOrientationConverter x:Key="orientationConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Order="Primary" Priority="700" Text="{i18n:Translate RackCardPage_Toolbar_UnSelect}" Clicked="ToolbarItem_UnSelect">
<ToolbarItem.Icon>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="UWP,WinPhone">
<FileImageSource File="Assets/Images/ic_action_image_aspect_ratio.png"/>
</On>
<On Platform="iOS,Android">
<FileImageSource File="ic_action_image_aspect_ratio.png"/>
</On>
</OnPlatform>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>
<ContentPage.Content>
<StackLayout x:Name="mainsl">
<Grid IsVisible="{Binding IsLoadingState}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
Expand Down Expand Up @@ -162,7 +176,7 @@
<ScrollView Grid.Row="1" Padding="5" BackgroundColor="White"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
Orientation="Horizontal" x:Name="rackviewpanel">
<rv:RackSimpleView x:Name="rackview"></rv:RackSimpleView>
<rv:RackSimpleView x:Name="rackview" LevelSelected="rackview_LevelSelected" SectionSelected="rackview_SectionSelected"></rv:RackSimpleView>
</ScrollView>
<Grid Grid.Row="2" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ private async void CodeEntryChanged(object sender, TextChangedEventArgs e)
await model.CheckNo();
}

private void ToolbarItem_UnSelect(object sender, EventArgs e)
{
model.NewModel.BinsViewModel.UnSelect();
}

/// <summary>
/// Selec all bins in level
/// </summary>
/// <param name="levelcoord"></param>
private void rackview_LevelSelected(int levelcoord)
{
model.NewModel.SelectLevelBins(levelcoord);
}

/// <summary>
/// Select all bins in 1 section
/// </summary>
/// <param name="sectioncoord"></param>
private void rackview_SectionSelected(int sectioncoord)
{
model.NewModel.SelectSectionBins(sectioncoord);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace WarehouseControlSystem.View.Pages.Racks.New
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class RackSimpleView : ContentView
{
public event Action<int> LevelSelected;
public event Action<int> SectionSelected;

Label HeaderLabel;
private RackViewModel model;

Expand All @@ -32,9 +35,39 @@ public int BinWidth
set { SetValue(BinWidthProperty, value); }
}

TapGestureRecognizer LevelTap;
TapGestureRecognizer SectionTap;

public RackSimpleView()
{
InitializeComponent();

LevelTap = new TapGestureRecognizer();
LevelTap.Tapped += (s, e) => {
if (LevelSelected is Action<int>)
{
if (s is Label)
{
Label label1 = (Label)s;
int t = int.Parse(label1.Text);
int i = model.Levels - t + 1;
LevelSelected(i);
}
}
};

SectionTap = new TapGestureRecognizer();
SectionTap.Tapped += (s, e) => {
if (SectionSelected is Action<int>)
{
if (s is Label)
{
Label label1 = (Label)s;
int t = int.Parse(label1.Text);
SectionSelected(t);
}
}
};
}

public void Update(RackViewModel rvm)
Expand Down Expand Up @@ -112,6 +145,7 @@ private void CreateLevelsLabels()
TextColor = Color.White,
FontAttributes = FontAttributes.Bold
};
lb.GestureRecognizers.Add(LevelTap);
grid.Children.Add(lb, 0, i);
}
}
Expand All @@ -130,6 +164,7 @@ private void CreateSectionLabels()
TextColor = Color.White,
FontAttributes = FontAttributes.Bold
};
lb.GestureRecognizers.Add(SectionTap);
lb.Text = j.ToString();
grid.Children.Add(lb, j, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ public int SearchQuantity
OnPropertyChanged("SearchQuantity");
}
}
}
int searchquantity;
} int searchquantity;

public bool IsSearchQuantityVisible
{
Expand All @@ -232,9 +231,7 @@ public bool IsSearchQuantityVisible
OnPropertyChanged("IsSearchQuantityVisible");
}
}
}
bool issearchquantityvisible;

} bool issearchquantityvisible;

public int BlockMovement
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,19 @@ public void DeleteBins()
foreach (BinViewModel bvm in selectedlist)
{
DeleteBin(bvm);
EmptySpaceViewModel esvm = new EmptySpaceViewModel(Navigation);
esvm.Section = bvm.Section;
esvm.Level = bvm.Level;
esvm.Depth = bvm.Depth;
esvm.OnTap += Esvm_OnTap;
EmptySpacesViewModels.Add(esvm);

for(int i=1;i<=bvm.SectionSpan;i++)
{
for (int j = 1; j <= bvm.LevelSpan; j++)
{
EmptySpaceViewModel esvm = new EmptySpaceViewModel(Navigation);
esvm.Section = bvm.Section + i - 1;
esvm.Level = bvm.Level + j - 1;
esvm.Depth = bvm.Depth;
esvm.OnTap += Esvm_OnTap;
EmptySpacesViewModels.Add(esvm);
}
}
}
MessagingCenter.Send(this, "Update");
}
Expand Down

0 comments on commit f69c0de

Please sign in to comment.