Create a Wpf application
Use Visual Studios 2019
A shipping company receives packages at its headquarters, which functions as its shipping hub. After receiving the packages the company ships them to a distribution center in one of the following states: Alabama, Florida, Georgia, Kentucky, Mississippi, North Carolina, South Carolina, Tennessee, West Virginia or Virginia. The company needs an application to track the packages that pass through its shipping hub. The application generates a package ID number for each package that arrives at the shipping hub, when the user clicks the application’s Scan New Button. Once a package has been scanned, the user should be able to enter the shipping address for the package. The user should be able to navigate through the list of scanned packages by using Buttons and by viewing a list of all packages destined for a particular state.
This Application is expected to work as described below:
<Window x:Class="ShippingApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30*"/>
<RowDefinition Height="289*"/>
</Grid.RowDefinitions>
<Button x:Name="scanButton" Content="Scan new"
HorizontalAlignment="Left" Margin="82,203.908,0,0"
VerticalAlignment="Top" Width="75" Click="scanButton_Click"
Grid.Row="1"/>
<TextBox x:Name="tb1" HorizontalAlignment="Left" Height="23"
Margin="157,59.908,0,0" TextWrapping="Wrap" VerticalAlignment="Top"
Width="213" Grid.Row="1"/>
<Label Content="Arrived at" HorizontalAlignment="Left"
Margin="43,55.908,0,0" VerticalAlignment="Top"
RenderTransformOrigin="0.56,-0.14" Grid.Row="1"/>
<Label Content="Address" HorizontalAlignment="Left"
Margin="43,133.908,0,0" VerticalAlignment="Top"
Grid.Row="1"/>
<TextBox x:Name="tb2" HorizontalAlignment="Left" Height="23"
Margin="157,133.908,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="120" Grid.Row="1"/>
<Button x:Name="scanButton_Copy" Content="Back"
HorizontalAlignment="Left" Margin="219,203.908,0,0"
VerticalAlignment="Top" Width="75" Grid.Row="1"
Click="scanButton_Copy_Click"/>
<Button x:Name="scanButton_Copy1" Content="Next"
HorizontalAlignment="Left" Margin="377,203.908,0,0"
VerticalAlignment="Top" Width="75" Grid.Row="1"
Click="scanButton_Copy1_Click"/>
<Label Content="ID" HorizontalAlignment="Left"
Margin="52,6.908,0,0" VerticalAlignment="Top"
Grid.Row="1"/>
<TextBox x:Name="tb2_Copy" HorizontalAlignment="Left"
Height="23" Margin="157,6.908,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="120" Grid.Row="1"/>
</Grid>
</Window>
Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ShippingApplication
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
List<Package> list = new List<Package>();
private void scanButton_Click(object sender, RoutedEventArgs
e)
{
Random random = new Random();
int num = random.Next(1000);
tb1.Text = DateTime.Now.ToString();
tb2_Copy.Text = Convert.ToString(num);
Package obj = new Package();
obj.id = Convert.ToInt32(tb2_Copy.Text);
obj.address = tb2.Text;
list.Add(obj);
}
private void scanButton_Copy_Click(object sender,
RoutedEventArgs e)
{
//Display the objects from the list accordingly
}
private void scanButton_Copy1_Click(object sender,
RoutedEventArgs e)
{
//Display the objects from the list accordingly
}
}
class Package
{
public int id;
public string address;
}
}
Create a Wpf application Use Visual Studios 2019 A shipping company receives packages at its headquarters,...
The ABC Shipping Company charges the Rates listed in the following table: Weight of the package Rate per mile in California Rate per mile other states 2 kg or less $2.5 $3.5 Over2 kg but not more than 6 kg $3.5 $5.0 Over 6 Kg but not more than 10 kg $4.5 $6.0 Over 10 Kg but not more than 30 Kg $5.0 $7.5 Over 30 kg $6.0 $8.5 Create an application that contains two radio buttons to select California...