public void BingDGV_List() { List <JobsTrigger> list = QF.QZServiceRpository.GetALLQuartzServer(); List <ShowModel> serviceStateList = new List <ShowModel>(); foreach (var i in list) { ShowModel temp = new ShowModel(); temp.JobKeyName = i.JobKey.Name; temp.TriggerName = i.TriggerKey.Name; temp.State = i.TriggerState.ToString(); temp.JobsTrigger = i; serviceStateList.Add(temp); } dgv_ServiceList.DataSource = new BindingList <ShowModel>(serviceStateList); }
private void btn_ReStart_Click(object sender, EventArgs e) { string temp = cbb_ServiceList.SelectedValue.ToString(); ShowModel showModel = CacheList.Where(x => x.JobKeyName == temp).FirstOrDefault(); bool result = QF.QZServiceRpository.ResumeQuartzServer(showModel.JobsTrigger.JobKey); if (result) { AttrMessage.RightMsg("服务" + temp + "恢复成功!"); } else { AttrMessage.ErrorMsg("服务" + temp + "恢复失败!"); } BingCbb_List(); BingDGV_List(); }
public void BingCbb_List() { List <JobsTrigger> list = QF.QZServiceRpository.GetALLQuartzServer(); List <string> jobList = new List <string>(); CacheList = new List <ShowModel>(); foreach (var i in list) { ShowModel temp = new ShowModel(); temp.JobKeyName = i.JobKey.Name; temp.TriggerName = i.TriggerKey.Name; temp.State = i.TriggerState.ToString(); temp.JobsTrigger = i; CacheList.Add(temp); jobList.Add(i.JobKey.Name); } cbb_ServiceList.DataSource = null; cbb_ServiceList.DataSource = jobList; }