public void testCallBack(int timer_id, string user_params) { JObject item = (JObject)JsonConvert.DeserializeObject(user_params); int eneity_id = Convert.ToInt32(item["entity_id"]); string event_name = item["event_name"].ToString(); DSEventDetail ds = new DSEventDetail(); DateTime now = DateTime.Now; ds.year = now.Year; ds.month = now.Month; ds.day = now.Day; ds.week = WeekOfMonth(now, 1); ds.state = 0; ds.entity_id = eneity_id; //List<UI_MISSION> AllHistoryMiss = CWFEngine.GetHistoryMissions(eneity_id); UI_MISSION u = CWFEngine.GetActiveMission <Person_Info>(eneity_id, null, false); string work_name = u.WE_Name; string event_desc = u.WE_Event_Desc; ds.event_name = work_name + ":" + event_desc; Timer_Jobs tj = js.GetTimerJob(timer_id); ds.DSTime_Desc = tj.STR_RES_2; //if (dm.getdetailbyE_id(eneity_id) == null) dm.AddDsEvent(ds); }
public int AddDsEvent(DSEventDetail ds) { try { using (var db = base.NewDB()) { DSEventDetail newds = db.DSEventDetail.Add(ds); db.SaveChanges(); return(1); } } catch (Exception e) { return(0); } }
public int AddDsEvent(DSEventDetail ds) { return(md.AddDsEvent(ds)); }