Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            LoginWindow win = new LoginWindow();

            if (win.ShowDialog() != true)
            {
                //退出程序
                Application.Current.Shutdown();
            }

            this.Title = new SettingDAL().GetValue("公司名称") + "人事管理系统";

            EmployeeDAL employeeDAL = new EmployeeDAL();

            Employee[] birthdayEmployees =
                employeeDAL.Search3DaysBirthDay();

            if (new SettingDAL().GetBoolValue("启用生日提醒"))
            {
                //检测一个月之内合同到期的员工
                if (birthdayEmployees.Length > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < birthdayEmployees.Length; i++)
                    {
                        sb.Append(birthdayEmployees[0].Name).Append(",");
                    }
                    sb.Append("三天之内过生日");
                    //MessageBox.Show(sb.ToString());
                    PopupWindow popupWin = new PopupWindow();
                    popupWin.Left    = SystemParameters.WorkArea.Width - popupWin.Width;
                    popupWin.Top     = SystemParameters.WorkArea.Height - popupWin.Height;
                    popupWin.Message = sb.ToString();
                    popupWin.Show();
                }
            }
        }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            LoginWindow win = new LoginWindow();
            if (win.ShowDialog() != true)
            {
                //退出程序
                Application.Current.Shutdown();
            }

            this.Title = new SettingDAL().GetValue("公司名称")+"人事管理系统";

            EmployeeDAL employeeDAL = new EmployeeDAL();
            Employee[] birthdayEmployees =
                employeeDAL.Search3DaysBirthDay();

            if (new SettingDAL().GetBoolValue("启用生日提醒"))
            {
                //检测一个月之内合同到期的员工
                if (birthdayEmployees.Length > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < birthdayEmployees.Length; i++)
                    {
                        sb.Append(birthdayEmployees[0].Name).Append(",");
                    }
                    sb.Append("三天之内过生日");
                    //MessageBox.Show(sb.ToString());
                    PopupWindow popupWin = new PopupWindow();
                    popupWin.Left = SystemParameters.WorkArea.Width - popupWin.Width;
                    popupWin.Top = SystemParameters.WorkArea.Height - popupWin.Height;
                    popupWin.Message = sb.ToString();
                    popupWin.Show();
                }
            }
        }