public patient_message CreateMessage(patient_message info, out string error) { error = string.Empty; try { patient_message_DA messageDa = new patient_message_DA(); info = messageDa.CreateMessage(info, out error); return info; } catch (Exception ex) { error = Share.BaseTool.FormatExceptionMessage(ex); return null; } }
public patient_message CreateMessage(patient_message info, out string error) { error = string.Empty; try { db.patient_message.Add(info); db.SaveChanges(); return info; } catch (System.Data.Entity.Validation.DbEntityValidationException ex) { error = Share.BaseTool.FormatExceptionMessage(ex); return null; } }