// POST api/<controller>
        public ResponseMessage Post([FromBody]dr_message info)
        {
            dr_message_Bll messageBll = new dr_message_Bll();
            string error = string.Empty;

            dr_message message = new dr_message();
            message.Initial();
            message.drid = DoctorID;
            message.msg_content = info.msg_content;
            message.attach_file1 = info.attach_file1;
            message.attach_file2 = info.attach_file2;
            message.attach_file3 = info.attach_file3;
            messageBll.CreateDrMessage(message,out error);

            Model.ResponseMessage result = new ResponseMessage();
            if (!string.IsNullOrEmpty(error))
            {
                result.bSuccess = true;
            }
            else
            {
                result.bSuccess = false;
                result.Message = error;
            }
            return result;
        }
Beispiel #2
0
 public dr_message CreateDrMessage(dr_message info, out string error)
 {
     error = string.Empty;
     try
     {
         db.dr_message.Add(info);
         db.SaveChanges();
         return info;
     }
     catch (System.Data.Entity.Validation.DbEntityValidationException ex)
     {
         error = Share.BaseTool.FormatExceptionMessage(ex);
         return null;
     }
 }
Beispiel #3
0
 public dr_message CreateDrMessage(dr_message info, out string error)
 {
     error = string.Empty;
     try
     {
         dr_message_DA da = new dr_message_DA();
         da.CreateDrMessage(info, out error);
         return info;
     }
     catch (Exception ex)
     {
         error += Share.BaseTool.FormatExceptionMessage(ex);
         return null;
     }
 }