public ActionResult GetBackCall(string taskCode) { BLL.Notice.Back back = new BLL.Notice.Back(); TBackCall result = back.GetBackCall(taskCode); if (result != null) { return(Json(new { Result = true, Doctor = result.医生, Nurse = result.护士, Driver = result.司机, Dispatcher = result.调度, Stretcher = result.担架, Remark = result.备注, Reason = result.回访结果 })); } else { return(Json(new { Result = false })); } }
public static void SaveBackCall(TBackCall entity) { using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch)) { var model = dbContext.TBackCall.FirstOrDefault(t => t.任务编码 == entity.任务编码); if (model == null) { dbContext.TBackCall.InsertOnSubmit(entity); } else { model.护士 = entity.护士; model.司机 = entity.司机; model.医生 = entity.医生; model.调度 = entity.调度; model.担架 = entity.担架; model.备注 = entity.备注; model.回访保存时间 = DateTime.Now; model.回访结果 = entity.回访结果; } dbContext.SubmitChanges(); } }
public ActionResult SaveCall() { if (ModelState.IsValid) { bool save = true; try { BLL.Notice.Back back = new BLL.Notice.Back(); TBackCall call = new TBackCall(); call.任务编码 = Request.Form["TaskCode"]; call.司机 = Request.Form["driver"] == "on" ? 1:0; call.医生 = Request.Form["doctor"] == "on" ? 1:0; call.护士 = Request.Form["nurse"] == "on" ? 1:0; call.调度 = Request.Form["dispatcher"] == "on" ? 1 : 0; call.担架 = Request.Form["stretcher"] == "on" ? 1 : 0; call.回访结果 = Request.Form["reason"]; call.备注 = Request.Form["remark"]; call.是否有效 = "有效"; call.回访保存时间 = DateTime.Now; back.SaveBackCall(call); } catch (Exception) { save = false; } if (save) { return(Json(new { IsSuccess = true, Message = "保存成功" }, "text/html", JsonRequestBehavior.AllowGet)); } else { return(Json(new { IsSuccess = false, Message = "保存失败" }, "text/html", JsonRequestBehavior.AllowGet)); } } return(View()); }
public void SaveBackCall(TBackCall entity) { DAL.Notice.Back.SaveBackCall(entity); }