Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Desktop/Supermarket/Supermarket/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Supermarket"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
StartupUri="MainWindow.xaml">
<Application.Resources>

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
115 changes: 106 additions & 9 deletions Desktop/Supermarket/Supermarket/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,109 @@
<Window x:Class="Supermarket.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Supermarket"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Window
x:Class="Supermarket.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Supermarket"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="1000"
Height="700"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid Background="AliceBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<ContentControl x:Name="LeftGrid" Grid.Column="0">
<StackPanel>
<Label
Grid.Column="1"
Margin="5,50"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Content="Sign in into your workspace"
FontFamily="Century Gothic"
FontSize="25"
Foreground="#244cd1" />
<TextBox
Width="250"
Height="50"
Margin="5,15,5,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
materialDesign:HintAssist.Hint="Email"
Style="{StaticResource MaterialDesignOutlinedTextBox}" />
<PasswordBox
Width="250"
Height="50"
Margin="5,15,5,30"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
VerticalContentAlignment="Bottom"
materialDesign:HintAssist.Hint="Password"
materialDesign:TextFieldAssist.HasClearButton="True"
Style="{StaticResource MaterialDesignOutlinedRevealPasswordBox}" />
<Button
Grid.Row="2"
Width="250"
Height="50"
Margin="5,25,5,150"
HorizontalAlignment="Center"
Background="#2979FF"
BorderBrush="DarkBlue"
BorderThickness="1"
Click="Sign_Click"
Content="Sign in"
Foreground="White" />
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Margin="0,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontFamily="Century Gothic"
FontSize="15"
Foreground="Black"
Text="Not signed up yet?" />
<Label
Grid.Column="1"
Margin="0,5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="SIGN UP NOW"
FontFamily="Century Gothic"
FontSize="15"
Foreground="#2979FF"
MouseDown="SignUp_Click" />
</Grid>
</StackPanel>
</ContentControl>

<Grid Grid.Column="1">
<!--<Grid.Background>
<ImageBrush ImageSource="D:\wallpapers\lamborghini-aventador.jpg" />
</Grid.Background>
<Label
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="Qale"
FontSize="120"
Foreground="Wheat"
Style="{StaticResource MaterialDesignLabel}" />-->
<MediaElement
x:Name="bgvideo"
Width="500"
Height="700"
Source="C:\Users\iMaster\Desktop\Supermarket\Supermarket\Desktop\Supermarket\Supermarket\Images\vecteezy_minimalist_banner_of_dark_and_yellow_horizontal_background.mp4" />
</Grid>

</Grid>
</Window>
21 changes: 13 additions & 8 deletions Desktop/Supermarket/Supermarket/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using System.Text;
using Supermarket.Views;
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 Supermarket
{
Expand All @@ -20,5 +13,17 @@ public MainWindow()
{
InitializeComponent();
}

private void SignUp_Click(object sender, MouseButtonEventArgs e)
{
LeftGrid.Content = new SignUp();
}

private void Sign_Click(object sender, RoutedEventArgs e)
{
var signIn = new MarketMainWindow();
Window.GetWindow(this).Close();
signIn.Show();
}
}
}
24 changes: 24 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/Customer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;

namespace Supermarket.Models;

public class Customer
{
public int Id { get; set; }

[Required]
public string Password { get; set; }

public string FirstName { get; set; }
public string LastName { get; set; }

[Required]
public string Email { get; set; }

public string PhoneNumber { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }

public ICollection<CustomerAddress> CustomerAddresses { get; set; }
public ICollection<OrderDetail> OrderDetails { get; set; }
}
15 changes: 15 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/CustomerAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Supermarket.Models;

public class CustomerAddress
{
public int Id { get; set; }

public int CustomerId { get; set; }
public Customer Customer { get; set; }

public string AddressLine1 { get; set; }
public string? AddressLine2 { get; set; }
public string City { get; set; }
public string Country { get; set; }
public string PhoneNumber { get; set; }
}
15 changes: 15 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/OrderDetail.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Supermarket.Models;

public class OrderDetail
{
public int Id { get; set; }

public int CustomerId { get; set; }
public Customer Customer { get; set; }

public decimal Total { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }

public ICollection<OrderItem> OrderItems { get; set; }
}
16 changes: 16 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/OrderItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Supermarket.Models;

public class OrderItem
{
public int Id { get; set; }

public int OrderId { get; set; }
public OrderDetail Order { get; set; }

public int ProductId { get; set; }
public Product Product { get; set; }

public int Quantity { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
}
29 changes: 29 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/Product.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;

namespace Supermarket.Models;

public class Product
{
public int Id { get; set; }

[Required]
public string Name { get; set; }

public string? Desc { get; set; }

[Required]
public string SKU { get; set; }

public int CategoryId { get; set; }
public ProductCategory Category { get; set; }

public int InventoryId { get; set; }
public ProductInventory Inventory { get; set; }

public decimal Price { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }

public ICollection<OrderItem> OrderItems { get; set; }
}
18 changes: 18 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/ProductCategory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;

namespace Supermarket.Models;

public class ProductCategory
{
public int Id { get; set; }

[Required]
public string Name { get; set; }

public string? Desc { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }

public ICollection<Product> Products { get; set; }
}
12 changes: 12 additions & 0 deletions Desktop/Supermarket/Supermarket/Models/ProductInventory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Supermarket.Models;

public class ProductInventory
{
public int Id { get; set; }
public int Quantity { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }

public ICollection<Product> Products { get; set; }
}
60 changes: 60 additions & 0 deletions Desktop/Supermarket/Supermarket/Services/CategoriesService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Supermarket.Models;

namespace Supermarket.Services;

public class CategoriesService
{
public List<ProductCategory> Categories =
[
new ProductCategory()
{
Id = 1,
Name = "Drinks",
Desc = null,
CreatedAt = DateTime.Now,
ModifiedAt = null,
DeletedAt = null
},
new ProductCategory()
{
Id = 2,
Name = "Meats",
Desc = null,
CreatedAt = DateTime.Now,
ModifiedAt = null,
DeletedAt = null
},
new ProductCategory()
{
Id = 3,
Name = "Fruits",
Desc = null,
CreatedAt = DateTime.Now,
ModifiedAt = null,
DeletedAt = null
},
new ProductCategory()
{
Id = 4,
Name = "Bread",
Desc = null,
CreatedAt = DateTime.Now,
ModifiedAt = null,
DeletedAt = null
},
new ProductCategory()
{
Id = 5,
Name = "Vegetables",
Desc = null,
CreatedAt = DateTime.Now,
ModifiedAt = null,
DeletedAt = null
}
];

public List<ProductCategory> GetCategories()
{
return Categories;
}
}
Loading