예제 #1
0
 public async Task <SemenAnalysis> SaveSemenAnalysisAsync(SemenAnalysis semenanalysis)
 {
     using (var txScope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
     {
         if (semenanalysis.IsNew)
         {
             await AddSemenAnalysisAsync(semenanalysis);
         }
         else
         {
             await UpdateSemenAnalysisAsync(semenanalysis);
         }
         // One To One
         if (semenanalysis.Patient != null)
         {
             if (semenanalysis.Patient.IsDeleted)
             {
                 var id = semenanalysis.Patient.PatientID;
                 await Conn.DeleteByIdAsync <Patient>(id);
             }
             else if (!semenanalysis.Patient.IsDeleted)
             {
                 var patient = semenanalysis.Patient;
                 patient.PatientID = semenanalysis.SerialNo;
                 await Conn.SaveAsync(patient);
             }
         }
         txScope.Complete();
     }
     return(semenanalysis);
 }
예제 #2
0
        public async Task <SemenAnalysis> AddSemenAnalysisAsync(SemenAnalysis semenanalysis)
        {
            await Conn.InsertAsync(semenanalysis);

            semenanalysis.SerialNo = Conn.LastInsertId();
            return(semenanalysis);
        }
예제 #3
0
 public SemenAnalysis SaveSemenAnalysis(SemenAnalysis semenanalysis)
 {
     using (var txScope = new TransactionScope())
     {
         if (semenanalysis.IsNew)
         {
             AddSemenAnalysis(semenanalysis);
         }
         else
         {
             UpdateSemenAnalysis(semenanalysis);
         }
         // One To One
         if (semenanalysis.Patient != null)
         {
             var patient = semenanalysis.Patient;
             patient.PatientID = semenanalysis.SerialNo;
             Conn.Save(patient);
         }
         txScope.Complete();
     }
     return(semenanalysis);
 }
예제 #4
0
        public IActionResult AddSemenAnalysis([FromBody] SemenAnalysis model)
        {
            _repo.Add(model);

            return(new OkObjectResult(new { SemenAnalysisId = model.SemenAnalysisId }));
        }
예제 #5
0
        public SemenAnalysis UpdateSemenAnalysis(SemenAnalysis semenanalysis)
        {
            var result = Conn.Update(semenanalysis);

            return(semenanalysis);
        }
예제 #6
0
 public SemenAnalysis AddSemenAnalysis(SemenAnalysis semenanalysis)
 {
     Conn.Insert(semenanalysis);
     semenanalysis.SerialNo = Conn.LastInsertId();
     return(semenanalysis);
 }
예제 #7
0
 public async Task <SemenAnalysis> SaveSemenAnalysisAsync(SemenAnalysis semenanalysis)
 {
     return(null);
 }
예제 #8
0
 public Task <SemenAnalysis> AddSemenAnalysisAsync(SemenAnalysis semenanalysis)
 {
     return(null);
 }
예제 #9
0
 public SemenAnalysis SaveSemenAnalysis(SemenAnalysis semenanalysis)
 {
     return(null);
 }
예제 #10
0
 public SemenAnalysis UpdateSemenAnalysis(SemenAnalysis semenanalysis)
 {
     return(null);
 }
예제 #11
0
 public SemenAnalysis AddSemenAnalysis(SemenAnalysis semenanalysis)
 {
     return(null);
 }
예제 #12
0
        public async Task <SemenAnalysis> UpdateSemenAnalysisAsync(SemenAnalysis semenanalysis)
        {
            await Conn.UpdateAsync(semenanalysis);

            return(semenanalysis);
        }