public List <ContourDetails> GetContourDetailsByMedicalRecordId(long medicalRecordId) { using (var db = new PhysicManagementEntities()) { var Entities = db.ContourDetails.Where(x => x.Contour.MedicalRecordId == medicalRecordId).ToList(); return(Entities); } }
public List <Model.TreatmentCategoryService> GetTreatmentCategoriesServiceByTreatmentCategoryId(int treatmentCategoryId) { using (var db = new PhysicManagementEntities()) { var Entity = db.TreatmentCategoryService.Where(e => e.TreatmentCategoryId == treatmentCategoryId && e.IsActive == true).ToList(); return(Entity); } }
public List <MedicalRecord> GetContoursToApprove() { using (var db = new PhysicManagementEntities()) { var c = db.Contour.Where(x => x.ModifyDate == null).Select(x => x.MedicalRecordId).ToList(); return(db .MedicalRecord .Where(x => c.Contains(x.Id)) .Include("Contour").Include("Patient").ToList()); } }
public static bool ChangeUserPassword(int userId, string oldPassword, string newPassword) { using (var db = new PhysicManagementEntities()) { var UserData = GetUserByUserId(userId); string encryptedOldPassword = EncryptPassword(UserData.Username, oldPassword); var userData = GetUserData(UserData.Username, oldPassword); if (userData == null) { throw MegaException.ThrowException("رمز وارد شده اشتباه است."); } string encryptedNewPassword = EncryptPassword(userData.Username, newPassword); UserData.Password = encryptedNewPassword; return(db.SaveChanges() == 1); } }
public bool UpdatePhysicUser(Model.PhysicUser entity) { //var vallidtion = new PhysicUserValidation.PhysicUserEntityValidation().Validate(entity); //if (!vallidtion.IsValid) // throw new ValidationException(vallidtion.Errors); using (var db = new PhysicManagementEntities()) { var Entity = db.PhysicUser.Find(entity.Id); Entity.FirstName = entity.FirstName; Entity.LastName = entity.LastName; Entity.Username = entity.Username; Entity.Password = EncryptPassword(entity.Username, entity.Password); Entity.Mobile = entity.Mobile; Entity.Gender = entity.Gender; Entity.Description = entity.Description; Entity.Gender = entity.Gender; return(db.SaveChanges() == 1); } }