private void RemindType_Changed(object sender, EventArgs e) { RadioButton rb = (RadioButton)sender; int v = Convert.ToInt32(rb.Name.Substring(rb.Name.Length - 1)); TaskRemindType = (RemindType)v; }
/// <summary> /// 设置提示的感叹号状态 /// </summary> /// <param name="remindType"></param> /// <param name="remindCtrlType"></param> /// <param name="isShow"></param> public static void SetRemindState(RemindType remindType, RemindCtrlType remindCtrlType, bool isShow) { if (!remindDic.ContainsKey(remindType)) { remindDic.Add(remindType, new Dictionary <RemindCtrlType, bool>()); } if (isShow) { if (!remindDic[remindType].ContainsKey(remindCtrlType)) { remindDic[remindType].Add(remindCtrlType, true); } } else { if (remindDic[remindType].ContainsKey(remindCtrlType)) { remindDic[remindType].Remove(remindCtrlType); } } if (remindCallBackDic.Keys.Count == 0) { return; } //发送消息 messageMgr.sendMessage(null, remindCallBackDic[remindType], (int)remindType, (int)remindCtrlType); }
private void frmMessage_Load(object sender, EventArgs e) { ttButtons.SetToolTip(btnAddTime, "Напомнить позже"); ttButtons.SetToolTip(btnComplete, "Готово"); lblHeader.Text = this.Text = Task.TaskName + " :" + cTask.FormatDateString(Task.LastRun, "DD.MM.YYYY HH.mm"); lblTime.Text = CommonFunctions.AddToSize(DateTime.Now.Hour.ToString(), '0', 2, false) + ":" + CommonFunctions.AddToSize(DateTime.Now.Minute.ToString(), '0', 2, false) + ":" + CommonFunctions.AddToSize(DateTime.Now.Second.ToString(), '0', 2, false); lblTime.Left = ClientSize.Width / 2 - lblTime.Width / 2; groupRemindType.Left = ClientSize.Width / 2 - groupRemindType.Width / 2; txtRemind.Text = Task.Remind.ToString(); txtMessage.Text = Task.MessageText; TaskRemindType = Task.TaskRemindType; int tmp = (int)TaskRemindType; string tmpname = "rbRemindType" + tmp.ToString(); CheckRadioButton(tmpname, groupRemindType); if (NoAddTime) { groupRemindType.Enabled = false; btnAddTime.Enabled = false; } tmrTime.Start(); }
/// <summary> /// 根据类型得到提醒数 /// </summary> /// <param name="CompanyId"></param> /// <param name="OperatorId"></param> /// <param name="type"></param> /// <returns></returns> public int GetRemindCountByType(string CompanyId, string OperatorId, RemindType type) { var setting = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(CompanyId); if (setting == null) { setting = new EyouSoft.Model.ComStructure.MComSetting(); } return(_idal.GetRemindCountByType(CompanyId, OperatorId, type, setting)); //int recordCount = 0; //switch (type) //{ // case RemindType.变更提醒: // { // int temp = 0; // GetOrderChangeRemindLst(20, 1, ref temp, CompanyId, OperatorId); // GetTourChangeRemindLst(20, 1, ref recordCount, CompanyId, OperatorId); // recordCount += temp; // break; // } // case RemindType.订单提醒: // GetOrderRemindLst(20, 1, ref recordCount, OperatorId, CompanyId); // break; // case RemindType.合同到期提醒: // { // int temp1 = 0; // int temp2 = 0; // GetLaborContractExpireRemindLst(20, 1, ref temp1, CompanyId); // GetCompanyContractExpireRemindLst(20, 1, ref temp2, CompanyId); // GetSourceContractExpireRemindLst(20, 1, ref recordCount, CompanyId); // recordCount = recordCount + temp1 + temp2; // break; // } // case RemindType.计调提醒: // GetPlanRemindLst(20, 1, ref recordCount, CompanyId, OperatorId); // break; // case RemindType.收款提醒: // GetReceivablesRemindLst(20, 1, ref recordCount, CompanyId, OperatorId); // break; // case RemindType.预控到期提醒: // { // int temp1 = 0; // int temp2 = 0; // GetHotelcontrolHotelUsedLst(20, 1, ref temp1, CompanyId, OperatorId); // GetShipcontrolHotelUsedLst(20, 1, ref temp2, CompanyId, OperatorId); // GetCarcontrolHotelUsedLst(20, 1, ref recordCount, CompanyId, OperatorId); // recordCount = recordCount + temp1 + temp2; // break; // } // case RemindType.询价提醒: // GetInquiryRemindLst(20, 1, ref recordCount, OperatorId, CompanyId); // break; //} //return recordCount; }
public Reminder(DateTime beginTime, DateTime endTime, RemindType type, string title, string content, string address) : this() { BeginTime = beginTime; EndTime = endTime; Type = type; Title = title; Content = content; Address = address; }
public void AddTime(int Add, RemindType rt) { Remind = Add; dtNextDateTime = DateTime.Now; if (rt == RemindType.Minuts) { dtNextDateTime = dtNextDateTime.AddMinutes(Remind); } else { dtNextDateTime = dtNextDateTime.AddHours(Remind); } StartWatch(); }
private void btnOk_Click(object sender, EventArgs e) { // RemindType rt = EnumAdapter.GetEnum <RemindType>(e0571.web.core.Utils.TypeConverter.ChangeString(cbRemindType.SelectedValue)); if (SectionBizSettingsSave != null) { SectionBizSettingsSave(this, new SectionBizSettingsSaveEventArgs { Type = rt, YYRemindFlag = (chkPlayYY.Checked ? 1 : 0) }); } this.DialogResult = DialogResult.OK; this.Close(); }
/// <summary> /// 获得提示感叹号的状态 /// </summary> /// <param name="remindType"></param> /// <param name="remindCtrlType"></param> /// <returns></returns> public static bool GetRemindState(RemindType remindType, RemindCtrlType remindCtrlType) { if (!remindDic.ContainsKey(remindType)) { remindDic.Add(remindType, new Dictionary <RemindCtrlType, bool>()); } if (remindCtrlType == RemindCtrlType.None) { if (remindDic[remindType].Keys.Count == 0) { return(false); } else { return(true); } } else { return(remindDic[remindType].ContainsKey(remindCtrlType)); } }
void CheckStateCallBack(object sender, MsgArgs e) { RemindType _type = (RemindType)(int.Parse(e.paramList[0].ToString())); RemindCtrlType _ctrlType = (RemindCtrlType)(int.Parse(e.paramList[1].ToString())); if (ctrlType == RemindCtrlType.None) { if (_type == type) { if (!GameUI_Mgr_Remind.remindFunc.ContainsKey(this)) { if (GameUI_Mgr_Remind.GetRemindState(type, ctrlType)) { GameUI_Mgr_Remind.remindFunc.Add(this, true); } else { GameUI_Mgr_Remind.remindFunc.Add(this, false); } } return; } } if (_ctrlType == ctrlType) { if (!GameUI_Mgr_Remind.remindFunc.ContainsKey(this)) { if (GameUI_Mgr_Remind.GetRemindState(type, ctrlType)) { GameUI_Mgr_Remind.remindFunc.Add(this, true); } else { GameUI_Mgr_Remind.remindFunc.Add(this, false); } } } }
private void btnOk_Click(object sender, EventArgs e) { // string authEndPoint = formatAuthEndPoint(); RemindType rt = EnumAdapter.GetEnum <RemindType>(e0571.web.core.Utils.TypeConverter.ChangeString(cbRemindType.SelectedValue)); string connectUrl = authEndPoint + "/"; HttpAdapter.optionsAsyncTo(connectUrl, new { ApplicationId = Common.APPLICATION_ID }.ToStringObjectDictionary(), (ret, res) => { if (ret != "ok") { MessageBoxAdapter.ShowError("无效的认证节点"); return; } if (SectionWebSettingsSave != null) { SectionWebSettingsSave(this, new SectionWebSettingsSaveEventArgs { AuthEndPoint = authEndPoint }); } if (SectionBizSettingsSave != null) { SectionBizSettingsSave(this, new SectionBizSettingsSaveEventArgs { Type = rt, YYRemindFlag = (chkPlayYY.Checked ? 1 : 0) }); } this.DialogResult = DialogResult.OK; this.UIInvoke(() => { this.Close(); }); }); }
private void frmAddTask_Load(object sender, EventArgs e) { //общая настройка контролов при загрузке формы dtStartDateTime.Value = DateTime.Now; dtNextDateTime.Value = dtNextDateTime.MinDate; dtNextDateTime.Enabled = false; //Установка дня недели в текущий в Еженедельно cmbWeekDay.Text = CommonFunctions.GetDayName(DateTime.Now.DayOfWeek); //установка месяца в Ежегодно cmbMonth.Text = CommonFunctions.GetMonthName(DateTime.Now.Month); //добавление дней в месячные ComboBox FillMounthCmb(DateTime.Now.Month, DateTime.Now.Year, cmbMonthDay); cmbMonthDay.Text = DateTime.Now.Day.ToString(); FillMounthCmb(CommonFunctions.GetMonthNumber(cmbMonth.Text), DateTime.Now.Year, cmbYearDay); cmbYearDay.Text = DateTime.Now.Day.ToString(); //отключение контролов cmbMonthDay.Enabled = false; cmbYearDay.Enabled = false; txtN.Enabled = false; cmbMonth.Enabled = false; cmbWeekDay.Enabled = false; btnOpenSoundFile.Enabled = false; btnSelect.Enabled = false; txtProgramPath.Enabled = false; txtProgramParams.Enabled = false; chkProgramHide.Enabled = false; btnLog.Visible = false; btnClearLog.Visible = false; if (bEdit) //редактирование { this.Text = "Изменение задачи"; btnLog.Visible = true; btnClearLog.Visible = true; //установка значений контролов chkActive.Checked = Task.Active; txtMessage.Text = Task.MessageText; txtN.Text = Task.N.ToString(); txtProgramParams.Text = Task.ProgramParameters; txtProgramPath.Text = Task.ProgramPath; txtRemind.Text = Task.Remind.ToString(); SoundFile = Task.SoundPath; dtStartDateTime.Value = Task.GetStartDateTime(); dtNextDateTime.Value = Task.GetNextDateTime(); TaskActionType = Task.TaskActionType; txtName.Text = Task.TaskName; TaskRemindType = Task.TaskRemindType; TaskSoundType = Task.TaskSoundType; TaskTimeType = Task.TaskTimeType; //установка radiobutton'ов int tmp = (int)TaskActionType; string tmpname = "rbActionType" + tmp.ToString(); CheckRadioButton(tmpname, groupActionType); tmp = (int)TaskRemindType; tmpname = "rbRemindType" + tmp.ToString(); CheckRadioButton(tmpname, groupRemindType); tmp = (int)TaskSoundType; tmpname = "rbSoundType" + tmp.ToString(); CheckRadioButton(tmpname, groupSoundType); tmp = (int)TaskTimeType; tmpname = "rbTimeType" + tmp.ToString(); CheckRadioButton(tmpname, groupTimeType); //подключение событий для контроля за состоянием задания fMain.OnLockRecord += new frmMain.LockRecord(fMain_OnLockRecord); fMain.OnUnlockRecord += new frmMain.UnlockRecord(fMain_OnUnlockRecord); } else //новая задача { this.Text = "Добавить задачу"; } }