예제 #1
0
        public Task Add(ZabotaDoctorInfo model)
        {
            var path = _uploadPath.GetPath();

            _appDBContext.Doctor
            .Add(new Entities.DoctorInfo
            {
                Id          = model.Id,
                Photo       = "~/" + path.BaseImagePath + "/" + path.Staff + "/" + model.Photo,
                Description = model.Description,
                DoctorId    = model.DoctorId
            });
            return(_appDBContext.SaveChangesAsync());
        }
예제 #2
0
        public async Task <bool> AddDoctorInfo(ZabotaDoctorInfo model)
        {
            var schedule = await JsonSchedule();

            if (!String.IsNullOrEmpty(schedule.FirstOrDefault(c => c.Doctor.Id == model.DoctorId).Doctor.Name))
            {
                await _doctorInfoRepository.Add(model);

                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
        public Task Update(ZabotaDoctorInfo model)
        {
            _appDBContext.Doctor
            .AsQueryable()
            .Where(x => x.Id == model.Id)
            .Update(r => new Entities.DoctorInfo
            {
                Id          = model.Id,
                Description = model.Description,
                Photo       = model.Photo,
                DoctorId    = model.DoctorId
            });

            return(_appDBContext.SaveChangesAsync());
        }
예제 #4
0
        public async Task <bool> UpdateDoctorInfo(ZabotaDoctorInfo model)
        {
            await _doctorInfoRepository.Update(model);

            return(true);
        }