public PedidoResponse PostPedido(Fcrmvh _pedido, string _tipoOperacion, bool pagoEfectivo)
        {
            string companyName = pagoEfectivo ? Configuration["CompanyNameEfectivo"] : Configuration["CompanyName"];

            FC_RR_FCRMVH oFCRMVH = new FC_RR_FCRMVH("admin", Configuration["PasswordAdmin"], companyName, Configuration, Logger);

            oFCRMVH.InstancioObjeto(_tipoOperacion);

            Type typePedido = _pedido.GetType();

            System.Reflection.PropertyInfo[] listaPropiedades = typePedido.GetProperties();

            oFCRMVH.AsignoaTM <Fcrmvh>("FCRMVH", _pedido, 1);

            foreach (Fcrmvi item in _pedido.Items)
            {
                oFCRMVH.AsignoaTM <Fcrmvi>("FCRMVI", item, 2);
            }

            Save PerformedOperation = oFCRMVH.Save();

            bool   result       = PerformedOperation.Result;
            string mensajeError = PerformedOperation.errorMessage;


            oFCRMVH.CloseObjectInstance();

            if (result == false)
            {
                return(new PedidoResponse("Bad Request", mensajeError));
            }

            return(new PedidoResponse("Pedido Generado Exitosamente"));
        }
Beispiel #2
0
 public FacturasRepository(ApiNosisContext context, Serilog.ILogger logger, IConfiguration configuration, FC_RR_FCRMVH oInstanceFCRMVH) :
     base(context, configuration, logger)
 {
     oFcrmvh = oInstanceFCRMVH;
 }