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()); }
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); } }
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()); }
public async Task <bool> UpdateDoctorInfo(ZabotaDoctorInfo model) { await _doctorInfoRepository.Update(model); return(true); }