Example #1
0
        public async Task Create(PracticeEntity model)
        {
            var userId = _httpContext.User.Identity.GetUserId();

            _context.Practice.Add(model);
            await _context.SaveChangesAsync(userId);
        }
Example #2
0
        public async Task UpdatePractice(PracticeEntity practice)
        {
            var practicePut = await PIDBContext.Practices.SingleAsync(c => c.Id == practice.Id);

            practicePut.Title        = practice.Title;
            practicePut.Question     = practice.Question;
            practicePut.TrueAnswer   = practice.TrueAnswer;
            practicePut.FalseAnswer1 = practice.FalseAnswer1;
            practicePut.FalseAnswer2 = practice.FalseAnswer2;
            practicePut.FalseAnswer3 = practice.FalseAnswer3;
        }
Example #3
0
        public PracticeModel(PracticeEntity entity)
        {
            Practice    = entity.PracticeAbbr;
            Practice_ID = entity.PracticeId;
            Environment = entity.Environment;
            Address1    = entity.Address1;
            Address2    = entity.Address2;
            City        = entity.City;
            State       = entity.State;
            Zip         = entity.Zip;
            Phone       = entity.Phone;

            PracticePK = entity.PracticePk;
        }
Example #4
0
        private static PracticeEntity FetchPractice(string practiceAbbr)
        {
            var path = new PrefetchPath2((int)EntityType.PracticeEntity);

            path.Add(PracticeEntity.PrefetchPathClinics);

            var practiceEntity = new PracticeEntity();

            practiceEntity.PracticeAbbr = practiceAbbr;
            using (IDataAccessAdapter adapter = AdapterFactory.CreateAdapter(MyNameSpace))
            {
                bool fetchResult = adapter.FetchEntityUsingUniqueConstraint(practiceEntity,
                                                                            practiceEntity.ConstructFilterForUCPracticeAbbr(),
                                                                            path);
                if (!fetchResult)
                {
                    // Not found. Place handle code here.
                    return(null);
                }
            }
            return(practiceEntity);
        }
Example #5
0
 public void AddPractice(PracticeEntity practice)
 {
     PIDBContext.Entry(practice.Section).State = EntityState.Unchanged;
     PIDBContext.Practices.Add(practice);
 }
Example #6
0
 public Task Update(PracticeEntity model)
 {
     throw new NotImplementedException();
 }