예제 #1
0
 public bool Add(Lab item)
 {
     if (_labRepository.GetSingleById(item.Id) == null && !_labRepository.Exists(m => m.Name.Trim().ToUpper() == item.Name.ToUpper()))
     {
         item.CreatedDate = DateTime.Now;
         _labRepository.Add(item);
     }
     return(true);
 }
예제 #2
0
        public async Task <object> PostLabModel(LabInputModel labModel)
        {
            object result;

            if (await _labRepository.GetByName(labModel.Name) == null)
            {
                result = await _labRepository.Add(labModel);
            }
            else
            {
                result = "bad request";
            }

            if (result.Equals("bad request"))
            {
                return(BadRequest());
            }
            else
            {
                return(result);
            }
        }
예제 #3
0
 public void createLab(LabMaster labmaster)
 {
     _labRepository.Add(labmaster);
     _unitOfWork.Commit();
 }