Exemplo n.º 1
0
        /// <summary>
        /// save new diagnosis
        /// </summary>
        public DiagnosticsRes Save(int doctorId, DiagnosticsReq req)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    var cat = new catdiagnostico
                    {
                        idmedico = doctorId,
                        nombre   = req.GroupName,
                        lineas   = string.Join("|", req.List)
                    };

                    Context.catdiagnostico.Add(cat);
                    Context.SaveChanges();
                    scope.Complete();
                    return(new DiagnosticsRes
                    {
                        Id = cat.idcatdiagnostico
                    });
                }
            }
            catch (Exception ex)
            {
                Log.Write($"WebAPI.Services.Diagnostic - Save=> {ex.Message}");
            }
            return(new DiagnosticsRes());
        }
Exemplo n.º 2
0
 //POST /api/diagnostics/1400
 public DiagnosticsRes Post(int doctorId, [FromBody] DiagnosticsReq req)
 {
     return(service.Save(doctorId, req));
 }