public static void Remove_MedicalEventDetail(int pMedicalEventDetailsId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEventDetail medicalEventDetail_db = dc.MedicalEventDetails.Where(p => p.Id.Equals(pMedicalEventDetailsId)).FirstOrDefault <MedicalEventDetail>(); dc.MedicalEventDetails.DeleteObject(medicalEventDetail_db); dc.SaveChanges(); } }
public static void Update_MedicalEventDetail(MedicalEventDetailBE medicalEventDetail, Guid guid) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEventDetail medicalEventDetail_db = dc.MedicalEventDetails.Where(p => p.Id.Equals(medicalEventDetail.Id)).FirstOrDefault <MedicalEventDetail>(); medicalEventDetail_db.Code = medicalEventDetail.Code; medicalEventDetail_db.Description = medicalEventDetail.Description; medicalEventDetail_db.MedicalEventId = medicalEventDetail.MedicalEventId; dc.SaveChanges(); } }
public static void Insert_MedicalEventDetail(MedicalEventDetailBE medicalEventDetail, Guid guid) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEventDetail medicalEventDetail_db = new MedicalEventDetail(); medicalEventDetail_db.Code = medicalEventDetail.Code; medicalEventDetail_db.Description = medicalEventDetail.Description; medicalEventDetail_db.MedicalEventId = medicalEventDetail.MedicalEventId; medicalEventDetail_db.DetailType = medicalEventDetail.DetailType; medicalEventDetail_db.RelevanceType = medicalEventDetail.RelevanceType; medicalEventDetail_db.ActiveRelevance = medicalEventDetail.ActiveRelevance; medicalEventDetail_db.Observations = medicalEventDetail.Observations; dc.MedicalEventDetails.AddObject(medicalEventDetail_db); dc.SaveChanges(); } }