main
syneffort 2 years ago
parent 38a6889081
commit 9fed14988e
  1. 8
      MySolution/MySolution.sln
  2. 17
      MySolution/ToDoApp/MainWindow.xaml.cs
  3. 9
      MySolution/WeatherApp/App.xaml
  4. 17
      MySolution/WeatherApp/App.xaml.cs
  5. 10
      MySolution/WeatherApp/AssemblyInfo.cs
  6. 24
      MySolution/WeatherApp/MainWindow.xaml
  7. 34
      MySolution/WeatherApp/MainWindow.xaml.cs
  8. 14
      MySolution/WeatherApp/WeatherApp.csproj

@ -25,7 +25,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InventoryManagement_MariaDB
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBCreateEF", "DBCreateEF\DBCreateEF.csproj", "{A3960078-A866-414F-B039-FCD4065E8F74}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBCreateEF", "DBCreateEF\DBCreateEF.csproj", "{A3960078-A866-414F-B039-FCD4065E8F74}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToDoApp", "ToDoApp\ToDoApp.csproj", "{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToDoApp", "ToDoApp\ToDoApp.csproj", "{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeatherApp", "WeatherApp\WeatherApp.csproj", "{E0032CFE-5591-4195-828B-5D2ED602A208}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -81,6 +83,10 @@ Global
{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.Build.0 = Release|Any CPU {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.Build.0 = Release|Any CPU
{E0032CFE-5591-4195-828B-5D2ED602A208}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0032CFE-5591-4195-828B-5D2ED602A208}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0032CFE-5591-4195-828B-5D2ED602A208}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0032CFE-5591-4195-828B-5D2ED602A208}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -200,6 +200,22 @@ namespace ToDoApp
} }
private void btnUpdate_Click(object sender, RoutedEventArgs e) private void btnUpdate_Click(object sender, RoutedEventArgs e)
{
if (_selectedItem == null)
{
Item newItem = new Item()
{
UserId = _user.Id,
Title = tbxItemName.Text,
IsToday = chkItemToday.IsChecked,
DueDate = dpItemDueDate.SelectedDate,
Description = tbxItemDescription.Text,
};
ItemService.Instance.CreateItem(newItem);
ClearSelectedItem();
}
else
{ {
_selectedItem.Title = tbxItemName.Text; _selectedItem.Title = tbxItemName.Text;
_selectedItem.IsToday = chkItemToday.IsChecked == true ? true : false; _selectedItem.IsToday = chkItemToday.IsChecked == true ? true : false;
@ -207,6 +223,7 @@ namespace ToDoApp
_selectedItem.Description = tbxItemDescription.Text; _selectedItem.Description = tbxItemDescription.Text;
ItemService.Instance.UpdateItem(_selectedItem); ItemService.Instance.UpdateItem(_selectedItem);
}
RefreshList(); RefreshList();
} }

@ -0,0 +1,9 @@
<Application x:Class="WeatherApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WeatherApp"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace WeatherApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

@ -0,0 +1,24 @@
<Window x:Class="WeatherApp.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:WeatherApp"
mc:Ignorable="d"
Title="MainWindow" Height="40" Width="300"
WindowStyle="None" Topmost="True"
MouseLeftButtonDown="Window_MouseLeftButtonDown">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tbLocation" Grid.Column="1" Text="Location" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Image x:Name="imgWeather" Grid.Column="0" Source="https://openweathermap.org/img/wn/10d@2x.png"/>
<TextBlock x:Name="tbTime" Grid.Column="2" Text="yyyy-MM-dd hh:mm:ss" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
</Window>

@ -0,0 +1,34 @@
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 WeatherApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
DragMove();
}
}
}

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
</Project>
Loading…
Cancel
Save