Esempio n. 1
0
        private void ThisAddIn_Startup(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.OnWorkBeginTime == DateTime.Today)
            {
                setTimer();
                return;
            }

            if (Properties.Settings.Default.AutoHomeWork)
            {
                if (DetectEnviroment.isHomeWork())
                {
                    var type = TimeCheck.CheckHomeOfficeTime();
                    var mail = PrepareMail.PrepareHOMail(type);
                    if (mail == null)
                    {
                        return;
                    }
                    if (SendeMailItem(mail, true) && type == 1)
                    {
                        Properties.Settings.Default.OnTimeSend      = DateTime.Now.AddHours(8);
                        Properties.Settings.Default.OnTimeSendType  = 1;
                        Properties.Settings.Default.OnWorkBeginTime = DateTime.Today;
                        Properties.Settings.Default.Save();
                        setTimer();
                    }
                    return;
                }
            }

            if (!Properties.Settings.Default.SilentMode)
            {
                new MainForm(this).Show();
            }
        }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     MainObj.SendeMailItem(PrepareMail.PrepareHOMail(TimeCheck.CheckHomeOfficeTime()), false);
 }