コード例 #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     txtCompanyName.Text             = SettingDAL.GetValue("公司名称");
     txtCompanySite.Text             = SettingDAL.GetValue("公司网站");
     txtBirthdayCount.Text           = SettingDAL.GetValue("生日提醒天数");
     cbStartBirthdayRemind.IsChecked = SettingDAL.GetBoolValue("启用生日提醒");
     txtNumberPrefix.Text            = SettingDAL.GetValue("员工工号前缀");
 }
コード例 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            SettingDAL dal = new SettingDAL();

            txtCompanyName.Text          = dal.GetValue("公司名称");
            txtCompanySite.Text          = dal.GetValue("公司网站");
            cbBirthDayPrompt.IsChecked   = dal.GetBoolValue("启用生日提醒");
            txtBirthDayDays.Text         = dal.GetValue("生日提醒天数");
            txtEmployeeNumberPrefix.Text = dal.GetValue("员工工号前缀");
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: vipyeshuai/HSMS.UI
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Login lg = new Login();
            //if (lg.ShowDialog() != true)
            //{
            //    Application.Current.Shutdown();
            //}

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

            //查询是否有员工过生日

            int month = DateTime.Now.Month;
            int day   = DateTime.Now.Day;

            if (SettingDAL.GetBoolValue("启用生日提醒"))
            {
                List <Employee> list = EmployeeDAL.ListAll().ToList();
                foreach (Employee item in list)
                {
                    int empMonth = item.BirthDay.Month;
                    int empDay   = item.BirthDay.Day;
                    if (month == empMonth && empDay == day)
                    {
                        MessageBox.Show("今天是你的同事" + item.Name + "的生日,赶快送上祝福吧!");
                        continue;
                    }

                    if (month == empMonth && (empDay - day) <= SettingDAL.GetIntValue("生日提醒天数") && (empDay - day) > 0)//有人要过生日
                    {
                        MessageBox.Show("还有" + (empDay - day) + "天是你的同事" + item.Name + "的生日,赶快送上祝福吧!");
                        continue;
                    }
                }
            }
        }