示例#1
0
        public bool RegistrarDetalleFacturaProveedor(DetalleFacturaProveedor objDetalleFactura)
        {
            bool          resultado = false;
            SqlCommand    cmd       = null;
            SqlConnection cn        = null;

            try
            {
                cn              = Conexion.GetInstance().ConexionDB();
                cmd             = new SqlCommand("SP_REGDETALLEFACTURA", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PREUNITARIO", objDetalleFactura.PreUnitario);
                cmd.Parameters.AddWithValue("@CANTIDAD", objDetalleFactura.Cantidad);
                cmd.Parameters.AddWithValue("@IMPORTE", objDetalleFactura.Importe);
                cmd.Parameters.AddWithValue("@NROFACTURA", objDetalleFactura.FacturaProveedor.NroFactura);
                cmd.Parameters.AddWithValue("@CODMEDICAMENTO", objDetalleFactura.Medicamento.CodMedicamento);
                cn.Open();

                resultado = cmd.ExecuteNonQuery() >= 1 ? true : false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cn.Close();
            }
            return(resultado);
        }
示例#2
0
 public bool RegistrarDetalleFacturaProveedor(DetalleFacturaProveedor objDetalleFactura)
 {
     try
     {
         return(FacturaProveedorDAO.GetInstance().RegistrarDetalleFacturaProveedor(objDetalleFactura));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
        public static bool RegistrarDetalleFacturaProveedor(decimal _precio, int _cantidad, decimal _importe, string _nroFactura, string _codMedicamento)
        {
            bool resultado = false;
            DetalleFacturaProveedor objDetalleFactura = new DetalleFacturaProveedor()
            {
                FacturaProveedor = new FacturaProveedor()
                {
                    NroFactura = _nroFactura
                },
                PreUnitario = _precio,
                Cantidad    = _cantidad,
                Importe     = _importe,
                Medicamento = new Medicamento()
                {
                    CodMedicamento = _codMedicamento
                }
            };

            return(resultado = FacturaLN.GetInstance().RegistrarDetalleFacturaProveedor(objDetalleFactura));
        }