Exemplo n.º 1
0
 public ItemFactura(Consumo Consumo)
 {
     this.Consumo     = Consumo;
     this.Precio      = Consumo.Consumible.Precio;
     this.Descripción = Consumo.Consumible.Descripción;
     this.Cantidad    = Consumo.Cantidad;
 }
Exemplo n.º 2
0
        public ItemFactura(DataRow row)
        {
            Row = row;

            Id       = GetValue <int>("id_item_factura");
            Consumo  = new Consumo(row);
            Leyenda  = GetValue <string>("leyenda");
            Subtotal = GetValue <decimal>("subtotal");
            Factura  = new Factura(row);
        }
Exemplo n.º 3
0
        public int agregar(Consumo consumo)
        {
            conexion.Open();
            SqlCommand cmd = new SqlCommand("NPM.P_Insertar_consumo", conexion);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@estadia", consumo.Estadia);
            cmd.Parameters.AddWithValue("@habitacion", consumo.Habitacion);
            cmd.Parameters.AddWithValue("@nombre", consumo.Consumible);
            cmd.Parameters.AddWithValue("@cantidad", consumo.cantidad);

            retorno = cmd.ExecuteNonQuery();
            conexion.Close();
            return(retorno);
        }