/// <summary> /// 取消该超时任务在定时任务管理器中的注册 /// </summary> public void UnregTimeoutTimer() { var t = CTimerManage.LoadTimerMission(m_timerMissionID); if (t != null) { t.status = TM_STATUS.TM_FINISH; t.Save(); CTimerManage.RemoveFromActiveList(t.ID); } }
/// <summary> /// 离开该事件 /// </summary> /// <param name="strjson"></param> public override void LeaveEvent(string strjson) { //保存信息到数据库 //base.InsertMissionToDB(); //m_timeout.UnregTimeoutTimer(); var t = CTimerManage.LoadTimerMission(m_timerID); if (t != null) { t.status = TM_STATUS.TM_FINISH; t.Save(); CTimerManage.RemoveFromActiveList(t.ID); } }
public string delete_job(string json) { JObject item = (JObject)JsonConvert.DeserializeObject(json); int job_id = Convert.ToInt32(item["job_id"].ToString()); CTimerMission m = CTimerManage.RemoveFromActiveList(job_id); List <string> property = new List <string>(); property.Add("status"); List <object> val = new List <object>(); val.Add(TM_STATUS.TM_DELETE); CTimerManage.UpdateTimerMission(job_id, property, val); return("删除成功"); }
public JsonResult Pq_submitsignal(string json1) { JObject item = (JObject)JsonConvert.DeserializeObject(json1); A5dot2Tab1 new_5dot21 = new A5dot2Tab1(); new_5dot21.pqCheckTime = DateTime.Now; new_5dot21.pqUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot21.isRectified = Convert.ToInt32(item["isRectified"]); new_5dot21.state = 1; if (Convert.ToInt32(item["isRectified"]) == 1) { //string[] str = (item["problemDescription"].ToString()).Split(new[] { "(未整改)" }, StringSplitOptions.None);//以字符串作为分割条件 new_5dot21.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot21.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot21.Id = Convert.ToInt32(item["A5dot2Tab1_id"].ToString()); string res = Sx.ModifySxItem(new_5dot21); int a_id = Convert.ToInt32(item["A5dot2Tab1_id"].ToString()); if (Sx.getAllbyid(a_id).temp3 != null) { int missId = Convert.ToInt32(Sx.getAllbyid(a_id).temp3); var t = CTimerManage.LoadTimerMission(missId); if (t != null) { t.status = TM_STATUS.TM_FINISH; t.Save(); CTimerManage.RemoveFromActiveList(t.ID); } } //接收返回的设备工艺号 A5dot2Tab2 new_5dot22 = new A5dot2Tab2(); List <A5dot2Tab2> IsExist = Sx.GetA5dot2Tab2Item(res); if (IsExist.Count == 0) { //传到表2若没有则添加一条数据,如果有则修改该条数据 DateTime i = DateTime.Now; string yearmonth = ""; if (i.Day >= 15) { yearmonth = i.Year.ToString() + "年" + i.AddMonths(1).Month.ToString(); } else { yearmonth = i.Year.ToString() + "年" + i.Month.ToString(); } new_5dot22.cjName = item["cjName"].ToString(); new_5dot22.zzName = item["zzName"].ToString(); new_5dot22.sbGyCode = item["sbGyCode"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.sbType = item["sbType"].ToString(); new_5dot22.zyType = item["zyType"].ToString(); if (Convert.ToInt32(item["isRectified"]) == 1) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot22.state = 1; new_5dot22.nProblemsInCurMonth = 1; new_5dot22.nProblemsInCurYear = 1; new_5dot22.isSetAsTop10Worst = 0; new_5dot22.yearMonthForStatistic = yearmonth; bool has = Sx.AddA5dot2Tab2Item(new_5dot22); } //修改该条数据 else { DateTime i = DateTime.Now; string yearmonth = ""; if (i.Day >= 15) { yearmonth = i.Year.ToString() + "年" + i.AddMonths(1).Month.ToString(); } else { yearmonth = i.Year.ToString() + "年" + i.Month.ToString(); } new_5dot22.cjName = item["cjName"].ToString(); new_5dot22.zzName = item["zzName"].ToString(); new_5dot22.sbGyCode = item["sbGyCode"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.sbType = item["sbType"].ToString(); if (Convert.ToInt32(item["isRectified"]) == 1) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot22.zyType = item["zyType"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.state = 1; new_5dot22.nProblemsInCurMonth = 1; new_5dot22.nProblemsInCurYear = 1; new_5dot22.isSetAsTop10Worst = 0; new_5dot22.yearMonthForStatistic = yearmonth; bool has = Sx.ModifyA5dot2Tab2Item(new_5dot22); } return(Json(new { result = res })); }