예제 #1
0
        public async Task <IActionResult> modificar([FromBody] DivisionesMateriasPrimas divisionesMateriasPrimas)
        {
            try
            {
                await _GenericRepository.Update(divisionesMateriasPrimas);

                _UnitOfWork.Commit();

                return(Ok(new Request()
                {
                    status = true,
                    message = "Esta accion se ejecuto correctamente",
                    data = divisionesMateriasPrimas
                }));
            }
            catch (Exception ex)
            {
                return(Ok(new Request()
                {
                    status = false,
                    message = "Se produjo un error inesperado!!",
                    data = ex.Message
                }));
            }
        }
예제 #2
0
        public async Task <IActionResult> registrar([FromBody] DivisionesMateriasPrimas divisionesMateriasPrimas)
        {
            try
            {
                await _GenericRepository.Add(divisionesMateriasPrimas);

                _UnitOfWork.Commit();


                return(Ok(new Request()
                {
                    status = true,
                    message = "La Division de la Materia Prima se registro correctamente",
                    data = divisionesMateriasPrimas
                }));
            }
            catch (Exception ex)
            {
                return(Ok(new Request()
                {
                    status = false,
                    message = "La Division de la  Materia Prima no se registro correctamente!!",
                    data = ex.Message
                }));
            }
        }