|
|
|
|
|
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.Threading;
|
|
|
|
|
|
using System.Timers;
|
|
|
|
|
|
using System.Xml;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
|
|
|
|
|
|
using CommonFunc;
|
|
|
|
|
|
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
|
|
namespace XGL
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// MainWindow.xaml 的交互逻辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
Window ShowDialgForm = null;
|
|
|
|
|
|
Dictionary<string, Window> WaitForms = new Dictionary<string, Window>();
|
|
|
|
|
|
string currFormTime = null;
|
|
|
|
|
|
object objLock = new object();
|
|
|
|
|
|
public MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Noticemonitor()
|
|
|
|
|
|
{
|
|
|
|
|
|
//lblTime.Content = DateTime.Now.ToString("HH:mm:ss");
|
|
|
|
|
|
//lblDate.Content = DateTime.Now.ToString("MM/dd");
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
lock (objLock)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ShowDialgForm == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
foreach (string key in WaitForms.Keys)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Convert.ToDateTime(key).AddMinutes(5) < DateTime.Now)
|
|
|
|
|
|
{
|
|
|
|
|
|
currFormTime = key;
|
|
|
|
|
|
ShowDialgForm = WaitForms[key];
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (ShowDialgForm != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (ShowDialgForm.ShowDialog() == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
WaitForms.Remove(currFormTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnClose_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Environment.Exit(Environment.ExitCode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//工程控制
|
|
|
|
|
|
private void btnEngineering_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//btnDefaultPage.Visibility = Visibility.Hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//信息查询
|
|
|
|
|
|
private void btnInfoSearch_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnChange_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//二级菜单返回
|
|
|
|
|
|
private void btnBack_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnDefaultPage_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CommonHelper.IsHavePermition("1001","Main"))
|
|
|
|
|
|
{
|
|
|
|
|
|
//MainContent.Child = new UControl.UCUserList();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("用户没有按钮权限,请联系管理员!", "提示", MessageBoxButton.OK);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
|
|
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnDianJian_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (CommonHelper.IsHasRole(Common.currUser.Id, 4))
|
|
|
|
|
|
if (CommonHelper.IsHavePermition("1001","UserList"))
|
|
|
|
|
|
{
|
|
|
|
|
|
//MainContent.Child = new UControl.UCUserList();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("用户没有按钮权限,请联系管理员!", "提示", MessageBoxButton.OK);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
|
|
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Window w = this.Owner as Window;
|
|
|
|
|
|
w.Show();
|
|
|
|
|
|
this.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (CommonHelper.IsHasRole(Common.currUser.Id, 4))
|
|
|
|
|
|
if (CommonHelper.IsHavePermition("1001", "Quary"))
|
|
|
|
|
|
{
|
|
|
|
|
|
//MainContent.Child = new UControl.UCUserList();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("用户没有按钮权限,请联系管理员!", "提示", MessageBoxButton.OK);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
|
|
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|