214 lines
6.9 KiB
C#
214 lines
6.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
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;
|
|
using System.Diagnostics;
|
|
|
|
namespace HiiShe.Manager
|
|
{
|
|
/// <summary>
|
|
/// MainWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class MainWindow : HiiShe.WPFUI.Controls.HSNormalWindow
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
InitMainWindowControls();
|
|
}
|
|
|
|
#region 方法 -> 初始化配置
|
|
private void InitMainWindowControls()
|
|
{
|
|
AddCommodity_MouseUp(null, null);
|
|
//HSTabItem_MouseUp_1(null, null);
|
|
//MainTitle.Content = "慧舍科技收银软件";
|
|
}
|
|
#endregion
|
|
|
|
#region 方法 -> 关闭
|
|
private void BtnClose_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (MessageBox.Show("即将退出信息管理系统,是否运行收银系统?", "系统提示", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
string _path = @"D:\HighWayPosSoft\AutoUpdateEx.exe";
|
|
ProcessStartInfo info = new ProcessStartInfo(_path);
|
|
info.WorkingDirectory = System.IO.Path.GetDirectoryName(_path);
|
|
Process.Start(info);
|
|
}
|
|
catch { }
|
|
Application.Current.Shutdown();
|
|
}
|
|
else
|
|
{
|
|
Application.Current.Shutdown();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 方法 -> 最大化 最小化按钮
|
|
private void MinMaxButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (this.WindowState == System.Windows.WindowState.Maximized)
|
|
{
|
|
this.WindowState = System.Windows.WindowState.Normal;
|
|
}
|
|
else
|
|
{
|
|
this.WindowState = System.Windows.WindowState.Maximized;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 方法 -> 最小化按钮
|
|
private void MinButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (this.WindowState == System.Windows.WindowState.Minimized)
|
|
{
|
|
this.WindowState = System.Windows.WindowState.Normal;
|
|
}
|
|
else
|
|
{
|
|
this.WindowState = System.Windows.WindowState.Minimized;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 菜单栏按钮事件
|
|
|
|
|
|
#region 菜单 -> 现金收银
|
|
|
|
private void HSImageButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
private void AddCommodity_MouseUp(object sender, MouseButtonEventArgs e)
|
|
{
|
|
////查询的商品
|
|
if (AddCommodity_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.CashCollection.MainWindow _MainWindow = new Manager.V1_0.CashCollection.MainWindow();
|
|
AddCommodity_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
|
|
|
|
private void HSTabItem_MouseUp(object sender, MouseButtonEventArgs e)
|
|
{
|
|
//员工编辑
|
|
if (SearchCommodity_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.SearchStaff.MainWindow _MainWindow = new Manager.V1_0.SearchStaff.MainWindow();
|
|
SearchCommodity_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
|
|
private void ShopMessage_MouseUp(object sender, MouseButtonEventArgs e)
|
|
{
|
|
//门店编辑
|
|
if (SearchCommodity_MainShop.Content == null)
|
|
{
|
|
Manager.V1_0.ShopMessage.MainWindow _MainWindow = new Manager.V1_0.ShopMessage.MainWindow();
|
|
SearchCommodity_MainShop.Content = _MainWindow;
|
|
}
|
|
}
|
|
private void HSTabItem_MouseUp_1(object sender, MouseButtonEventArgs e)
|
|
{
|
|
//导出数据
|
|
if (Export_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.ExportData.MainWindow _MainWindow = new Manager.V1_0.ExportData.MainWindow();
|
|
Export_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
|
|
private void HSTabItem_MouseUp_2(object sender, MouseButtonEventArgs e)
|
|
{
|
|
//导入数据
|
|
if (Import_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.ImportData.MainWindow _MainWindow = new Manager.V1_0.ImportData.MainWindow();
|
|
Import_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
|
|
private void HSTabItem_MouseUp_3(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (SearchMembership.Content == null)
|
|
{
|
|
Manager.V1_0.MemberShip.MainWindow _MainWindow = new Manager.V1_0.MemberShip.MainWindow();
|
|
SearchMembership.Content = _MainWindow;
|
|
}
|
|
}
|
|
private void HSTabItem_MouseUp_4(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (SearchPurchase.Content == null)
|
|
{
|
|
Manager.V1_0.Purchase.MainWindow _MainWindow = new Manager.V1_0.Purchase.MainWindow();
|
|
SearchPurchase.Content = _MainWindow;
|
|
}
|
|
}
|
|
|
|
private void HSTabControl_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.Key == Key.F1)
|
|
{
|
|
if (AddCommodity_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.CashCollection.MainWindow _MainWindow = new Manager.V1_0.CashCollection.MainWindow();
|
|
AddCommodity_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
else if (e.Key == Key.F2)
|
|
{
|
|
if (SearchMembership.Content == null)
|
|
{
|
|
Manager.V1_0.MemberShip.MainWindow _MainWindow = new Manager.V1_0.MemberShip.MainWindow();
|
|
SearchMembership.Content = _MainWindow;
|
|
}
|
|
SearchMembership.Navigate(SearchMembership.Content);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加促销商品
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void HSTabItem_MouseUp_5(object sender, MouseButtonEventArgs e)
|
|
{
|
|
|
|
////查询的商品
|
|
if (AddSales_MainContent.Content == null)
|
|
{
|
|
Manager.V1_0.Sales.MainWindow _MainWindow = new Manager.V1_0.Sales.MainWindow();
|
|
AddSales_MainContent.Content = _MainWindow;
|
|
}
|
|
}
|
|
private void HSTabItem_MouseUp_7(object sender, MouseButtonEventArgs e)
|
|
{
|
|
frmPrintMain form = new frmPrintMain();
|
|
form.ShowDialog();
|
|
}
|
|
}
|
|
}
|