Exemplo n.º 1
0
        public async Task <ActionResult <GRH> > PostGRH(GRH gRH)
        {
            _context.GRHs.Add(gRH);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetGRH", new { id = gRH.GRhID }, gRH));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutGRH(int id, GRH gRH)
        {
            if (id != gRH.GRhID)
            {
                return(BadRequest());
            }

            _context.Entry(gRH).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GRHExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public string PutGRH(int id, GRH grh)
        {
            var entity = _context.GRHs.Find(id);

            if (entity != null)
            {
                entity.CompFilialeID           = grh.CompFilialeID;
                entity.Charge_Compresseur      = grh.Charge_Compresseur;
                entity.Charge_Secteur          = grh.Charge_Secteur;
                entity.Charge_Total            = grh.Charge_Total;
                entity.Compresseur_Pourcentage = grh.Compresseur_Pourcentage;
                entity.Date                = grh.Date;
                entity.Nom                 = grh.Nom;
                entity.Salaire             = grh.Salaire;
                entity.Secheur_Pourcentage = grh.Secheur_Pourcentage;

                // _context.Entry(entity).State = EntityState.Modified;
                _context.SaveChanges();
                return("Update Done" + grh.GRhID);
            }
            else
            {
                return("GRh don't Exist");
            }
        }
        public string PostGRH(GRH gRH)
        {
            _context.GRHs.Add(gRH);
            _context.SaveChanges();

            return("Added done" + gRH.GRhID);
        }
Exemplo n.º 5
0
 public string PutGRH(int id, GRH grh)
 {
     return(_gRHsRepository.PutGRH(id, grh));
 }
Exemplo n.º 6
0
 public string PostGRH(GRH gRH)
 {
     return(_gRHsRepository.PostGRH(gRH));
 }
Exemplo n.º 7
0
 public ActionResult <string> PostGRH(GRH gRH)
 {
     return(Ok(_gRHsService.PostGRH(gRH)));
 }
Exemplo n.º 8
0
 public ActionResult <string> PutGRH(int id, GRH gRH)
 {
     return(Ok(_gRHsService.PutGRH(id, gRH)));
 }
 public async Task <string> PostGRH([FromBody] GRH gRH) =>
 await mediator.Send(new CreateGenericCommand <GRH>(gRH));
 public async Task <string> PutGRH([FromRoute] Guid id, [FromBody] GRH grh) =>
 await mediator.Send(new PutGenericCommand <GRH>(id, grh));