private void BtnToastSend_Click(object sender, EventArgs e) { if (CbToastUseFlg.Checked) { if (int.Parse(TbAddHour.Text) == 0) { var result = OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_HOUR_ERR); if (result != DialogResult.OK) { return; } } else if (int.Parse(TbAddMinute.Text) == 0) { var result = OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_MINUTE_ERR); if (result != DialogResult.OK) { return; } } CreateScheduleToast(); OriginMBox.MBoxInfoOK(AppConst.TOAST_SUCCESS); Close(); } else { OriginMBox.MBoxErrorOK(AppConst.TOAST_USEFLG_OFF); } }
private void BtnCancel_Click(object sender, EventArgs e) { bool isFinish = CbToastUseFlg.Checked ? OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_USEFLG_ON + AppConst.TOAST_FINISH) == DialogResult.OK : OriginMBox.MBoxInfoOKCancel(AppConst.TOAST_USEFLG_OFF + AppConst.TOAST_FINISH) == DialogResult.OK; if (isFinish) { //DB更新 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); int userId = int.Parse(config.AppSettings.Settings["UserId"].Value); ConfigurationSetting.UpdateConfigSettingFromToast(userId, CbToastUseFlg.Checked); Close(); } }