Exemple #1
0
        public async Task <string> AddDetalleOrden(int orden, LABORATORIO lab)
        {
            try
            {
                OrdenDTO model = await GetOrden(orden);

                ORDEN_ATE_DETALLE detalle = new ORDEN_ATE_DETALLE()
                {
                    nroOrden       = model.numeroorden,
                    tarifa         = lab.descripcion,
                    PrecioUnitario = lab.precio,
                    cantidad       = 1,
                    descuento      = "0.00",
                    importe        = lab.precio,
                    seguro         = lab.precio,
                    paciente       = "0.00",
                    interviniente  = ""
                };
                await _context.ORDEN_ATE_DETALLE.AddAsync(detalle);
                await Save();

                return("");
            }
            catch (Exception ex)
            {
                return("error" + ex.Message);
            }
        }
Exemple #2
0
        public async Task <IActionResult> SeleccionarLaboratorio(int id)
        {
            int         idorden = Convert.ToInt32(HttpContext.Session.GetInt32("orden"));
            LABORATORIO lab     = await _utilrepository.getLab(id);

            await _ordenRepository.AddDetalleOrden(idorden, lab);

            return(RedirectToAction("OrdenAtencion"));
        }
Exemple #3
0
        public async Task <LABORATORIO> getLab(int id)
        {
            LABORATORIO dato = await(from p in _context.LABORATORIO where p.idLaboratorio == id select p).FirstOrDefaultAsync();

            return(dato);
        }
Exemple #4
0
 public void SaveLaboratorio(LABORATORIO laboratorio)
 {
     try
     {
         using (DQBaseContext context=new DQBaseContext())
         {
             context.LABORATORIO.ApplyChanges(laboratorio);
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }