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); }
public async Task <SemenAnalysis> AddSemenAnalysisAsync(SemenAnalysis semenanalysis) { await Conn.InsertAsync(semenanalysis); semenanalysis.SerialNo = Conn.LastInsertId(); return(semenanalysis); }
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); }
public IActionResult AddSemenAnalysis([FromBody] SemenAnalysis model) { _repo.Add(model); return(new OkObjectResult(new { SemenAnalysisId = model.SemenAnalysisId })); }
public SemenAnalysis UpdateSemenAnalysis(SemenAnalysis semenanalysis) { var result = Conn.Update(semenanalysis); return(semenanalysis); }
public SemenAnalysis AddSemenAnalysis(SemenAnalysis semenanalysis) { Conn.Insert(semenanalysis); semenanalysis.SerialNo = Conn.LastInsertId(); return(semenanalysis); }
public async Task <SemenAnalysis> SaveSemenAnalysisAsync(SemenAnalysis semenanalysis) { return(null); }
public Task <SemenAnalysis> AddSemenAnalysisAsync(SemenAnalysis semenanalysis) { return(null); }
public SemenAnalysis SaveSemenAnalysis(SemenAnalysis semenanalysis) { return(null); }
public SemenAnalysis UpdateSemenAnalysis(SemenAnalysis semenanalysis) { return(null); }
public SemenAnalysis AddSemenAnalysis(SemenAnalysis semenanalysis) { return(null); }
public async Task <SemenAnalysis> UpdateSemenAnalysisAsync(SemenAnalysis semenanalysis) { await Conn.UpdateAsync(semenanalysis); return(semenanalysis); }