public string instertbyonekey(aers_tbl_eventsresume model) { try { //if (!checkevents()) //{ model.EveresId = new aers_sys_seedSqlMapDao().GetMaxID("eventsresume"); DateTime dt = DateTime.Now.AddMonths(-1); model.OperatorDate = dt; model.HappenedDate = Convert.ToDateTime(dt.Year + "-" + dt.Month); model.SendtoDate = DateTime.Now; model.OperatorDate = DateTime.Now; model.Remark = "本月无不良事件(来源:一键上报)"; model.IsFlag = 0; model.ExamineState = "0"; //状态标识为 0 未审核 model.FeedbackState = 0; model.EveresLevel = "--"; model.EveresName = "151"; String stmtId = "aers_tbl_eventsresume_Insert"; ExecuteInsert(stmtId, model); return(model.EveresId); // } } catch (Exception ex) { throw; } }
public string Update(aers_tbl_eventsresume model) { DateTime dt = DateTime.Now; model.OperatorDate = dt; model.IsFlag = 0; model.FeedbackState = 0; String stmtId = "aers_tbl_eventsresume_Update"; ExecuteUpdate(stmtId, model); return(model.EveresId); }
/// <summary> /// 检查当前月份的上月是否已经存上报过无事件 /// </summary> /// <returns></returns> public bool checkevents() { bool res = false; String stmtId = "aers_tbl_eventsresume_FindByDate"; DateTime dt = DateTime.Now.AddMonths(-1); Hashtable ht = new Hashtable(); ht.Add("HappenedDate", dt.Year + "-" + dt.Month + "-01 00:00:00"); aers_tbl_eventsresume obj = ExecuteQueryForObject <aers_tbl_eventsresume>(stmtId, ht); if (obj != null) { res = true; } return(res); }
public string instert(aers_tbl_eventsresume model) { try { model.EveresId = new aers_sys_seedSqlMapDao().GetMaxID("eventsresume"); DateTime dt = DateTime.Now; model.OperatorDate = dt; model.IsFlag = 0; model.FeedbackState = 0; String stmtId = "aers_tbl_eventsresume_Insert"; ExecuteInsert(stmtId, model); return(model.EveresId); } catch (Exception ex) { throw; } }