public patient_message_rcd CreateMessageRcd(patient_message_rcd info, out string error) { error = string.Empty; try { patient_message_DA messageDa = new patient_message_DA(); info = messageDa.CreateMessageRcd(info, out error); return info; } catch (Exception ex) { error = Share.BaseTool.FormatExceptionMessage(ex); return null; } }
public patient_message_rcd CreateMessageRcd(patient_message_rcd info, out string error) { error = string.Empty; try { db.patient_message_rcd.Add(info); db.SaveChanges(); return info; } catch (System.Data.Entity.Validation.DbEntityValidationException ex) { error = Share.BaseTool.FormatExceptionMessage(ex); return null; } }
public ActionResult CreatePatientMessageRcd(FormCollection collection) { var content = collection["content"]; int msid = 0; patient_message_rcd info = new patient_message_rcd(); info.Initial(); Base_Bll bll = new Base_Bll(); var message=bll.GetInfo<patient_message>(msid); info.msg_id = message.pkid; info.rcd_contents = content; info.createuser = string.Empty;//回复人:助理/医生名字 string error = string.Empty; new patient_message_Bll().CreateMessageRcd(info,out error); if(!string.IsNullOrEmpty(error)) { ViewBag.ErrorMessage = "回复失败"; } return View(info); }