public bool UploadPatientPicture(byte[] name, string type, int patientId) { bool handled = false; PatientPicture pic = new PatientPicture { ImageContent = name, //images = name, ImageType = type, PatientID = patientId }; db.PatientPictures.Add(pic); handled = (db.SaveChanges() > 0); return(handled); }
public bool UploadPatientPictureFILE(Stream fileStream, string type, int patientId) { bool handled = false; byte[] documentBytes = new byte[fileStream.Length]; fileStream.Read(documentBytes, 0, documentBytes.Length); PatientPicture pic = new PatientPicture { ImageContent = documentBytes, //images = name, ImageType = type, PatientID = patientId }; db.PatientPictures.Add(pic); handled = (db.SaveChanges() > 0); return(handled); }